Shop OBEX P1 Docs P2 Docs Learn Events
LCD display — Parallax Forums

LCD display

haimhaim Posts: 25
edited 2007-09-27 23:47 in Propeller 1
Hi all,

I am new to the propeller. What connector or pin should I connect a serial LCD display to the demon board? Thanks for the help.

haim
·

Comments

  • Fred HawkinsFred Hawkins Posts: 997
    edited 2007-09-26 13:25
    Hi Haim, welcome.

    It's hard to say. Demon Boards are very particular about witch pin you use. [noparse]:)[/noparse]

    But seriously, pick two that are not 28,29,30 and 31, as well as not among the pins connected to the keyboard, mouse, and monitor. (I think that's all the demo board uses...)

    fred
  • Graham StablerGraham Stabler Posts: 2,507
    edited 2007-09-26 13:28
    On the demo board you are limited to 8 spare io pins so use which ever oes of those you want to, its your choice and a simple software modification if you change later.

    Graham
  • haimhaim Posts: 25
    edited 2007-09-26 14:09
    Thanks, fred and Graham.
  • haimhaim Posts: 25
    edited 2007-09-26 14:36
    by the way, anybody know what number I should use for DPI-216 Parallax 2x16 display? I know use $40F0 for BS2-SX, and $4054 for BS2 for 9600 bps. But I don't know what number to use for Propeller. Please help. Thanks.

    haim
  • Mike GreenMike Green Posts: 23,101
    edited 2007-09-26 14:39
    The Baud parameter for all the Propeller serial I/O drivers is literally the Baud, in your case 9600. Just use whatever rate you need.
  • haimhaim Posts: 25
    edited 2007-09-26 15:00
    Thanks, Mike. I tried, but it only show some symbols only.

    Hai
  • deSilvadeSilva Posts: 2,967
    edited 2007-09-26 22:25
    Could it be a 3V3 problem?
  • BasilBasil Posts: 380
    edited 2007-09-26 23:51
    Hi Haim,

    Do the DIP switch settings on the LCD match the baudrate you are using in the prop object?

    I am using the same LCD myself and got crazy symbols when they didn't match [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    -Alec

    My our page
  • haimhaim Posts: 25
    edited 2007-09-27 02:11
    It works on the BS2, but not on Propeller. Maybe there is something wrong in the code. Please advise.

    CON

    _clkmode = xtal1 + pll16x 'Set clock to 80MHz
    _xinfreq = 5_000_000 'Crystal is 5MHz.
    BaudClock = 80_000_000/9600 'Baud rate is 9600.
    Pin = 7 'TxOUT is pint A30.
    CR = 13 'Carriage return character.

    PUB start

    dira[noparse][[/noparse]Pin] := 1 'Set TxOUT to output.
    outa[noparse][[/noparse]Pin] := 1 'Default level is Mark (high).

    strg(string("Testing... ", cr))
    waitcnt(cnt + clkfreq)


    PUB strg(str_addr)

    repeat strsize(str_addr) 'Repeat for each character in the string:
    tx(byte[noparse][[/noparse]str_addr++]) ' Send the character.

    PUB tx(txbyte) | time

    txbyte := (txbyte | $300) << 2 'Preconfigure start and stop bits into txbyte.
    time := cnt 'Initialize time from counter.
    repeat 20 'Sending 11 bits:
    waitcnt(time += BaudClock) ' Wait for next bit time.
    outa[noparse][[/noparse]Pin] := (txbyte >>= 1) & 1 ' Shift and write the bit.
  • BasilBasil Posts: 380
    edited 2007-09-27 02:21
    Hi Haim,

    I just used the Debug_LCD object [noparse]:)[/noparse]

    EDIT: I take all of the back sorry [noparse]:)[/noparse] Baud = bit/s
    Sorry about that!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    -Alec

    My our page

    Post Edited (Basil) : 9/27/2007 2:33:57 AM GMT
  • deSilvadeSilva Posts: 2,967
    edited 2007-09-27 02:52
    @haim: I should like to put my unanswered question again: Can this be a 3V5 problem? Most of those displays are designed for 5V and work only marginally at 3V3.
  • haimhaim Posts: 25
    edited 2007-09-27 13:26
    I am sorry, deSilva. I tried and make sure there was a 5vdc to power the LCD display. but no luck. Thanks.

    Thanks, Basil. I will try.

    heim
  • Mike GreenMike Green Posts: 23,101
    edited 2007-09-27 13:42
    Why a "repeat 20"? The extra bits will be zeros and they will look like start bits to the LCD and mess up the synchronization of the next character(s). The repeat count really needs to be 11 (or 10 if you want only one stop bit ... usually doesn't matter if it's two stop bits).
  • haimhaim Posts: 25
    edited 2007-09-27 14:19
    oh, sorry. it was 11. Thanks.
  • haimhaim Posts: 25
    edited 2007-09-27 23:47
    OK, Gentlemen. I use a #27977 2x16 serial LCD display that solve the problem. But I am still wondering why the other one doesn't work. I don't think it is the display, it works with BS2. Anyway, I am appreciated all your help. Thanks.

    Hai
Sign In or Register to comment.