LCD serial backpacks


Closed Thread
Results 1 to 40 of 68

Hybrid View

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

    Default yep

    Quote Originally Posted by skimask
    How are you passing the lcdout 'commands'? i.e. lcdout $fe, 01 to clear the display and things like that?

    If my guess is right, like me, you are basically replacing 'lcdout' with 'serout' on the main board, and this code is to read everything coming the serial port, and sending it out, character by character using a single 'lcdout'.
    Hi Skimask,
    That was the whole point of the endever, to use the standard commands common to lcdout, so as not to have several different codes to control how the lcd prints to screen. It seems most makers of these things have their own little routines, I started with:
    Code:
     serin N2400.PortB.7,char
    lcdout char
    I saw the core code in a post of Darrel's using Hserin
    and knew it would work so I started cutting and sewing,
    Darrel took it and added his instant interrupts, i snipped
    out some more of the unneeded stuff and am still working
    on all the bells and whistles. I like it better than all the
    others I've seen, because it uses unmolested, lcdout type code.
    JS

  2. #2
    skimask's Avatar
    skimask Guest

    Default

    Quote Originally Posted by Joe S.
    Hi Skimask,
    That was the whole point of the .......................
    things have their own little routines, I started with:
    Code:
     serin N2400.PortB.7,char
    lcdout char
    I saw the core code in a post of Darrel's.............
    seen, because it uses unmolested, lcdout type code.
    JS

    I get what you're cooking...I hope
    LCDOut is a familiar command, why mess with it? Replace it with SerOut, and you're done.
    My master plan includes throwing a few buttons on the unit and using a 4 wire hookup (v+, gnd, tx, rx, maybe an RJ11 phone connector).
    If my figuring is right, I'm going to throw in a bit of code that looks for a double $fe (or whatever) and that'll be my signal to send back a code if any keys are pressed. Using an equivalent to an LCDIn command might be a bit trickier (not by much), but that'll come later...

    The only big thing left to do is to find a dozen or so LCDs with backlights. ebay maybe?
    JDG

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

    Default Yes

    Quote Originally Posted by skimask
    I get what you're cooking...I hope
    LCDOut is a familiar command, why mess with it? Replace it with SerOut, and you're done.
    My master plan includes throwing a few buttons on the unit and using a 4 wire hookup (v+, gnd, tx, rx, maybe an RJ11 phone connector).
    If my figuring is right, I'm going to throw in a bit of code that looks for a double $fe (or whatever) and that'll be my signal to send back a code if any keys are pressed. Using an equivalent to an LCDIn command might be a bit trickier (not by much), but that'll come later...

    The only big thing left to do is to find a dozen or so LCDs with backlights. ebay maybe?
    JDG
    Hi skimask,
    Yeah well partly, it is much easier to put a display in a difficult place if you only need to run 3 wires to it, whereas you may have 20 or so going to your main p/c board and it might be real inconveinient to run 20 to your display. I have bought LCD displays from sure electronics on ebay and thay are cheap. I did have one fail though, I think from ESD.
    http://cgi.ebay.com/ws/eBayISAPI.dll...tem=7617627971
    for larger order check his store: http://stores.ebay.com/Sure-Electronics

  4. #4
    skimask's Avatar
    skimask Guest

    Default

    Quote Originally Posted by Joe S.
    Hi skimask,
    Yeah well partly, it is much easier to put a display in a difficult place if you only need to run 3 wires to it, whereas you may have 20 or so going to your main p/c board and it might be real inconveinient to run 20 to your display. I have bought LCD displays from sure electronics on ebay and thay are cheap. I did have one fail though, I think from ESD.
    http://cgi.ebay.com/ws/eBayISAPI.dll...tem=7617627971
    for larger order check his store: http://stores.ebay.com/Sure-Electronics

    Ain't that the truth!
    On every one of my little projects up until the last few, I've always had to design in a method for control and display, and always at the expense of pins, which could be better used for something else. So, on the last few, I built up a control/display module with 4 wires running to it using various LCDs/LEDs and switches/keypads laying around. For each different type of LCD, I have to modify the code to handle it, not to mention mount the thing up. I'm getting tired of that now also.
    It's about time I'm making this standardized module, with a standard LCD, in a standard mount, with standard buttons, using a standard 'library' to run it, and connect it with a standard cable.

    You want to go in and buy up a bunch of LCDs in bulk and save some $$$?

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

    Default $$$$ and it aint hex

    Quote Originally Posted by skimask
    You want to go in and buy up a bunch of LCDs in bulk and save some $$$?
    Sorry, no can do, I got a couple of extras right now ,no space, no bucks.
    JS

  6. #6
    skimask's Avatar
    skimask Guest

    Default

    Oh well...

    Any other takers? 16x2 (or whatever, I'm up for ideas) LCDs in some sort of a quantity buy, split the savings amongst a few of us?

    JDG

  7. #7
    Join Date
    Oct 2006
    Location
    Cape Town SA
    Posts
    23

    Default Much simpler for newbie like me

    That code with interupts and all is pretty hot, but going back to the very first question all he wanted to do was emulate a serial LCD, ie PIC is doing nothing else. I knocked this up yesterday and it works, and doesn't miss anything, very simple - like me! Go on eat me alive!

    A back space key tells pic next char is a command - see commands in the select case area
    A double back space makes it spit out a pangram back at you.


    DEFINE LCD_DREG PORTC 'DATA PORT
    DEFINE LCD_DBIT 4 'STARTING BIT (0 OR 4)
    DEFINE LCD_RSREG PORTC 'REGISTER SELECT PORT
    DEFINE LCD_RSBIT 1 'REGISTER SELECT BIT
    DEFINE LCD_RWREG PORTC 'READ/WRITE SELECT PORT
    DEFINE LCD_RWBIT 2 'READ/WRITE SELECT BIT
    DEFINE LCD_EREG PORTC 'ENABLE PORT
    DEFINE LCD_EBIT 0 'ENABLE BIT
    DEFINE LCD_BITS 4 'BUS SIZE (4 OR 8)
    DEFINE LCD_LINES 2 'LINES IN DIPLAY
    DEFINE LCD_COMMANDUS 2000 'CMD DELAY TIME IN uS
    DEFINE LCD_DATAUS 50 'Data DELAY TIME IN uS
    define Osc 4
    '************************************************* ***********
    ADCON1 = 7 'disable A/d work digital
    TRISB = %00000000 'unused port b set to o/p
    TRISA = %00000000 ' PortA outputs
    TRISC = %00000000 ' PortC outputs
    OPTION_REG.7 = 0 ' Enable PORTB pull-ups

    'T2400 con 16780 '2400bd, driven, inverted, no parity
    T2400 con 396 '2400bd, driven, true, no parity
    'will need to use rs232 inverter
    comsout var PORTA.0
    comsin var PORTA.1
    datarray var byte[1] 'incoming array on rs232
    '************************************************* ***********
    start:
    Pause 500 ' Wait for LCD to startup
    Lcdout $FE, $0C 'turn cursor off


    Lcdout $fe, 1 ' Clear LCD screen
    Lcdout $fe, 2 ' go home
    Lcdout "GPL PIC System"
    Lcdout $FE, $C0 'move cursor to begin of line 2
    Lcdout "Serial in at ",DEC T2400

    Pause 1000 ' Wait 1 second
    Lcdout $fe, 1 ' Clear LCD screen
    '************************************************* ***********
    main: while 1 'forever loop
    serin2 comsin, T2400, [ datarray[0]] 'get a char
    if datarray[0] = 8 then 'next byte is a LCD command after BS received
    serin2 comsin, T2400, [ datarray[0]]
    select case datarray[0]
    case 48 '0 = Clear LCD screen
    Lcdout $fe, 1
    case 49 '1 = move cursor to begin of line 1
    Lcdout $fe, 2
    case 50 '2 = move cursor to begin of line 2
    Lcdout $fe, $C0
    case 51 '3 = move cursor to begin of line 3
    Lcdout $fe, $94
    case 52 '4 = move cursor to begin of line 4
    Lcdout $fe, $D4
    case 8 'BS again so transmit a pangram
    gosub send
    case else 'do nothing
    end select
    else
    Lcdout str datarray\1 'show 1 char to LCd
    endif
    wend

    send: serout2 comsout,T2400,["How quickly daft jumping zebras vex",13,10]
    return
    '************************************************* ***********

    END
    '************************************************* ***********

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. 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 : 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