SPI basics


Closed Thread
Results 1 to 22 of 22

Thread: SPI basics

Hybrid View

  1. #1
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938


    Did you find this post helpful? Yes | No

    Default

    I understand the difference between both asynch- and synchronous transmission and the advantage of the second one.

    Does SPI require always 2 way communication setup? I don't see my display sending some data back to the PIC, does it?

    What is the RS line for?

    Starting to build-up an SPI communication, I'll need to configure the SSP module by firstly switch it ON (SSPCON.5 = 1). Then, according to my display's datasheet, I think the data is transmitted on rising edge but the setting depends on the CKP mode which I don't know what it is about ?!

    Next, there seems to be several ways to send the data; either using SHIFTOUT command or via registers (SSPBUF). Which one is the better way of doing?

    What about speed. My display works at 400kbits/s (or am I wrong), what will be the "safest" setting?

    Name:  4-wire SPI example.jpg
Views: 1483
Size:  25.9 KB

    PS: I'l be on holiday this week...
    Roger

  2. #2
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by flotulopex View Post
    What is the RS line for?
    The RS line on all displays I have seen is used for determining whether the data going to the display is a command for the display or data to be displayed... It should be in the documentation for the display you are using...

    Dave Purola,
    N8NTA

  3. #3
    Join Date
    Oct 2004
    Posts
    440


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by flotulopex View Post
    Does SPI require always 2 way communication setup? I don't see my display sending some data back to the PIC, does it?
    SPI both sends and receives a byte at the same time.
    Just send: SSPBUF = $FF (anything) or receive: dummy = SSPBUF if one way.

    Is your program working with SHIFTOUT?

    Norm

  4. #4
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    699


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by flotulopex View Post
    Does SPI require always 2 way communication setup? I don't see my display sending some data back to the PIC, does it?
    Yes, the display can send some data back to the PIC. I don't know about this particular display, but most GLCD can send data back to the PIC. This data can be anything from a Register value to the RGB value of the pixels that are been displayed in the screen.

    However, if you prefer you can hardwire the display for write-only.

    Robert

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