Please help with storing strings in codespace


Results 1 to 4 of 4

Threaded View

  1. #1
    Join Date
    Dec 2005
    Posts
    46

    Default Please help with storing strings in codespace

    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?

    Code:
    --[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?
    Code:
    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
    Last edited by g-hoot; - 15th May 2008 at 17:42.

Similar Threads

  1. Storing STRINGS in codespace
    By Peaps in forum PBP Wish List
    Replies: 2
    Last Post: - 14th May 2008, 06:18
  2. How to write/read strings EEPROM/LCD
    By g-hoot in forum mel PIC BASIC Pro
    Replies: 22
    Last Post: - 11th February 2007, 06:26
  3. Processing lengthy strings
    By sougata in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 21st March 2006, 05:27
  4. Storing Strings using the Write command
    By BobP in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 1st November 2005, 11:31
  5. I2CWRITE writing Strings to EEPROM
    By NavMicroSystems in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 27th March 2005, 19:45

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts