data storage label


Closed Thread
Results 1 to 7 of 7

Hybrid View

  1. #1
    Join Date
    Apr 2008
    Posts
    85


    Did you find this post helpful? Yes | No

    Default

    thanks Darrel,
    i try it but now bad token
    i try to check on the data sheet of 16 f628 have not seen it yet.

  2. #2
    Join Date
    Apr 2008
    Posts
    85


    Did you find this post helpful? Yes | No

    Default

    Hi Darrel

    I could not find the "error level" in the data sheet of 16f628. where is it information from?


    thanks for yuor help

    Minh le

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


    Did you find this post helpful? Yes | No

    Default

    Sorry, I assumed you were using an 18F, which can have problems with EEPROM Math.
    Since you are using a 16F628, please ignore my previous comment.

    Not sure why you would get that error with a 16F, so give this a try and let me know what happens.
    Set you're OSC and LCD defines first ...
    Code:
    <font color="#0000FF"><b><i>'----[EEPROM DATA]----------------------------------------------------------
    </i></b></font><b>EEstring1  </b><font color="#008000"><b>DATA </b></font><font color="#FF0000">&quot;Hello World!&quot;</font>,<font color="#800000"><b>0        </b></font><font color="#0000FF"><b><i>; null-terminated strings in EEPROM
    </i></b></font><b>EEstring2  </b><font color="#008000"><b>DATA </b></font><font color="#FF0000">&quot;Didn't expect That.&quot;</font>,<font color="#800000"><b>0
    
    </b></font><font color="#0000FF"><b><i>'----[Variables / Aliases]--------------------------------------------------
    </i></b></font><b>Idx     </b><font color="#008000"><b>VAR BYTE                 </b></font><font color="#0000FF"><b><i>' String Index pointer
    </i></b></font><b>Char    </b><font color="#008000"><b>VAR BYTE                 </b></font><font color="#0000FF"><b><i>' Character to display
    </i></b></font><b>String  </b><font color="#008000"><b>VAR BYTE                 </b></font><font color="#0000FF"><b><i>' Pointer to String in EEPROM memory
    
    '----[Initialization]-------------------------------------------------------
    </i></b></font><b>CMCON  </b>= <font color="#800000"><b>7
    </b></font><font color="#008000"><b>LCDOUT </b></font><font color="#800000"><b>$FE</b></font>,<font color="#800000"><b>1</b></font>:<b>FLAGS</b>=<font color="#800000"><b>0</b></font>:<font color="#008000"><b>PAUSE </b></font><font color="#800000"><b>250</b></font>:<font color="#008000"><b>LCDOUT </b></font><font color="#800000"><b>$FE</b></font>,<font color="#800000"><b>1</b></font>:<font color="#008000"><b>PAUSE </b></font><font color="#800000"><b>250 </b></font><font color="#0000FF"><b><i>' Initialize LCD
    
    '----[Main program loop]----------------------------------------------------
    </i></b></font><b>Main</b>:
        <font color="#008000"><b>LCDOUT </b></font><font color="#800000"><b>$FE</b></font>, <font color="#800000"><b>1                             </b></font><font color="#0000FF"><b><i>' Clear LCD screen
        </i></b></font><b>String </b>= <b>EEstring1 </b>: <font color="#008000"><b>GOSUB </b></font><b>EEString2LCD   </b><font color="#0000FF"><b><i>' Display String1
        </i></b></font><font color="#008000"><b>PAUSE </b></font><font color="#800000"><b>1000
        </b></font><font color="#008000"><b>LCDOUT </b></font><font color="#800000"><b>$FE</b></font>,<font color="#800000"><b>$C0                            </b></font><font color="#0000FF"><b><i>' move cursor to Line2
        </i></b></font><b>String </b>= <b>EEstring2 </b>: <font color="#008000"><b>GOSUB </b></font><b>EEString2LCD   </b><font color="#0000FF"><b><i>' Display String2
        </i></b></font><font color="#008000"><b>PAUSE </b></font><font color="#800000"><b>1000
    </b></font><font color="#008000"><b>GOTO </b></font><b>Main                                     </b><font color="#0000FF"><b><i>' Rinse &amp; Repeat
    
    '----[Display the specified EE string]--------------------------------------
    </i></b></font><b>EEString2LCD</b>:
        <b>Char </b>= <font color="#800000"><b>$FF                                </b></font><font color="#0000FF"><b><i>' Make sure Char &gt; 0 to start
        </i></b></font><b>Idx </b>= <font color="#800000"><b>0                                   </b></font><font color="#0000FF"><b><i>' start at beginning of string
        </i></b></font><font color="#008000"><b>WHILE </b></font><b>Char </b>&gt; <font color="#800000"><b>0                            </b></font><font color="#0000FF"><b><i>' do Null-terminated string
           </i></b></font><font color="#008000"><b>Read </b></font><b>String </b>+ <b>Idx</b>, <b>Char                </b><font color="#0000FF"><b><i>'    get the character 
           </i></b></font><font color="#008000"><b>IF </b></font><b>Char </b>&gt; <font color="#800000"><b>0 </b></font><font color="#008000"><b>THEN LCDOUT </b></font><b>Char           </b><font color="#0000FF"><b><i>'    display the character,If>0
           </i></b></font><b>Idx </b>= <b>Idx </b>+ <font color="#800000"><b>1                          </b></font><font color="#0000FF"><b><i>' point to next character
        </i></b></font><font color="#008000"><b>WEND
    RETURN
    
    </b></font>
    DT

  4. #4
    Join Date
    Apr 2008
    Posts
    85


    Did you find this post helpful? Yes | No

    Default

    sory Darrel,

    the one i do id for the LED matrix display. the data include happy face. letters....scrolling. for the alphabets i store in one data file , the happy face i do it in another data file.

    i.e. running_letter DATA $10,$10...$30..
    running_face DATA $30, $68....
    the label give out the error when compiled
    ------------------------

    for i = 0 to 3
    READ running_letter +i, temp ; tenp is temporary storage

    next i
    --------------------

    the pic is 16f628
    i could not find rhe ERRORLEVEL in the data sheet of that chip

    thank for your attention

    regards,

Similar Threads

  1. Using Nokia LCD
    By BobP in forum mel PIC BASIC Pro
    Replies: 300
    Last Post: - 3rd May 2018, 04:47
  2. Instant Interrupts - Revisited
    By Darrel Taylor in forum Code Examples
    Replies: 772
    Last Post: - 17th February 2016, 22:14
  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