Shop OBEX P1 Docs P2 Docs Learn Events
PropBasic Extension for SHIFTOUT — Parallax Forums

PropBasic Extension for SHIFTOUT

FriedVFriedV Posts: 77
edited 2011-10-05 10:14 in Propeller 1
Hi Bean,
I think SHIFTOUT should have one more mode param for an inverted SPI clock (low or high active clock)
Cheers, Friedrich

Comments

  • BeanBean Posts: 8,129
    edited 2011-09-30 03:23
    Friedrich,
    The SHIFTOUT command simply inverts the clock twice for each bit. So it depends on the state of the pin before the SHIFTOUT command.

    Bean
  • FriedVFriedV Posts: 77
    edited 2011-09-30 12:29
    Thanks Bean, simple but effective!
    Friedrich
  • FriedVFriedV Posts: 77
    edited 2011-10-05 08:31
    I'm still struggling with shiftin / out.
    The speed param can be max 511 as the compiler wants a constant?
    What is the meaning of MSBPRE vs. MSBPOST? First vs. second clock edge?
    If nothing specified for speed clock is 100 kHz?
    Fried
  • BeanBean Posts: 8,129
    edited 2011-10-05 10:14
    Default clock is about 50Khz.

    511 is the max speed (largest constant on Propeller) even though you won't get 25Mhz clock. It will do the fastest it can.

    If I remember correctly...MSBPRE reads the MSB bit on the data line BEFORE toggling the clock line, MSBPOST reads it AFTER toggling the clock line.
    The options can be tricky, sometimes you need to play around before to get them right.

    Bean
Sign In or Register to comment.