View previous topic :: View next topic |
Author |
Message |
Storic
Joined: 03 Dec 2005 Posts: 182 Location: Australia SA
|
compiling code to SPI ROM |
Posted: Thu Nov 22, 2007 2:59 pm |
|
|
I dont know if it can be done I want to when compiling a program to the micro, I want to send data to the SPI ROM not to be part of the running program, to be used as a menu data for my RS232 VT100 emulator.
I am using to 24FJ64GA004 QFN micro, it looks like I may run out of ROM space and this is the largest QFN size I can use _________________ What has been learnt if you make the same mistake? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Nov 23, 2007 1:25 pm |
|
|
You can't program an SPI memory chip at compile-time.
You can do this:
1. Write a PIC program which will program the SPI memory with
your LCD data. The only purpose of this PIC program is to load
the SPI chip with the LCD data.
2. Run the program. This will write the LCD data to the SPI chip.
3. Now re-program your PIC with your real application program. |
|
|
Storic
Joined: 03 Dec 2005 Posts: 182 Location: Australia SA
|
|
Posted: Fri Nov 23, 2007 7:22 pm |
|
|
Thanks,
will do this as suggested _________________ What has been learnt if you make the same mistake? |
|
|
Rohit de Sa
Joined: 09 Nov 2007 Posts: 282 Location: India
|
|
Posted: Sat Nov 24, 2007 8:00 pm |
|
|
Hey,
Another solution would be to directly store your data to the SPI memory in hex. You would need a programmer for that. I use the PICKit2. For example, if I have long strings of data to output to an RS232 terminal, instead of wasting ROM space on the PIC, I put strings onto the memory chip, and tell the PIC to request string data from the chip. It saves a load of PIC ROM space. Your strings could either be null terminated (in which case the PIC would have to check for a '0x00' character), or you could store the location of the start of multiple strings in PIC memory and call upon the string when you need. Eg:
<location 0x00>: (String 0)
<location 0x15>: (String 1)
<location 0x59>: (String 2)
.
.
.
.
And my function would be:
{
.
.
display(String_0)
.
.
}
where String_0 = 0x00
Cheers,
Rohit. |
|
|
Storic
Joined: 03 Dec 2005 Posts: 182 Location: Australia SA
|
|
Posted: Sat Nov 24, 2007 10:46 pm |
|
|
Thanks,
I thought of another possible way (maybe).
write the code as normal with a setup procedure to load data from a text file (or hex) on the PC via the RS232 port to fill the SPI ROM with the necessary data required. This way should I want to change the menu data, I just send another TEXT/HEX file from the PC into the SPI ROM. _________________ What has been learnt if you make the same mistake? |
|
|
|