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

    Quote Originally Posted by flipper_md View Post
    Nice to find some code already made for serial LCD, I just burned the backpack on my cool Serial LCD

    no prob, I had 4 LCDs waiting for me to drive them with a16F628

    I just tried the code with INstant interupt, which took me an hour to setup the whole thing to compile(not bad actually), but now I see only stranges characters appearing on the LCD.

    like I send "b" char, and the dipslay will do '

    do I need to create a map of matching characters, or is there a tweak to get the correct display?

    in attached picture, I've sent AAAAAAAAAAAAaaaaaaaaaa using the serial communicator from Mecanique,
    it displayed ___________________000000000000000 on the LCD?


    it's driven by a 16F628a, running at 20mhz
    Display is 4x20 from Orient Display, saying it's requiring a S6A0069 and is compatible with HD44780 4/8bit.
    http://character-lcd-lcds.shopeio.co...haracter%20Lcd

    I've blanked all define to run from default except for
    DEFINE LCD_LINES 4
    because I ain't know how to tweaks all the parameters.
    Started to play with other defines but not luck yet.

    maybe the answer is in there?
    You have to send the data true, if you send it inverted for some reason then invert it again with a transistor to get true. If you change the defines for the LCD this code will work with the PC boards sold by wulfden too.
    here is a snippet to give you an idea of how to format your code
    serout PortB.4,T9600,[254,128,"9600 baud line 1 T~"] '128 so as not to add space
    serout PortB.4,T9600,[254,192,"9600 baud line 2~"]
    pause 100
    Last edited by Archangel; - 13th October 2008 at 09:17.
    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.

  2. #2
    Join Date
    Jul 2007
    Posts
    65

    Default

    well, for some esoteric reasons the thing started to work by itself after a few restart... this I hate
    I noticed one time i've got one capacitor disconnected on the Xtal... and it seems the PIC woulndt bother?? replugged it live and it kept working.


    since I was sending data from a PC, I assume it was regular RS232.
    Tried to get data from my PIC heartbeat system(which is using N9600) and as you said this format is not ok as is, text was garbaged. I'll need a max232 one day to invert signal.

    In the little time I had to play with the thing, I wondered how I could send data to drive other functions, else than display text?
    Can I do custom characters?
    clear screen? etc

    Another weird thing is that the LCD believe it's second line is the 3rd, when I send a long text. It start filling 1st, then 3rd, then 2nd, and finally 4th one?

    anyways I was just sooooo happy to see some text scrolling


    BUT, this morning it doesn't wan't to behave again, showing garbage text with the same steup! arg :/
    I suspect power problem from my regulator, although it's rated for 1amp.
    it's running way too hot when I plug the backlight of this 4lines monster. I guess this may cause some power problems.
    Actually, this is what fried my other LCD! PLugged in too many things, the regulator busted and started shooting 10V or so...smoke show B]

    for now I just keep doing short tests.

    thanks for the infos!

  3. #3
    Join Date
    Jul 2007
    Posts
    65

    Default

    hummm

    some more testing led me to find that disconnecting the usual ground/Power capacitor can help the whole thing to work?!
    Also switched to a new regulator but this haven't changed anything.

    I couln't get back to have correct display yet. only garbage and ghosts...

    I ran a quick test with regular LCDOUT prg and this do work ok. Even the Lines were accesibles in correct order.
    I suspect USART sync problems, which I couldn't resolve in other projects :/
    How come it is supposed to be the performant solution and 10times more buggy than the software Serin??

    And now this thing wants to play PacMan with me!!
    All the ghost appeared by themself!


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

    Default

    Quote Originally Posted by flipper_md View Post
    well, for some esoteric reasons the thing started to work by itself after a few restart... this I hate
    I noticed one time i've got one capacitor disconnected on the Xtal... and it seems the PIC woulndt bother?? replugged it live and it kept working.


    since I was sending data from a PC, I assume it was regular RS232.
    Tried to get data from my PIC heartbeat system(which is using N9600) and as you said this format is not ok as is, text was garbaged. I'll need a max232 one day to invert signal.

    In the little time I had to play with the thing, I wondered how I could send data to drive other functions, else than display text?
    Can I do custom characters?
    clear screen? etc

    Another weird thing is that the LCD believe it's second line is the 3rd, when I send a long text. It start filling 1st, then 3rd, then 2nd, and finally 4th one?

    anyways I was just sooooo happy to see some text scrolling


    BUT, this morning it doesn't wan't to behave again, showing garbage text with the same steup! arg :/
    I suspect power problem from my regulator, although it's rated for 1amp.
    it's running way too hot when I plug the backlight of this 4lines monster. I guess this may cause some power problems.
    Actually, this is what fried my other LCD! PLugged in too many things, the regulator busted and started shooting 10V or so...smoke show B]

    for now I just keep doing short tests.

    thanks for the infos!
    Ok this thing is written to display with the same commands as used with LCDOUT, so line 1 is 2, line 2 is $C0 or 192, line 3 is $94 or 148, line 4 is $D4 or 212. The LCD we all use having 4 lines are really 2 lines cut in half and displayed as 4 with line 3 being the second half of line 1 and line 4 being the second half of line 2. Put a .01 µF cap on the lcd power terminals. PC COM Port outputs serial data iinverted and must be flipped for use by MAX232 or even a lousey old transistor. Have you tried sending data from another PIC? Just to be sure which post in this thread are you using the code from ? should be post 16.
    Oh it likes to boot up with the serial in pin in the HI state and herserin likes to Idle High as well. I have hooked this up to my computer with a max232 and sent large text files and not overrun the buffer, I say this because it did not go to buffer overrun and always ended with the ending text in the file, it went by WAY too fast to read. I think the little Ghosts are 60 hz due to open input on the PIC.
    Last edited by Archangel; - 14th October 2008 at 08:32.
    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.

  5. #5
    Join Date
    Jul 2007
    Posts
    65

    Default

    thanks Joe

    I will have to try some more when some free time appears!

  6. #6
    Join Date
    Jul 2007
    Posts
    65

    Default

    well,
    f-i-n-a--l-l--y went back into this and made it work, but I think it was a bad component somewhere causing problem (my regulator used to run very hot, and now it's not warm at all!)
    Oh mysteries

  7. #7
    Join Date
    Jul 2007
    Posts
    65

    Default

    added some code into the Instant Interrupt version, to get control of HPWM for the backlight of the LCD. Running a 16F628A @ 20Mhz
    Here is the *working* version ...so far

    I made it to behave like my other LCDs, so to control the backlight it wants to see code like:
    $14$FF 'full power
    $14$00 'off

    I also upped a little program that I use to test the LCD.
    http://www.flipperdesign.com/FlipLCD_control.rar

    Code:
    getbuf:					' move the next character in buffer to bufchar
      @ INT_DISABLE  RX_INT
    
        index_out = (index_out + 1)	' Increment index_out pointer (0 to 63)
    	' Reset pointer if outside of buffer
    	IF index_out > (buffer_size-1) Then index_out = 0	
    	bufchar = buffer[index_out]	' Read buffer location
    
        if skipLCDComm>0 then
           skipLCDComm=skipLCDComm-1
           endif
        ;Routine for buffering LCD commands
        if (GrabBkLt=1) then
           ; WE have signal to watch for value for LCD backlight next
           ; LCDOut $FE,$94,"BACKLIGHT set:<",#bufchar,">"  ; for debug only
    
           HPWM 1,bufchar ,1250    ; Setting Pulse Mod to desired value
           	' Observe minimum FREQ for given OSC speed. 20Mhz is 1221Hz
           ' Next set bufchar to a null char, so I wont be seen/displayed
           bufchar = 24
           Low LedPort 	; Debug only	
           GrabBkLt=0    ; All is done, signal to close the loop
           ;Re-Enable Int and go back up, to skip displaying this char
           @ INT_ENABLE  RX_INT
           goto display
           endif
        ;Following will trigger the routine up here on the next chr received
        ; but if skip if $fe has been called 2 shots ago
        if (bufchar=20) and (skipLCDComm=0) then  ; 14h, trigger for special LCD command
           HIGH LedPort  ; Debug only
           GrabBkLt=1  ; Signal to get the value of backlight level
           ;Re-Enable Int and go back up, to skip displaying this char
           @ INT_ENABLE  RX_INT
           goto display
           endif
        ;Prevent value of 14h to be trapped for other command, we memorize previous call of $FE (254)
        if bufchar=254  then
           skipLCDComm=2 ;
           endif
     
      @ INT_ENABLE  RX_INT
    Return

  8. #8
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959

    Default

    Ah ha, enhancements ...

    Small problem though ...
    getbuf: is a Subroutine.

    Jumping out of a subroutine to the main loop with ...
    Code:
          goto display
    is going to cause some stack problems.

    Try using RETURN at each of those goto's.

    DT

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