DIY Serial LCD


Closed Thread
Results 1 to 14 of 14

Thread: DIY Serial LCD

  1. #1
    lwindridge's Avatar
    lwindridge Guest

    Default DIY Serial LCD

    OK, this is mainly for fun but I'm trying to setup a serial LCD using a standard 16x2 LCD panel and a 16F84A.

    Only problem is I just can't get it working properly.

    Has anyone done this before and has some code I can scan over?

    Like I said, I'm just doing this to learn some more about the PIC's and serial communication so it's not a desperate measure to get an all singing all dancing one

    Cheers

    Leigh

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    What you know about your LCD ? Baudrate, command... tell us the exact things you have on hand.

    I'll consider that your serial LCD is a 2400 baud, drive true, and accept common command.

    Serpin VAR PORTB.0
    TRISB.0=0
    Serpin=0
    pause 1000 'waiting for lcd startup

    Serout serpin,0,[$fe,1,"hello",13,10]
    here : goto here
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    But maybe you want to do a kinda serial backpack too...

    Code:
    ' Serial LCD 2400 BAUD
    
    SerData	VAR byte
    SerPin 	VAR PORTB.0 	
    TRISB.0=1
    	
    LCDOut $FE,1	'Clear LCD
    
    Start:
         SERIN SerPin,0,SerData 'receive data
         LCDOut Serdata ' Send to LCD
         GOTO Start
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  4. #4
    lwindridge's Avatar
    lwindridge Guest


    Did you find this post helpful? Yes | No

    Default

    Yep, serial backpack is what I'm attempting to do.

    I've essentially got what you've put in your example, but it just doesn't receive the data effectively enough at all and tends to fill the screen up with garbage.

    I'm sure there's got to be a better way to keep things in sync, but at the mo I can't see it!!

  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Depending on wich baudrate you perform it too. Is it doing the same garbage stuff on 2400 bauds? If you're using PIC to Send data to the PIC may try to add

    DEFINE CHAR_PACING 1000

    and post what happen. If you're using Hyperter, Microcode studio, be sure of the polarity of your SERIN ... i.e True/inverted.

    Case you use Hyperterm you must set SERIN inverted if you're not using any RS-232 inverter (Like MAX232) .

    example for 2400 BAUD

    SERIN Serpin,4,SerData 'receive data from PC inverted

    with this, be sure of your resistor between PIC and PC. Work good between 1K and 10K.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  6. #6
    lwindridge's Avatar
    lwindridge Guest


    Did you find this post helpful? Yes | No

    Default

    Surely for 2400 Inverted the Serin mode should be 396 right?

    Or am I barking up the wrong tree??

  7. #7
    lwindridge's Avatar
    lwindridge Guest


    Did you find this post helpful? Yes | No

    Default

    Ignore me - that's for Serin2 - DOH!!

  8. #8
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Talking

    Hehe, that's happen !!! for serin2 :16780
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  9. #9
    lwindridge's Avatar
    lwindridge Guest


    Did you find this post helpful? Yes | No

    Default

    OK so that kind of works ok now.

    Just need to figure out a way of telling it if there's no valid serial data coming in then just sit tight and wait...

    I guess adding a flow pin might help eh??

  10. #10
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    for sure you can use a flow pin, but most serial LCD backpack on the market doesn't have those... you can simply check the SerData range. In all backpack i did, i've never use this kind of flow control... but if you feel safer with that issue...
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  11. #11
    lwindridge's Avatar
    lwindridge Guest


    Did you find this post helpful? Yes | No

    Default

    I don't really think it'll be an issue, but it just seems that if the port isn't connected to anything it just spurts garbage out everywhere.

    Other than that it seems to be working lovely now!

  12. #12
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    I don't really think it'll be an issue, but it just seems that if the port isn't connected to anything it just spurts garbage out everywhere
    easiest way... pull-down resistor (let's say 22k) to ground.

    That way if your lcd it's not connected... he will see only 0'S
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  13. #13
    lwindridge's Avatar
    lwindridge Guest


    Did you find this post helpful? Yes | No

    Smile

    Well, that's another project sorted - works lovely now!

    Thanks for all your help there Steve.

    Next one in line is interfacing data output using a serial inverter or similar to datalogging software on a PC.

    But that's later...

  14. #14
    solara's Avatar
    solara Guest


    Did you find this post helpful? Yes | No

    Default

    If you have a Palm PDA, you can go wireless with SirPic's simple plug and play interface, and data logging software....
    htttp://www.sirpic.com

Similar Threads

  1. LCD serial backpacks
    By Archangel in forum Serial
    Replies: 67
    Last Post: - 30th December 2010, 04:51
  2. Please help with EDE702 - Serial to LCD interface
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 30th October 2008, 02:48
  3. Play with LCD on PICDEM
    By The IceMan in forum mel PIC BASIC
    Replies: 5
    Last Post: - 22nd August 2008, 16:56
  4. Serial LCD
    By Tobias in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 15th November 2007, 08:31
  5. Need help with LCD number display.
    By Steve Matson in forum mel PIC BASIC
    Replies: 8
    Last Post: - 26th June 2007, 23:07

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