View previous topic :: View next topic |
Author |
Message |
angel
Joined: 19 Oct 2004 Posts: 40
|
16f876 PIC + char problem |
Posted: Tue Feb 14, 2006 7:01 am |
|
|
Hello
I am working using a PIC 16f876. I need to use a char variable :
char variable[200];
but only I can use a maximun size of 120
char variable[120];
do you know a way to use more memory for my char variable? I think it is a memory problem so if I can increase my memory this problem could disappear.....
Thanks |
|
|
Ttelmah Guest
|
|
Posted: Tue Feb 14, 2006 9:22 am |
|
|
No.
Realistically, the easiest solution is to switch to a 18F chip...
The problem is that on the 18F876, the RAM memory is split into smaller lumps. There are only three blocks of 96 bytes, and one block of 80 bytes available. It is possible to use 16 bytes from the lowest block in one of the upper blocks, to give a maximum continuous block of memory, just 112bytes long. I'm suprised you can actually get 120 to work...
Go can allocate two 96 byte arrays, and have code so that if the address if over 96, this is subtracted, and the second array used. However getting 200 addresses to work is going to be very hard, and suggests you are trying to push the chip too far.
Best Wishes |
|
|
angel
Joined: 19 Oct 2004 Posts: 40
|
OK |
Posted: Wed Feb 15, 2006 4:46 am |
|
|
Hi Ttelmah
Yes you are right. After compiling only I can use now a char of 96. I found some solutions : I tried the command #device *=16 (after compiling I have 28% of the ROM and 48-50% of RAM memory) and I am going to try the commands Write_Back and Read_Bank. I think those commands will arrange my problem. I have to send a SMS message using a modem so another solution could be sending 2 messages instead of one of 200 characters
Thanks for your help |
|
|
|