Tag: MPLABX XC16

Why 16 bit controllers?

Writing about these topics has helped me learn about them, and the posts serve as a reference when I need them. I hope that you also find them a useful reference.
After working with eight-bit controllers–the PIC18 series particularly–I thought of playing around with a couple of 16-bit controllers, specifically the dsPIC33. I spent a lot of time reading the literature, including the compiler and library documentation, forums, and Microchip website. What I found was that 16-bit microcontrollers offer a lot of cool features not found in eight-bit chips: 

  • DMA (Direct Memory Access)
  • Multiple priorities leves for interrupts
  • DSP core (dsPIC’s)
  • More MIPS
  • High Speed ADC’s
  • Dedicated Motor Control PWM (and high speed PWM’s)
  • USB OTG
  • Peripheral Pin Select (Which now available in some 18F series)

    Peripheral pin select: This is a very cool feature. A 16-bit microcontroller with peripheral pin select allows you to assign microcontroller functions to whatever peripheral pins you like. So, if I’m designing a PCB and want the UART functionality to be assigned to particular peripheral pins to make the layout easier, I can switch them in code. There’s no need to use a software UART.

    More interrupt options: The 16-bit microcontrollers I investigated have huge vector tables (actually 2 addresses for each register) and individual interrupt routines for each peripheral. This allows the code to access the interrupt routines quickly and makes for much neater code.

    Direct Memory Access (DMA): DMA is an awesome feature that, when used the right way, allows your controller to handle processes in a way that will look like it is multitasking. DMA is used by communication and ADC peripherals. DMA transfers incoming and outgoing data between the memory and the peripherals with little or no processor intervention. This allows the processor to do other things such as processing the previously collected data. This is perfect for signal processing.

    Digital Signal Processing (DSP) module: Some 16-bit microcontrollers have this module, which will speed up your application if it needs to do a lot of signal processing (and float point operations).

    Clock speed : In eight-bit PICs, the clock is Fosc/4, while the clock speed for 16-bit PICs is  Fosc/2. More speed, right? Don’t jump to that conclusion so quickly. 16-bit PICs have a limit on the oscillator speed (Fosc). Even so, the clock speed is plenty fast if you do a good job of writing efficient code.

    There are a bunch of other cool features that made it tempting for me to explore the 16-bit world. They can handle more peripherals than eight-bit processors and also have Graphical LCD display’s, USB-OTG and many more!!!