lcd with Hserout and a max232 connections? help


Closed Thread
Results 1 to 7 of 7

Hybrid View

  1. #1
    Join Date
    Jul 2007
    Posts
    65


    Did you find this post helpful? Yes | No

    Default

    Tnx Brian

    for some reasons I still get garbage when sending text string(even with your trick), but single characters as in the following code appear ok...(I see a bunch of lowercase alphabet char)

    For cycle = 25 to 70
    hserout [12,cycle]
    serout PortLCD, N9600, [12,"Hserout loop ",#cycle]
    Pause 200
    next

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    For cycle = 25 to 70
    hserout [12,cycle]
    serout PortLCD, T9600, [12,"Hserout loop ",#cycle]
    Pause 200
    next

    ???

  3. #3
    Join Date
    Jul 2007
    Posts
    65


    Did you find this post helpful? Yes | No

    Default

    I was just testing sending char thru serial Hardware...

    Actually it's 33 to 58 that gives a to z in lower case, to be exact, and it's supposed to be 97 to 122 according to documentation.


    regular Serout is doing the job perfect.

  4. #4


    Did you find this post helpful? Yes | No

    Default

    FYI, if you are really using the meLabs Serial LCD, you don't need the Max part. According to the data for the Serial LCD there is a jumper that will change the input polarity(JP3). Here is what the manual says about HSER signals :

    "Since the serial transmission is done in hardware, it is not possible to set
    the levels to an inverted state to eliminate an RS-232 driver. Therefore a
    suitable driver should be used with HSEROUT."

    Also, I would be very careful about trying to do both HSER and SER commands to the same pin. The hardware serial expects a specific pin to be used, and if the pin is connected to the UART, it may not be usable as a standard I/O. Try taking out the SEROUT code and just run it with HSEROUT.

    Another bit from the PBP manual:

    "All baud rates at all oscillator speeds may not be supported by the device. See the Microchip data sheet for the hardware serial port baud rate tables and additional information."

    This means you need to double check the data sheet if you are using any crystal freq other than 4 MHz.
    Last edited by falingtrea; - 6th March 2008 at 19:37.

  5. #5
    Join Date
    Jul 2007
    Posts
    65


    Did you find this post helpful? Yes | No

    Default

    You just reminded me of that *Rx port on the LCD. Went in the spec sheet and as you said, it's a inverted rs-232 port. 8)

    Hooking that up strait the the Hserout pin yield something different, telling me that it's a timing issue going on with Hserout.

    I can now get some Uppercase characters showing up when asking for 33 to 58 char range , but it's randomly working and only when trying to output 1 char at time.
    LCD will show :
    "ABcdefGHijklmnop
    qrstuvwxyz"

    (Strings still show tons of garbage) like hserout [12,"* LED FADER *"]

    I dunno if Hserout is less tolerant than serout, or my code is not correct, but it feel strange that a dedicated mcu serial port cannot drive a lcd display.


    thanks for the inverted port reminder, as the max232 takes a lot of space for such a small function!

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