View previous topic :: View next topic |
Author |
Message |
bschriek
Joined: 18 Dec 2007 Posts: 80
|
16F18324 memory 4Kbytes or 7Kbytes? |
Posted: Tue Dec 15, 2020 3:05 am |
|
|
CCS compiler PCW IDE 5.092 PCB 5.092 PCM 5.092
Who can explain this?
If you read the datasheet PIC16(L)F18324/18344 you will find the next information:
Memory
• 7 Kbytes Program Flash Memory
• 512B Data SRAM Memory
• 256B of EEPROM
But if you open the 16F18324.H from CCS you will find:
#device PIC16F18324
#nolist
//////// Program memory: 4096x14 Data RAM: 496 Stack: 16
//////// I/O: 12 Analog Pins: 11
//////// Data EEPROM: 256
//////// C Scratch area: 77 ID Location: 8000
I choose this 16F18324 controller because of the large memory but now I'm limited to 4K. The statistics of CCS shows me my memory is full while it's 4K (much below 7K).
Any ideas? |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19520
|
|
Posted: Tue Dec 15, 2020 3:41 am |
|
|
Key difference is one is words and the other bytes.
The memory is 4K*14 bits wide. 7K bytes.
Go to the data sheet. Section 4 'memory organization'. Bottom of the page.
"Program Memory Size (Words)" 4096.
The CCS header is quoting how many instruction words of memory there are.
4K.
So the chip only supports 4K instructions. Not a lot. It is not exactly a
'large' chip. The 16F18325 has 8K words, the 18326 has 16K. You have
the smallest version. |
|
|
bschriek
Joined: 18 Dec 2007 Posts: 80
|
|
Posted: Tue Dec 15, 2020 3:58 am |
|
|
Dear Ttelmah,
Of course, that makes sense.
Thank you. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9229 Location: Greensville,Ontario
|
|
Posted: Tue Dec 15, 2020 6:34 am |
|
|
As a general comment, it's usually better to buy the 'biggest' PIC of a series or family to get maximum codespace, lots of RAM, and EEPROM, at least for 'product development'. Always frustrating to be a few bytes short of space !! Once code is finalized,it might fit into a smaller PIC and save a few pennies per PIC. Often it's overall cheaper to use the 'big' PIC, especially if you include R&D $$ (time and labour) into the true cost of the product. |
|
|
bschriek
Joined: 18 Dec 2007 Posts: 80
|
|
Posted: Tue Dec 15, 2020 6:41 am |
|
|
Yes, I know but I also use this part for other applications too so easy to start with.
Actually this is the first time I'm faced with this memory problem/misunderstanding.
Best regards,
Bas |
|
|
|