display received data


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    May 2010
    Posts
    21

    Default display received data

    hi,
    i'm currently working on a project dealing with PIC16f886,xbee and also LCD. the problem is, i need to display my data received from a sensor node in lcd. here i provide u with the TX and RX code.

    TX code:
    Code:
    @ device hs_osc
    define OSC 20
    dta var word
    dta=83
    main:
    High PORTB.0
    pause 50
    serout2 PORTB.1, 84, ["A",dta]
    low portB.0
    Pause 50
    goto main
    end
    RX code:
    Code:
    @ device hs_osc
    define osc 20
    dta var word
    main:
    high portb.0
    pause 50
    serin2 portc.7,84,[wait("A"),dta]
    pause 50
    serout2 portc.6,16468,[dta]
    low portb.0
    pause 50
    goto main
    from the above code, how can i display the characterS to LCD?

    tq
    Last edited by NURULHAIZA; - 11th May 2010 at 10:00.

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,520


    Did you find this post helpful? Yes | No

    Default

    That's because the ASCII code for "S" is 83 which is what you're sending. To display "83", on the receiving end, do:
    Code:
    serout2 portc.6,16468,[DEC dta]

  3. #3
    Join Date
    May 2010
    Posts
    21


    Did you find this post helpful? Yes | No

    Default

    tq for the sugesstion. one more question, how can i display '83' in LCD? is this code below relevant?
    Code:
    @ device hs_osc
    define osc 20
    define LCD_EBIT 1
    DEFINE LCD_RSBIT 0
    DEFINE LCD_DBIT 4
    DEFINE LCD_DREG PORTC
    DEFINE LCD_RSREG PORTC
    DEFINE LCD_EREG PORTC
    dta var word
    main:
    high portb.0
    pause 50
    serin2 portc.7,84,[wait("A"),dta]
    pause 50
    serout2 portc.6,16468,[dta]
    LCDOUT $FE,1
    lcdout #dta
    low portb.0
    pause 50
    goto main

  4. #4
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,520


    Did you find this post helpful? Yes | No

    Default

    Hi,
    I'm sorry, I thought you where using a serial LCD and SEROUT2 to write to that display since there was no LCDOUT in the code in your first post.
    Code:
    dat VAR BYTE
    dat = 83
    LCDOUT $FE, 1, "dat = ", #dat
    Have a look at the manual for the various modifiers that can be used.

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