PDA

View Full Version : pic18F code size problem???



dogi
- 7th March 2005, 21:03
Hi!
Can anybody tell me why the compiled code size of the same program is double size when i compile it for PIC 18F452 vs. PIC16F877?? For example, i wrote a program and compiled it first for 16f877, and it was 7,6kB. Because the program wasn't finished yet i've decide to use pic18f452 which has double program memory size to fit into it. And when i compiled the same program for the new pic the code size was 14,2kB. ??????? I don't understand this. Is this normal?? What am i doing wrong?? Please help!

mister_e
- 7th March 2005, 21:38
hehe, i already think it too.

Here's the explanation.

16F compile WORDS of codes
18F compile BYTES of code

So if you get a 7000 words of compile code with a 18F... divide it by 2 to get the real space it takes 3.5k.

see this thread (http://www.picbasic.co.uk/forum/showthread.php?t=836&highlight=migration)

dogi
- 7th March 2005, 21:52
Thanks a lot!!
This solves all my problems.