Shop OBEX P1 Docs P2 Docs Learn Events
SPI interface — Parallax Forums

SPI interface

ArchiverArchiver Posts: 46,084
edited 2001-07-11 18:44 in General Discussion
While we are on the subject of SPI interfaces, I have
been having quite a
difficult time interfacing with a serial LCD display.
The LCD is made by
Crystalfontz, here is a link to the specs
http://www.crystalfontz.com/products/632/index.html .
I have put the unit
into SPI mode and can't seem to successfully send any
data. What shows up on
the screen seems to be random jumble and is not always
the same length of
characters I have sent. I have tried every combination
of coding I can
think of. I even tried inverting the clock signal.
Some of the code I have
tried is listed below. (The program I wrote tries to
display a portion of
the ascii table in order) I am running Win 2k if it
matters. Has anyone had
success with serial LCD interface? Thanks!!
-Nick

DataP con 0 'Data Pin to Ser Disp
Clock con 1 'Shift Clock to Ser Disp

Command var byte

loop var byte

TOP:

for loop = 0 to 127

debug " sending=",loop," "

PAUSE 200

Command=loop

Shiftout DataP,Clock,msbfirst,[noparse][[/noparse]Command\8] 'Send ASCII
character

next

TheEnd:

goto TheEnd








__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2001-07-11 16:09
    Nick I looked at your display it uses RS232 Serial data so try using Serout
    not shiftout

    Nick H wrote:
    >
    > While we are on the subject of SPI interfaces, I have
    > been having quite a
    > difficult time interfacing with a serial LCD display.
    > The LCD is made by
    > Crystalfontz, here is a link to the specs
    > http://www.crystalfontz.com/products/632/index.html .
    > I have put the unit
    > into SPI mode and can't seem to successfully send any
    > data. What shows up on
    > the screen seems to be random jumble and is not always
    > the same length of
    > characters I have sent. I have tried every combination
    > of coding I can
    > think of. I even tried inverting the clock signal.
    > Some of the code I have
    > tried is listed below. (The program I wrote tries to
    > display a portion of
    > the ascii table in order) I am running Win 2k if it
    > matters. Has anyone had
    > success with serial LCD interface? Thanks!!
    > -Nick
    >
    > DataP con 0 'Data Pin to Ser Disp
    > Clock con 1 'Shift Clock to Ser Disp
    >
    > Command var byte
    >
    > loop var byte
    >
    > TOP:
    >
    > for loop = 0 to 127
    >
    > debug " sending=",loop," "
    >
    > PAUSE 200
    >
    > Command=loop
    >
    > Shiftout DataP,Clock,msbfirst,[noparse][[/noparse]Command\8] 'Send ASCII
    > character
    >
    > next
    >
    > TheEnd:
    >
    > goto TheEnd
    >
    > __________________________________________________
    > Do You Yahoo!?
    > Get personalized email addresses from Yahoo! Mail
    > http://personal.mail.yahoo.com/
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and Body
    of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
  • ArchiverArchiver Posts: 46,084
    edited 2001-07-11 16:16
    Hi Nick,

    Your link references to serial displays that also offer SPI mode at 18kHz.
    The stamp shiftout command operates at a significantly higher frequency.
    Try to set the clocksignal yourself low and high while shifting out the
    data.
    Use pause statement to get the required timing. That should do it.
    Under features I find
    Low speed "SPI" (Fclk max=18KHz) and "Inverted TTL" RS-232 for embedded
    applications
    Why not use inverted TTL RS232. This would mean you can use the SEROUT
    command
    using a single stamp I/O pin. Just a thought.

    Greetings peter


    Oorspronkelijk bericht
    Van: Nick H [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=83qVPTU0UF-eOZeMckIjjCDWp4IOFBFMZ73k8Gf9ZVoY8hmuCTrO1l1VaUSjdWfoSIy_kJ962W3ZCYAofA]lightclb@y...[/url
    Verzonden: woensdag 11 juli 2001 15:53
    Aan: basicstamps@yahoogroups.com
    Onderwerp: [noparse][[/noparse]basicstamps] SPI interface

    While we are on the subject of SPI interfaces, I have
    been having quite a
    difficult time interfacing with a serial LCD display.
    The LCD is made by
    Crystalfontz, here is a link to the specs
    http://www.crystalfontz.com/products/632/index.html .
    I have put the unit
    into SPI mode and can't seem to successfully send any
    data. What shows up on
    the screen seems to be random jumble and is not always
    the same length of
    characters I have sent. I have tried every combination
    of coding I can
    think of. I even tried inverting the clock signal.
    Some of the code I have
    tried is listed below. (The program I wrote tries to
    display a portion of
    the ascii table in order) I am running Win 2k if it
    matters. Has anyone had
    success with serial LCD interface? Thanks!!
    -Nick

    DataP con 0 'Data Pin to Ser Disp
    Clock con 1 'Shift Clock to Ser Disp

    Command var byte

    loop var byte

    TOP:

    for loop = 0 to 127

    debug " sending=",loop," "

    PAUSE 200

    Command=loop

    Shiftout DataP,Clock,msbfirst,[noparse][[/noparse]Command\8] 'Send ASCII
    character

    next

    TheEnd:

    goto TheEnd








    __________________________________________________
    Do You Yahoo!?
    Get personalized email addresses from Yahoo! Mail
    http://personal.mail.yahoo.com/

    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.


    Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
  • ArchiverArchiver Posts: 46,084
    edited 2001-07-11 16:32
    It can also be configured via jumpers(solder) to use
    SPI. I didn't want to have to get a Serial
    Communications chip. Thats why I did't use the serial
    interface. Thanks though!!
    -Nick
    Original Message
    From: "L .Gaminde" <lgaminde@t...>
    To: <basicstamps@yahoogroups.com>
    Sent: Wednesday, July 11, 2001 8:09 AM
    Subject: Re: [noparse][[/noparse]basicstamps] SPI interface


    > Nick I looked at your display it uses RS232 Serial
    data so try using Serout
    > not shiftout
    >
    > Nick H wrote:
    > >
    > > While we are on the subject of SPI interfaces, I
    have
    > > been having quite a
    > > difficult time interfacing with a serial LCD
    display.
    > > The LCD is made by
    > > Crystalfontz, here is a link to the specs
    > >
    http://www.crystalfontz.com/products/632/index.html .
    > > I have put the unit
    > > into SPI mode and can't seem to successfully send
    any
    > > data. What shows up on
    > > the screen seems to be random jumble and is not
    always
    > > the same length of
    > > characters I have sent. I have tried every
    combination
    > > of coding I can
    > > think of. I even tried inverting the clock signal.
    > > Some of the code I have
    > > tried is listed below. (The program I wrote tries
    to
    > > display a portion of
    > > the ascii table in order) I am running Win 2k if
    it
    > > matters. Has anyone had
    > > success with serial LCD interface? Thanks!!
    > > -Nick
    > >
    > > DataP con 0 'Data Pin to Ser Disp
    > > Clock con 1 'Shift Clock to Ser Disp
    > >
    > > Command var byte
    > >
    > > loop var byte
    > >
    > > TOP:
    > >
    > > for loop = 0 to 127
    > >
    > > debug " sending=",loop," "
    > >
    > > PAUSE 200
    > >
    > > Command=loop
    > >
    > > Shiftout DataP,Clock,msbfirst,[noparse][[/noparse]Command\8] 'Send
    ASCII
    > > character
    > >
    > > next
    > >
    > > TheEnd:
    > >
    > > goto TheEnd
    > >
    > > __________________________________________________
    > > Do You Yahoo!?
    > > Get personalized email addresses from Yahoo! Mail
    > > http://personal.mail.yahoo.com/
    > >
    > > To UNSUBSCRIBE, just send mail to:
    > > basicstamps-unsubscribe@yahoogroups.com
    > > from the same email address that you subscribed.
    Text in the Subject and Body of the message will be
    ignored.
    > >
    > >
    > > Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed.
    Text in the Subject and Body of the message will be
    ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/
    >
    >

    __________________________________________________
    Do You Yahoo!?
    Get personalized email addresses from Yahoo! Mail
    http://personal.mail.yahoo.com/
  • ArchiverArchiver Posts: 46,084
    edited 2001-07-11 17:12
    Nick not sure but ( you don't need no stinking chip ) really it should work
    fine with one stamp pin 0 to 5 vdc

    Nick H wrote:
    >
    > It can also be configured via jumpers(solder) to use
    > SPI. I didn't want to have to get a Serial
    > Communications chip. Thats why I did't use the serial
    > interface. Thanks though!!
    > -Nick
    >
    Original Message
    > From: "L .Gaminde" <lgaminde@t...>
    > To: <basicstamps@yahoogroups.com>
    > Sent: Wednesday, July 11, 2001 8:09 AM
    > Subject: Re: [noparse][[/noparse]basicstamps] SPI interface
    >
    > > Nick I looked at your display it uses RS232 Serial
    > data so try using Serout
    > > not shiftout
    > >
    > > Nick H wrote:
    > > >
    > > > While we are on the subject of SPI interfaces, I
    > have
    > > > been having quite a
    > > > difficult time interfacing with a serial LCD
    > display.
    > > > The LCD is made by
    > > > Crystalfontz, here is a link to the specs
    > > >
    > http://www.crystalfontz.com/products/632/index.html .
    > > > I have put the unit
    > > > into SPI mode and can't seem to successfully send
    > any
    > > > data. What shows up on
    > > > the screen seems to be random jumble and is not
    > always
    > > > the same length of
    > > > characters I have sent. I have tried every
    > combination
    > > > of coding I can
    > > > think of. I even tried inverting the clock signal.
    > > > Some of the code I have
    > > > tried is listed below. (The program I wrote tries
    > to
    > > > display a portion of
    > > > the ascii table in order) I am running Win 2k if
    > it
    > > > matters. Has anyone had
    > > > success with serial LCD interface? Thanks!!
    > > > -Nick
    > > >
    > > > DataP con 0 'Data Pin to Ser Disp
    > > > Clock con 1 'Shift Clock to Ser Disp
    > > >
    > > > Command var byte
    > > >
    > > > loop var byte
    > > >
    > > > TOP:
    > > >
    > > > for loop = 0 to 127
    > > >
    > > > debug " sending=",loop," "
    > > >
    > > > PAUSE 200
    > > >
    > > > Command=loop
    > > >
    > > > Shiftout DataP,Clock,msbfirst,[noparse][[/noparse]Command\8] 'Send
    > ASCII
    > > > character
    > > >
    > > > next
    > > >
    > > > TheEnd:
    > > >
    > > > goto TheEnd
    > > >
    > > > __________________________________________________
    > > > Do You Yahoo!?
    > > > Get personalized email addresses from Yahoo! Mail
    > > > http://personal.mail.yahoo.com/
    > > >
    > > > To UNSUBSCRIBE, just send mail to:
    > > > basicstamps-unsubscribe@yahoogroups.com
    > > > from the same email address that you subscribed.
    > Text in the Subject and Body of the message will be
    > ignored.
    > > >
    > > >
    > > > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    > >
    > > To UNSUBSCRIBE, just send mail to:
    > > basicstamps-unsubscribe@yahoogroups.com
    > > from the same email address that you subscribed.
    > Text in the Subject and Body of the message will be
    > ignored.
    > >
    > >
    > > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    > >
    > >
    >
    > __________________________________________________
    > Do You Yahoo!?
    > Get personalized email addresses from Yahoo! Mail
    > http://personal.mail.yahoo.com/
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and Body
    of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
  • ArchiverArchiver Posts: 46,084
    edited 2001-07-11 17:34
    Hi Nick,

    I agree with L. Gaminde, if you use the inverted TTL RS232 option that was
    mentioned in the features
    (as was the SPI), there is no need for a RS232 level converter chip. Inverse
    TTL RS232 should work
    fine directly on a stamp I/O pin using SEROUT.

    Greetings peter


    Oorspronkelijk bericht
    Van: Nick H [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=WGGSVbNpHz1UxO9a7OC5wmDrqgiu0P7I2oS_LkTFxkkh_KGljRlNM37-HNxVUFnzuuB3kosw-AzXDg]lightclb@y...[/url
    Verzonden: woensdag 11 juli 2001 16:33
    Aan: basicstamps@yahoogroups.com
    Onderwerp: Re: [noparse][[/noparse]basicstamps] SPI interface

    It can also be configured via jumpers(solder) to use
    SPI. I didn't want to have to get a Serial
    Communications chip. Thats why I did't use the serial
    interface. Thanks though!!
    -Nick
    Original Message
    From: "L .Gaminde" <lgaminde@t...>
    To: <basicstamps@yahoogroups.com>
    Sent: Wednesday, July 11, 2001 8:09 AM
    Subject: Re: [noparse][[/noparse]basicstamps] SPI interface


    > Nick I looked at your display it uses RS232 Serial
    data so try using Serout
    > not shiftout
    >
    > Nick H wrote:
    > >
    > > While we are on the subject of SPI interfaces, I
    have
    > > been having quite a
    > > difficult time interfacing with a serial LCD
    display.
    > > The LCD is made by
    > > Crystalfontz, here is a link to the specs
    > >
    http://www.crystalfontz.com/products/632/index.html .
    > > I have put the unit
    > > into SPI mode and can't seem to successfully send
    any
    > > data. What shows up on
    > > the screen seems to be random jumble and is not
    always
    > > the same length of
    > > characters I have sent. I have tried every
    combination
    > > of coding I can
    > > think of. I even tried inverting the clock signal.
    > > Some of the code I have
    > > tried is listed below. (The program I wrote tries
    to
    > > display a portion of
    > > the ascii table in order) I am running Win 2k if
    it
    > > matters. Has anyone had
    > > success with serial LCD interface? Thanks!!
    > > -Nick
    > >
    > > DataP con 0 'Data Pin to Ser Disp
    > > Clock con 1 'Shift Clock to Ser Disp
    > >
    > > Command var byte
    > >
    > > loop var byte
    > >
    > > TOP:
    > >
    > > for loop = 0 to 127
    > >
    > > debug " sending=",loop," "
    > >
    > > PAUSE 200
    > >
    > > Command=loop
    > >
    > > Shiftout DataP,Clock,msbfirst,[noparse][[/noparse]Command\8] 'Send
    ASCII
    > > character
    > >
    > > next
    > >
    > > TheEnd:
    > >
    > > goto TheEnd
    > >
    > > __________________________________________________
    > > Do You Yahoo!?
    > > Get personalized email addresses from Yahoo! Mail
    > > http://personal.mail.yahoo.com/
    > >
    > > To UNSUBSCRIBE, just send mail to:
    > > basicstamps-unsubscribe@yahoogroups.com
    > > from the same email address that you subscribed.
    Text in the Subject and Body of the message will be
    ignored.
    > >
    > >
    > > Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed.
    Text in the Subject and Body of the message will be
    ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/
    >
    >

    __________________________________________________
    Do You Yahoo!?
    Get personalized email addresses from Yahoo! Mail
    http://personal.mail.yahoo.com/

    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.


    Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
  • ArchiverArchiver Posts: 46,084
    edited 2001-07-11 18:44
    There is a solder jumper which allows for SPI or serial connection. I chose
    SPI because I didn't want to have to use a serial communications chip. The
    Serial display is set to the right mode. Thanks anyway!!
    -Nick
    Original Message
    From: "L .Gaminde" <lgaminde@t...>
    To: <basicstamps@yahoogroups.com>
    Sent: Wednesday, July 11, 2001 8:09 AM
    Subject: Re: [noparse][[/noparse]basicstamps] SPI interface


    > Nick I looked at your display it uses RS232 Serial data so try using
    Serout
    > not shiftout
    >
    > Nick H wrote:
    > >
    > > While we are on the subject of SPI interfaces, I have
    > > been having quite a
    > > difficult time interfacing with a serial LCD display.
    > > The LCD is made by
    > > Crystalfontz, here is a link to the specs
    > > http://www.crystalfontz.com/products/632/index.html .
    > > I have put the unit
    > > into SPI mode and can't seem to successfully send any
    > > data. What shows up on
    > > the screen seems to be random jumble and is not always
    > > the same length of
    > > characters I have sent. I have tried every combination
    > > of coding I can
    > > think of. I even tried inverting the clock signal.
    > > Some of the code I have
    > > tried is listed below. (The program I wrote tries to
    > > display a portion of
    > > the ascii table in order) I am running Win 2k if it
    > > matters. Has anyone had
    > > success with serial LCD interface? Thanks!!
    > > -Nick
    > >
    > > DataP con 0 'Data Pin to Ser Disp
    > > Clock con 1 'Shift Clock to Ser Disp
    > >
    > > Command var byte
    > >
    > > loop var byte
    > >
    > > TOP:
    > >
    > > for loop = 0 to 127
    > >
    > > debug " sending=",loop," "
    > >
    > > PAUSE 200
    > >
    > > Command=loop
    > >
    > > Shiftout DataP,Clock,msbfirst,[noparse][[/noparse]Command\8] 'Send ASCII
    > > character
    > >
    > > next
    > >
    > > TheEnd:
    > >
    > > goto TheEnd
    > >
    > > __________________________________________________
    > > Do You Yahoo!?
    > > Get personalized email addresses from Yahoo! Mail
    > > http://personal.mail.yahoo.com/
    > >
    > > To UNSUBSCRIBE, just send mail to:
    > > basicstamps-unsubscribe@yahoogroups.com
    > > from the same email address that you subscribed. Text in the Subject
    and Body of the message will be ignored.
    > >
    > >
    > > Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >


    _________________________________________________________
    Do You Yahoo!?
    Get your free @yahoo.com address at http://mail.yahoo.com
Sign In or Register to comment.