transfer a string from ROM to an array - Page 2


Closed Thread
Page 2 of 2 FirstFirst 12
Results 41 to 45 of 45
  1. #41
    Join Date
    May 2013
    Location
    australia
    Posts
    2,383


    Did you find this post helpful? Yes | No

    Default Re: transfer a string from ROM to an array

    this works
    @ da "say \"Hello\"\0"

  2. #42
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    81


    Did you find this post helpful? Yes | No

    Default Re: transfer a string from ROM to an array

    Quote Originally Posted by richard View Post
    where ?
    da – Data ASCII.
    Generates a packed 14-bit number representing two 7-bit ASCII characters.
    4.14 da – STORE STRINGS IN PROGRAM MEMORY (PIC12/16 MCUs)

    Funny, but if you try it you'll see the unwanted 00 added

    db is ok

  3. #43
    Join Date
    May 2013
    Location
    australia
    Posts
    2,383


    Did you find this post helpful? Yes | No

    Default Re: transfer a string from ROM to an array

    db is definitely an easier way to pack a mixed string data statement like "say",34,"hello",34,0 . funny I could never see the point of db until now

  4. #44
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    81


    Did you find this post helpful? Yes | No

    Default Re: transfer a string from ROM to an array

    PICs always have hidden surprises ....

    Ok, understood also indirect addressing now, thanks for your patience :-)

  5. #45
    Join Date
    Aug 2004
    Posts
    64


    Did you find this post helpful? Yes | No

    Default Re: transfer a string from ROM to an array

    Hi:
    I use this routine to send eeprom stored msg's to display LCD.
    It can be modified to send then to a string...
    I hope this helps...
    '************************************************* ***************
    'USED VARS:

    SDAT VAR PORTD.1 'I2C EEPROM DATA 'ADJUST TO USED PINS AND
    SCLK VAR PORTD.0 'I2C EEPROM CLOCK 'MAKE THEM INPUTS IN USED TRIS REG.
    CHAR VAR BYTE
    SLAVE VAR BYTE
    EEADDR VAR WORD
    SLAVE = $A0 'EEPROM SLAVE ADDRESS
    '***** SUB TO DISPLAY MSGS STORED IN EEPROM ****************
    MSG_DISP:
    GOSUB CLRDISP 'CLEAR SCREEN
    MSG:
    LEENXT: I2CREAD SDAT,SCLK,SLAVE,EEADDR,[CHAR] 'SIN CLEAR
    IF CHAR => $80 THEN
    LCDOUT $FE,CHAR
    GOTO INCADD
    ENDIF
    IF CHAR <> 0 THEN
    LCDOUT CHAR
    INCADD: EEADDR = EEADDR + 1
    GOTO LEENXT
    ENDIF
    RETURN
    '************************************************* *************
    'TO CALL THE ROUTINE:
    'SET EEPROM ADDRES:
    'YOUR STRING CAN HAVE ANY LENGTH AND MUST BE TERMINATED WITH A NULL CHAR
    '"00"
    '*********************************************
    EEADDR = $0350 'WHEREVER YOUR STRING STARTS
    GOSUB MSG_DISP
    '*********************************************
    ' YOU MUST USE AN EEPROM WITH WORD ADDRESS (25LC32A,OR BIGGER)
    'PROGRAMM YOUR EEPROM WITH MSGS ENDED WITH 00 (NULL) AND TAKE NOTE OF
    'THE START ADDRESSES.
    'AND THATS ALL...
    Greetings...
    Ruben de la Pena V.

Similar Threads

  1. String of characters(array) to decimal value
    By tacbanon in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 20th June 2012, 15:30
  2. Replies: 3
    Last Post: - 3rd December 2011, 23:48
  3. Array of string to send with TX int ?
    By amgen in forum General
    Replies: 18
    Last Post: - 18th August 2011, 17:56
  4. How to send a string with another string inside it?
    By financecatalyst in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 13th May 2011, 18:11
  5. Manipulation of string array
    By Benny007 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 23rd April 2008, 21:50

Members who have read this thread : 2

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