Anyone tried P2 Smartpin SPI mode?

Peter JakackiPeter Jakacki Posts: 8,420
edited 2019-06-16 - 23:13:11 in Propeller 2
I know I could trawl through this forum and the documentation if I wanted to find out more about using Smart pins in SPI bus mode, but has anyone done so yet?

At present my bit-bashed SPI bus runs about 1/10 of the P2 clock so I can run my SD read routines up to 30MHz with about 3MB/s read speed.
Now SD card SPI frequency can be as high as 50MHz so what I would like to do is run as high as I can while keeping the P2 clock frequency low.

The smart pins should allow me to do this and admittedly I haven't really bothered to work out what I need to do yet but I thought I'd throw this question out there.

Tachyon Forth - compact, fast, forthwright and interactive
useforthlogo-s.png
--->CLICK THE LOGO for more links<---
P2 +++++ TAQOZ INTRO & LINKS +++++ P2 SHORTFORM DATASHEET
P1 +++++ Latest binary V5.4 includes EASYFILE +++++ Tachyon Forth News Blog
Brisbane, Australia

Comments

  • No, I haven't tried as yet.

    Chip added something for adjusting the rx sampling point but I can't remember any details about the timing info or how it was achieved. The docs just say "X[5] = 0 selects the A input sample just before the B input edge was registered."

    I don't know if X[5] = 0 is the normal digital input mode. X[5] = 1 reads like it should be the normal digital input mode.

    As for tx, X[5] = 0 looks to be for when wanting to constantly enable/disable tx, like for 1-bit SPI. Otherwise I'd guess X[5] = 1 will be more straight forward to use.


    The big thing is SPI smartpins, both rx and tx, operate on an external clock (B input). This has implications for understanding how it all works. For tx in particular, the updated shift out appears at the physical pin 2-3 sysclocks after the external SPI clock has transitioned the clock edge. Which means there is heaps of time to use that same edge for slave device clock edge. It also limits max data rate. Probably safest to use 1/4 sysclock.

    "... peers into the actual workings of a quantum jump for the first time. The results
    reveal a surprising finding that contradicts Danish physicist Niels Bohr's established view
    —the jumps are neither abrupt nor as random as previously thought."
  • evanh wrote: »
    As for tx, X[5] = 0 looks to be for when wanting to constantly enable/disable tx, like for 1-bit SPI. Otherwise I'd guess X[5] = 1 will be more straight forward to use.
    Err, not 1-bit SPI, that's too vague, make that X[5] = 0 is for 1-bit SD mode with bidirectional data pin. There is some other systems that do bidirectional serial too.
    "... peers into the actual workings of a quantum jump for the first time. The results
    reveal a surprising finding that contradicts Danish physicist Niels Bohr's established view
    —the jumps are neither abrupt nor as random as previously thought."
  • Mark_TMark_T Posts: 1,981
    edited 2019-06-18 - 08:47:43
    Check out FredBlais's reply in my similar thread: https://forums.parallax.com/discussion/169846/smartpin-spi-bidirectional-sample-code (I haven't followed up on this yet)
  • I have been trying to get something on spi working anyone have any suggestions? With a clear basic explanation??
    Thanks
    “Light thinks it travels faster than anything but it is wrong. No matter how fast light travels, it finds the darkness has always got there first, and is waiting for it.”
    “You only live twice:
    Once when you are born
    And once when you look death in the face”
Sign In or Register to comment.