Serout2 on LCD Shows Junk Characters


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    Aug 2008
    Location
    Portugal
    Posts
    240


    Did you find this post helpful? Yes | No

    Default Re: Serout2 on LCD Shows Junk Characters

    try with APFCON0.2 = 1, because the chip is initialized with TX on the RC4 pin, (APFCON0.2 = 0), so you must change it. datasheet page 123.
    Thanks and Regards;
    Gadelhas

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


    Did you find this post helpful? Yes | No

    Default Re: Serout2 on LCD Shows Junk Characters

    The Scott Edwards display is expecting Inverted serial levels.
    The USART puts out True levels by default.

    Add this setting ...
    Code:
    BAUDCON.4 = 1  ; Transmit inverted data to the TX/CK pin
    DT

  3. #3


    Did you find this post helpful? Yes | No

    Default Re: Serout2 on LCD Shows Junk Characters

    Quote Originally Posted by Darrel Taylor View Post
    The Scott Edwards display is expecting Inverted serial levels.
    The USART puts out True levels by default.

    Add this setting ...
    Code:
    BAUDCON.4 = 1  ; Transmit inverted data to the TX/CK pin
    Thanks Darrel! It works now except the LCD shows a strange character in the 1st position (looks like "F1" with the "1" being a subscript).

    Code:
    #IFDEF USE_LCD_FOR_DEBUG
        HSEROUT [LCD_INST, LCD_CLR]
        pause 5
        HSEROUT ["DutyVar1=", DEC DutyVar1, 13, 10] ' Send text followed by carriage return and linefeed
    #ENDIF
    
    Main:
       ADCIN 1, adval
       if adval <> oldDutyVar1 then
          oldDutyVar1 = adval
          DutyVar1 = adval
    
          #IFDEF USE_LCD_FOR_DEBUG
             HSEROUT [LCD_INST, LCD_CLR, LCD_L1]
             HSEROUT ["DutyVar1=", DEC DutyVar1, "  ", 13, 10] ' Send text followed by carriage return and linefeed
          #ENDIF
       EndIf
       Pause 100
    Goto Main

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


    Did you find this post helpful? Yes | No

    Default Re: Serout2 on LCD Shows Junk Characters

    HSEROUT [LCD_INST, LCD_CLR, LCD_L1]
    You need at least a 2mS pause after the clear screen command.
    Then you need another LCD_INST before the LCD_L1.
    Or just leave out the LCD_L1 since the clear screen leaves the cursor on line 1.
    Last edited by Darrel Taylor; - 14th January 2013 at 14:52.
    DT

  5. #5


    Did you find this post helpful? Yes | No

    Default Re: Serout2 on LCD Shows Junk Characters

    I have a 5ms pause before the Main loop, but I think it's irrelevant since the ADCIN gets a value which is immediately different than the set value for DutyVar1 (set to 0 earlier in the code) and hence it goes straight into the IF block.

    I'll add a 5ms pause in the IF block, too. And remove the LCD_L1 if it's not needed.

    Thanks again, Darrel!

Similar Threads

  1. Interfacing with Arduino I2C LCD
    By norohs in forum Documentation
    Replies: 47
    Last Post: - 30th May 2017, 18:53
  2. LCD Low Power
    By kduck63 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 5th December 2012, 00:05
  3. Interfacing a Nokia 6233 LCD display
    By dancorneanu in forum General
    Replies: 0
    Last Post: - 13th November 2012, 14:30
  4. Only the first 8 characters.
    By timseven in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 22nd September 2009, 01:43
  5. ascii characters to hex
    By Peter1960 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 26th January 2006, 04:06

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