HSERIN each character cost 3 pgm words


Closed Thread
Results 1 to 12 of 12

Hybrid View

  1. #1
    Join Date
    Jan 2007
    Posts
    39

    Default HSERIN each character cost 3 pgm words

    Hello,
    I am trying to write simple Web server with 16F648A. This PIC has 4096 pgm words. I have discoverred very uneffective storing of characters in program memory using HSEROUT.

    e.g.

    HSEROUT ["a"] 'cost 3 pgm words
    HSEROUT ["aa"] 'cost 6 pgm words

    So each new character cost 3 pgm words!
    So if I have 4096 pgm memory, I can use in my program just 1000 characters and that's it.
    Anyone has any idea how to use the strings with HSEROUT in a better way?

    Thanks for any idea, i need to use at least 2K of HTML code + program code.

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by boban View Post
    HSEROUT ["a"] 'cost 3 pgm words
    HSEROUT ["aa"] 'cost 6 pgm words
    So each new character cost 3 pgm words!
    So if I have 4096 pgm memory, I can use in my program just 1000 characters and that's it.
    Anyone has any idea how to use the strings with HSEROUT in a better way?
    Each new character takes 3 words...yes...
    One to set the bank register to where the character is located
    One to load the character into the working register
    One to load that same character from the working register over to the serial output register

    This might help...
    http://www.picbasic.co.uk/forum/show...=macro+hserout

  3. #3
    Join Date
    Jan 2007
    Posts
    39


    Did you find this post helpful? Yes | No

    Default Compiler problem

    Hello Skimask,
    first thanks for the reply. I have tried http://www.picbasic.co.uk/forum/show...=macro+hserout seems it is a solution. I have played with it yesterday. But seems I have a problem with the compiler. If I have tried to compile my program for 16F877 it was successfully compiled. But if I have tried to compile it for 16F648A I have the following error:

    Message[306] E:\PICDEVELOPMENTTOOLS\PBP\PBP246\PBPPIC14.LIB 696 : Crossing pageboundary -- ensure page bits are set.
    Message[306] E:\PICDEVELOPMENTTOOLS\PBP\PBP246\PBPPIC14.LIB 624 : Crossing pageboundary -- ensure page bits are set.
    Error[113] E:\PICDEVELOPMENTTOOLS\PBP\PBP246\PBPPIC14.LIB 428 : Symbol not previously defined (EEADRH)
    Error[113] E:\PICDEVELOPMENTTOOLS\PBP\PBP246\PBPPIC14.LIB 442 : Symbol not previously defined (EEADRH)
    Error[113] E:\PICDEVELOPMENTTOOLS\PBP\PBP246\PBPPIC14.LIB 456 : Symbol not previously defined (EEADRH)
    Error[113] E:\PICDEVELOPMENTTOOLS\PBP\PBP246\PBPPIC14.LIB 470 : Symbol not previously defined (EEADRH)
    Error[113] E:\PICDEVELOPMENTTOOLS\PBP\PBP246\PBPPIC14.LIB 797 : Symbol not previously defined (EEADRH)
    Error[113] E:\PICDEVELOPMENTTOOLS\PBP\PBP246\PBPPIC14.LIB 428 : Symbol not previously defined (EEDATH)
    Error[113] E:\PICDEVELOPMENTTOOLS\PBP\PBP246\PBPPIC14.LIB 442 : Symbol not previously defined (EEDATH)
    Error[113] E:\PICDEVELOPMENTTOOLS\PBP\PBP246\PBPPIC14.LIB 456 : Symbol not previously defined (EEDATH)
    Error[113] E:\PICDEVELOPMENTTOOLS\PBP\PBP246\PBPPIC14.LIB 470 : Symbol not previously defined (EEDATH)
    Error[113] E:\PICDEVELOPMENTTOOLS\PBP\PBP246\PBPPIC14.LIB 795 : Symbol not previously defined (EEDATH)

    Seems it is a bug of PBP lib no?

    Boban

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by boban View Post
    If I have tried to compile my program for 16F877 it was successfully compiled. But if I have tried to compile it for 16F648A I have the following error:
    ......
    Seems it is a bug of PBP lib no?
    Boban
    No it doesn't.
    Check the datasheets.
    '877a has an eeadrh register, '648 doesn't.
    '877a can read/write it's own eeprom AND flash program memory.
    '648 can only read/write it's own eeprom.

  5. #5
    Join Date
    Jan 2007
    Posts
    39


    Did you find this post helpful? Yes | No

    Default

    Ahhh ****, ok, so it means, that I cannot use this trick to save the strings to program flash.

    OK, great, so is there any way, how could I store and use the strings more efficiently ?

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by boban View Post
    Ahhh ****, ok, so it means, that I cannot use this trick to save the strings to program flash.

    OK, great, so is there any way, how could I store and use the strings more efficiently ?
    Store it in internal eeprom and read it out from there...or store it in external eeprom...or...or...or...

  7. #7
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by boban View Post
    OK, great, so is there any way, how could I store and use the strings more efficiently ?
    For PIC's that can't access their own flash, the next best option is POKECODE/PEEKCODE, which will work on any chip.

    http://www.picbasic.co.uk/forum/showthread.php?p=51931

    Notice how the "TOO LOW " and "TOO RICH" strings are stored.
    And how it's displayed in the ShowMsg: routine. Just change the LCDOUT to HSEROUT.

    It uses 1 word per character stored.
    Plus about 30 words for the retreival code.
    <br>
    DT

Similar Threads

  1. Replies: 4
    Last Post: - 15th April 2009, 01:54
  2. HSERIN and STR - character encoding
    By boban in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 13th August 2008, 17:36
  3. Hserin, 1st character always lost!
    By Ioannis in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 5th June 2007, 12:49
  4. Someone help me to simplify this
    By thrix in forum General
    Replies: 4
    Last Post: - 21st February 2004, 05:01
  5. Help wanted..
    By thrix in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 17th February 2004, 23:44

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