Data tables again !


Results 1 to 11 of 11

Threaded View

  1. #7
    Join Date
    May 2006
    Location
    Del Rio, TX, USA
    Posts
    343


    Did you find this post helpful? Yes | No

    Question

    Malcom
    Quote Originally Posted by malc-c
    Using your concept code the program fell over when it encountered the line "READ Patt1, steps" so logic suggested that its looking for a location rather than the lable patt1. so I changed the patt1 to read "READ 4, steps" and that compiled OK.
    Exactly what didn't work? I actually did cut and paste this exact code and compiled based on a 16F877A:
    Code:
    patt1 data 17,16,1,2,4,8,16,32,64,128,128,64,32,16,8,4,2,1 
    patt2 data 9,8,129,66,36,24,24,36,66,129 
    patt3 data 17,16,1,3,2,6,4,12,8,24,16,48,32,96,64,192,128,0 
    patt4 data 17,16,1,128,2,64,4,32,8,16,8,32,4,64,2,128,1,0 
    patt5 data 13,12,24,60,126,255,231,195,129,0,129,195,231,255 
    patt6 data 14,13,1,2,4,8,17,34,68,136,16,32,64,128,0 
    patt7 data 9,8,128,64,32,16,8,4,2,1
    
    steps VAR BYTE
    counts VAR BYTE
    temp VAR BYTE
    
    READ Patt1, steps
    FOR counts = 1 TO steps
         READ (Patt1 + counts), temp
         PORTB = temp
    NEXT counts
    And it compiled just fine. I just haven't programmed it into a pic to see what happens.
    -----------------------------------------------------------------------------------
    Additionally, in reference to the following items:
    {Label} DATA {@Location,}Constant{,Constant...}

    If the optional Location value is omitted, the first DATA
    statement starts storing at address 0 and subsequent statements store
    at the following locations.

    READ Address,Var

    Read a byte from the on-chip EEPROM at the specified Address and
    stores the result in Var.
    When using the DATA command with a {label}, what is being done by PBP is the label becomes a constant with a vaule equal to the Address. So there should not be any reason that the read command does not recognized the label as a valid Address.

    Possibly posting you actual code and which PIC your using could help us puzzle this out for you. Also, the exact error/warning message you get when it compiles will also help.


    Steve
    Last edited by SteveB; - 13th June 2006 at 16:35.

Similar Threads

  1. Using Nokia LCD
    By BobP in forum mel PIC BASIC Pro
    Replies: 300
    Last Post: - 3rd May 2018, 04:47
  2. Nokia 3310 display text
    By chai98a in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 26th August 2007, 03:39
  3. Big characters on HD44780 4x20
    By erpalma in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 7th January 2007, 02:21
  4. LCD + bar graph
    By DynamoBen in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 5th October 2005, 14:50
  5. Sinus calculating !
    By Don Mario in forum mel PIC BASIC Pro
    Replies: 29
    Last Post: - 28th November 2004, 23:56

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