HSEROUT to LCD with 16F887


Closed Thread
Results 1 to 15 of 15

Hybrid View

  1. #1
    Join Date
    Jun 2008
    Posts
    84

    Default HSEROUT to LCD with 16F887

    I'm trying to use my LCD (PIB-216) with the USART.
    According to the data sheet the TX output is RC6.
    I tried this code but I only see garbage. Maybe the codes I send ae wrong.
    Please advice.

    Code:
    DEFINE HSER_TXSTA 24h
    DEFINE HSER_SPBRG 25 ' 9600 Bauds
    
    PAUSE 2000
    HIGH PORTD.7
    HSEROUT [254,128,65,65]
    END

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Hi Menta,
    is the serial LCD set to receive true?
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  3. #3
    Join Date
    Jun 2008
    Posts
    84


    Did you find this post helpful? Yes | No

    Default

    What do you mean ?

    If I connect the LCD on portB.1 and send
    SEROUT PORTB.1,6,[254,131,#HH,58]
    It display correctly.

  4. #4
    Join Date
    Jun 2008
    Posts
    84


    Did you find this post helpful? Yes | No

    Default

    I connected PORTC.6 to RB7 (the PICkit 2 UART tool serial input)
    and I see ???????? when the HSEROUT command is printing.

  5. #5
    Join Date
    Jun 2008
    Posts
    84


    Did you find this post helpful? Yes | No

    Default

    ok, I have managed to see the correct data that was send by HSEROUT in the PICkit2 UART tool when setting 2400 baud. I also changed the LCD mode to 2400, but it still show junk.
    Code:
    DEFINE HSER_TXSTA 10100000b
    DEFINE HSER_BAUD 2400
    DEFINE HSER_SPBRG 25 ' 2400 Bauds
    
    PAUSE 2000
    HIGH PORTD.7
    main:
    HSEROUT [65,13,10]
    PAUSE 2000
    goto main

  6. #6
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    You can send data through a serial link either TRUE or INVERTED. I am sure using HSEROUT the data is always true, whereas your serial LCD may be either true or inverted, if your serial LCD is set to accept data in inverted form, then you will see characters looking like gibberish.
    <br>
    You say this works:SEROUT PORTB.1,6,[254,131,#HH,58]<br>
    the 6 is telling me N9600 baud, which is inverted so you must reset in software the serial backpack to accept TRUE in order to read properly.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

Similar Threads

  1. 16f688 LCD what have I done wrong
    By spitfiredriver in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 8th August 2009, 19:54
  2. LCD and HSEROUT do not mix well ?
    By Johan in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 17th November 2008, 16:38
  3. Play with LCD on PICDEM
    By The IceMan in forum mel PIC BASIC
    Replies: 5
    Last Post: - 22nd August 2008, 16:56
  4. Need help with LCD number display.
    By Steve Matson in forum mel PIC BASIC
    Replies: 8
    Last Post: - 26th June 2007, 23:07
  5. Controlling an 240x128 LCD Touchpanel Display
    By Vincent in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 7th June 2006, 23:36

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