Please help with storing strings in codespace


Closed Thread
Results 1 to 4 of 4
  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.

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    Dec 2005
    Posts
    46


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post
    Yes, seen that one many times too. Ya know, I just remembered from back when you and some others helped me get going on storing the strings in EEPROM that "Flash Program Write" is disabled for the 16F648A. So, I guess that means that none of the program code space options will work for me. The peekcode/pokecode commands do use program code space right? I probably just need to do a new board design and go to a bigger chip. I do have a lot of features that I want to add and will need more pins anyway at some point.
    Gary

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by g-hoot View Post
    The peekcode/pokecode commands do use program code space right? I probably just need to do a new board design and go to a bigger chip. I do have a lot of features that I want to add and will need more pins anyway at some point.
    Probably as you said, need to go to a bigger chip...but...
    If you think about it a bit, depending on how your hardware is set up, you might be able to stack a serial eeprom chip, like a 24LC256 on TOP of your 16F648 chip (assuming it's a DIP style chip) and store all of your strings in it that way.
    It's kinda a half-a$$ way of doing things, but hey, if it works........

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 : 1

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