g-hoot
- 15th May 2008, 17:40
Hello,
I have read Melanie's infamous "Making Program Code Space your playground..." post and some others and am trying to do what El AMPo posted below. I still don't grasp what "program code space" really is. I'm using a 16F648A and my program uses all 4K and I also have the EEPROM full of strings, but still need more space. So, since all of the 4K is used, is there still "program code space" that can be used? From what I've read, it sounds like the program would have to be smaller that the 4K and then I could use the rest for program code space, and then the strings would be smaller in program code space than in the regular code space?
--[To Write]--
Just include after the END tag of the program:
POKECODE @[start address],[byte0],[byte1],[byte2]....(up to 79)
(note: start address must be bigger than your program size, and the command only works when programming the pic)
--[To Read]--
(use something like...)
OUT var byte
y var word
For y = [start address] to [start address + nºbytes]
PEEKCODE y, OUT
Next y
I tried something like the code below, and I know it's basic, but I'm very ignorant with this stuff. The LCD displayed something like 237 (can't remember exactly, tried it at home last night). My assumption is that the variable "OUT" is filled in with the value, "AB" in this case, at programming time, so as soon as power is applied, it should display "AB" on the LCD once I have the code right...correct? I guess my mistake is pointing the PEEKCODE command to the correct memory location?
OUT var byte
y var word
pause1000
LCDOut OUT
pause1000
end
@ org $384 'start storing at 900
POKECODE A,B 'stor A and B
For y = 900 to 901
PEEKCODE y, OUT
Next y
I have read Melanie's infamous "Making Program Code Space your playground..." post and some others and am trying to do what El AMPo posted below. I still don't grasp what "program code space" really is. I'm using a 16F648A and my program uses all 4K and I also have the EEPROM full of strings, but still need more space. So, since all of the 4K is used, is there still "program code space" that can be used? From what I've read, it sounds like the program would have to be smaller that the 4K and then I could use the rest for program code space, and then the strings would be smaller in program code space than in the regular code space?
--[To Write]--
Just include after the END tag of the program:
POKECODE @[start address],[byte0],[byte1],[byte2]....(up to 79)
(note: start address must be bigger than your program size, and the command only works when programming the pic)
--[To Read]--
(use something like...)
OUT var byte
y var word
For y = [start address] to [start address + nºbytes]
PEEKCODE y, OUT
Next y
I tried something like the code below, and I know it's basic, but I'm very ignorant with this stuff. The LCD displayed something like 237 (can't remember exactly, tried it at home last night). My assumption is that the variable "OUT" is filled in with the value, "AB" in this case, at programming time, so as soon as power is applied, it should display "AB" on the LCD once I have the code right...correct? I guess my mistake is pointing the PEEKCODE command to the correct memory location?
OUT var byte
y var word
pause1000
LCDOut OUT
pause1000
end
@ org $384 'start storing at 900
POKECODE A,B 'stor A and B
For y = 900 to 901
PEEKCODE y, OUT
Next y