by David John Barker » Wed Feb 12, 2014 10:33 am
The underlying core of 16 and 32 bit Microchip devices are very different (32 being a MIPS core) . However, sticking to native sizes will do no harm - a 16 bit MCU will have good support for 16 bit integer maths and a 32 bit MCU will have good support for 32 bit integer. It's impossible to say if code will be larger or smaller, it depends on what you are doing. 16 and 32 bit variables must be word aligned on 16 bit devices and 16 and 32 bit variables must be long word aligned on 32 bit devices so you will see differences in RAM usage but obviously they are aligned for optimal access for any given core. Personally, I don't really thing about it to much - I tend to use the variable I feel the program needs, rather than the core. I suspect you wouldn't really see much difference when using 8 or 16 bit variables on 32 core devices, but I'm no MIPS expert...