16bit vs 8bit MCU flash userage

Thread Starter

bug13

Joined Feb 13, 2012
2,002
Hi guys

I find that a 16bit mcu use the flash a lot faster than a 8bit muc. In my case, 4K flash is lot for a simple project if i use pic/avr, but because I am using a msp430, the code size is just over 6K, and I end up need to upgrade my 4K msp430 to a 8K msp430.

Are 16bits MCU use more flash? How about 32bit MCU??

Thanks guys
 

shteii01

Joined Feb 19, 2010
4,644
since it is 16 bit mcu, wouldn't it do stuff in 16 bit chunks by default? if so and you do basic stuff, then you waste a lot of bits of those 16 bits, and that means waste a lot of space.
 

MrChips

Joined Oct 2, 2009
34,807
You are comparing limes with oranges with grapefruit.
You need to specify specific MCU, compiler, and show your code in each example.

If you want to keep your code small, don't use floating point and avoid using stock libraries.
 

Thread Starter

bug13

Joined Feb 13, 2012
2,002
You are comparing limes with oranges with grapefruit.
You need to specify specific MCU, compiler, and show your code in each example.

If you want to keep your code small, don't use floating point and avoid using stock libraries.
I guess it's more of a random question when you are in a cafe or something like that.

I didn't test it with the same code, no floating point. I did use a few stock libraries, mainly. E.g. stdint.h

XC8 free vs TI msp430 compiler, pic18f vs msp430g value line vs avr mega/tiny

Again it's just an random question :)
 

MrChips

Joined Oct 2, 2009
34,807
I guess it's more of a random question when you are in a cafe or something like that.

I didn't test it with the same code, no floating point. I did use a few stock libraries, mainly. E.g. stdint.h

XC8 free vs TI msp430 compiler, pic18f vs msp430g value line vs avr mega/tiny

Again it's just an random question :)
In that case I have no evidence that code bloat increases with word size.
My guess is that one tends to do simple 8-bit char and I/O stuff with 8-bit MCU and much more complicated things with 16-bit and 32-bit MCUs.
 
Top