Shop OBEX P1 Docs P2 Docs Learn Events
Need help understanding SPI?? — Parallax Forums

Need help understanding SPI??

mikedivmikediv Posts: 825
edited 2009-10-21 02:15 in General Discussion
Hi guys I bought a AT45DB161D 16 Meg flash from spark fun. Its interface is SPI here is my problem I am trying to use some the Prop Obex SPI programs a few of them use the DS1620 temperature sensor and I have that working just fine but
to the actual problem, The DS1620 has pin outs like this
Pin1=DQ
Pin2=CLK/CONV
Pin3=RST
Pin4=GND

and if you look at the Prop Spin code it address these pins , but if you look at other SPI devices they have pins like this

SI
SCK
RESET
CS
SO
GND
VCC
WP
and according to the Wikipedia they are as follows SI= Serial Data,,, SO= Serial Data out you have your CS= chip select, Reset you get the picture so... SO and SI I understand but why are the Parallax SPI chips DQ while the SPI interface says its a 4 wire interface the Parallax is a single pin. How can this be isn't SPI a standard? How can I interpret the Parallax SPI interface to other device interfaces like Atmel??? I tried substituting DQ with SI but it obviously did not work. I would like to use SPI since these new 16 Meg chips I bought use that interface I am hoping I can use them with my Prop proto board to make them hold data and some logging info
As always thank you guys for trying to help

Comments

  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-09-24 00:04
    Mike, just remember that SPI is really just shifting data serially so you need a clock and data, sometimes the data line is common for in and out. To enable and synchronize chips to the clock it is necessary to have an individual enable line per chip which sometimes is called RST because it resets the serial synchronization but that just depends upon how you look at it.

    Just a very quick rundown on your question.
    DQ - well, that's just a way of saying it's a combo of DI (data in) and DO (data out), so it's bidirectional (join the master SDI and SDO out together, maybe with a 1K)
    CLK/CONV  - SPI clock for data transfers and conversion clock otherwise I guess
    RST - SPI enable really
    
    DATAFLASH
    SI            Serial data In                                       Data from master to slaves
    SCK        Serial ClocK                                          Clock from master to slaves
    RESET   Reset (as per spec)                            Application specific
    CS          serial Chip Select                               Chip select from master to the slave
    SO          Serial data Out                                   Data from slave out to master
    GND       
    VCC
    WP        Write Protect (user option)
    
    



    *Peter*

    P.S. Isn't there an object already for SPI dataflash?

    Post Edited (Peter Jakacki) : 9/24/2009 12:09:54 AM GMT
  • mikedivmikediv Posts: 825
    edited 2009-09-24 00:34
    Hey Peter, thank you very helpful, Pete I don't know the few Obex files for SPI that I downloaded are for the DS1620 your description was very helpful I am just confused as to why PArallax SPI was so different from any of the other SPI chips I have purchased
    and viewed the data sheet, I even bought a sparkfun temp sensor it looks just like an npn transistor that has a single wire interface but its proprietary so I guess that does not count.
    It was such a hassle soldering this SMT 16meg part that I wish I could find a simple program for the prop or BS2 that would just acknowledge if I have them connected properly to begin with
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-09-24 00:48
    I can probably dig up a driver for this part I guess or just write one. I have used them before and at present I have the AT26DFxx on some Prop boards as well . The same part is available in an easy to use 8-pin pack as the larger packages are mainly for compatibility with the original parts which used those packs. Skip trying to use the DS1620 driver, I'll get back to you shortly unless someone else does [noparse]:)[/noparse]

    *Peter*
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-09-24 00:56
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2009-09-24 07:09
    I love Wikipedia for background. But more importantly that reading the Wikipedia 'generalized summary' is to read the data sheet for the SPI device you intend to use. There are different approaches to SPI in different hardware. For instance, not all have a WP or 'write protect'. Many don't have a CS and even if they do, this can be cheated if you only have one chip on the SPI bus.

    Much of your confusion will disappear with real use on a workbench. SCK. SI. amd SO are the important I/O lines. GND and
    V+ always exist (it uses electricity right?)

    And Reset is somewhat rare.

    In some cases, SI and SO have been hacked to share the same I/O pin on a microprocessor.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Ain't gadetry a wonderful thing?

    aka G. Herzog [noparse][[/noparse] 黃鶴 ] in Taiwan
  • mikedivmikediv Posts: 825
    edited 2009-10-21 02:15
    Hey guys just realized I never said thank you so Thanks I have the chip wired up to a prop stick I am still not getting the results I think I should I tried just doing a simple read from a basic stamp serout serin commands I am sure the chip is ok I am just not coding properly
Sign In or Register to comment.