LCD serial backpacks


Closed Thread
Results 1 to 40 of 68

Hybrid View

  1. #1
    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

  2. #2
    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

  3. #3
    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

  4. #4
    Join Date
    Jul 2007
    Posts
    65

    Default

    oh! poor stack
    I will look into options to do it another way.

    stack seemed to survive so far. LOL

    thanks for the tip Darrel

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

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