Shop OBEX P1 Docs P2 Docs Learn Events
Are we stuck without SPI interface — Parallax Forums

Are we stuck without SPI interface

LoopyBytelooseLoopyByteloose Posts: 12,537
edited 2006-07-26 17:04 in Propeller 1
PBasic has SHIFTIN and SHIFTOUT to provide support for SPI, but I cannot locate similar objects in Spin.
Is this something that will be forthcoming or should I be considering it a task that is up for grabs?

It seems everytime SPI is discuss, the topic shifts to I2C.· While I do like I2C, there are products that don't have a license for it and may never get one.



▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"If you want more fiber, eat the package.· Not enough?· Eat the manual."········
···················· Tropical regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2006-07-25 19:40
    I believe the BS2 compatibility object has SHIFTIN/SHIFTOUT methods. Have a look in the library that came with your Propellor Tool software.
  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2006-07-25 19:44
    Kramer,

    SHIFTIN and SHIFTOUT are located within the BS2_Functions object.

    There is even a SHIFTIN_SLV and a SHIFTOUT_SLV mode that is not part of PBasic. These
    are SLAVE modes that basically work the same as SHIFTIN and SHIFTOUT, but the one
    major difference is that in SLAVE mode they rely on an external clock..

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • bambinobambino Posts: 789
    edited 2006-07-25 19:54
    On the demo board, is the·objects communicating with the ps/2 periphels using these modified shift commands or is that top secret?
  • Mike GreenMike Green Posts: 23,101
    edited 2006-07-25 20:29
    The routines for communicating with the PS/2 objects are in the Propellor Tool library as keyboard.spin and mouse.spin. They don't use the BS2 compatibility routines. Their source code is there. Have a look at it.
  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2006-07-25 20:32
    bambino,

    In theory, the SHIFTIN_SLV would work with the "ps/2 peripherals" you mention IF it were fast enough. The objects that
    talk to the "ps/2 peripherals" are written in Assembly. There is no secret or conspiracy.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • bambinobambino Posts: 789
    edited 2006-07-25 20:36
    Thanks Mike,
    I doubt they will let me load the propeller tool here.
    And the old motherboard at home fried the other day.
    I'll take your word for it.

    $79 dollar motherboard·/ 5 bigmacs a week = 5 more months without buying a proppellar!
    ·
  • bambinobambino Posts: 789
    edited 2006-07-26 15:11
    Thanks Beau,

    What I'm getting at ,Since I'm Propless for a while, is possible soldiering on a board that would give the propstick all the demoboards peripherals and only use a serial setup or two. leaving it with most of it's I/O untouched.

    Sorry to hear about your conspiracyless situation, Everyone should have at least one!
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-07-26 15:16
    Thanks,
    I have been having trouble locating all the library items. It hadn't occured to me to look the BS2 compatablity objects. I guess I should load version 0.98 too.

    I even began to ponder DIY in assembler, but I cannot figure out how to do it all. I know in theory how it is done with the SXes, for input the Carry bit is written to on each clock and then rotated unti one has a byte. But it seems that the same Write to Carry function isn't available.

    I will enjoy reading the code to see how the Propeller differs. I can think of several other ways, but it all gets too technical and theoritical.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "If you want more fiber, eat the package.· Not enough?· Eat the manual."········
    ···················· Tropical regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • Mike GreenMike Green Posts: 23,101
    edited 2006-07-26 15:28
    There's an archive recently posted for SD/MMC card access using SPI in both SPIN and assembler in this thread <http://forums.parallax.com/forums/default.aspx?f=25&m=136676&gt;
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-07-26 15:52
    Thanks Mike,
    Now, I clearly noticed that the Object have a decription of items that are available within.

    Obviously, I just wasn't observant and aware enough to locate these things. I guess I have to just keep looking into objects and reading code until I can see how it is managed. For some reason, I imagined that each low level object would be fairly standarized and in its own DOS file.

    I am happy to see the Slave Modes too. It is hard for me to imagine the Propeller as being the slave component with so much utility. Currently I am trying to get on with a Master SPI application that would eventually have the Propeller provide Keyboard and Video management of a CANbus.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "If you want more fiber, eat the package.· Not enough?· Eat the manual."········
    ···················· Tropical regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2006-07-26 17:04
    Kramer,

    I can see the slave modes being useful for SYNCHRONOUS COMMUNICATION rather than ASYNCHRONOUS. In the real world this might apply to a Propeller
    in the field running in RC mode where clock timing might not be that accurate. (Solar application using an RC mode clock to help conserve power?).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
Sign In or Register to comment.