Shop OBEX P1 Docs P2 Docs Learn Events
Bit Banging a Shift-In — Parallax Forums

Bit Banging a Shift-In

SailerManSailerMan Posts: 337
edited 2006-10-24 19:04 in General Discussion
I created a Bit-Bang Shift out from the SX28 to the Propeller because the ShiftOut command is too fast for the Propeller using SPIN. It works perfectly. Now I need a Shift IN but for some reason I can't get it to work. Can·someone please give me an example of a·Bit Bang for Shift In Master Clock.


Thanks for any help,
Eric
·

Comments

  • BongoBongo Posts: 65
    edited 2006-10-24 16:17
    for lsb first where the bit you want is on a pin called data and gp2 is a variable


    movb····· c,data
    rr···········gp2················································· ··;move bit into var


    for msb first where the bit you want is on a pin called data and gp2 is a variable


    movb····· c,data
    rl···········gp2················································· ··;move bit into var



    Don't know what you mean "in master clock", and you have set the input levels (ie using schmitt trigger will probably·be not sustainable·) to deal with the 3.3 volt propeller output?


    bongo
  • SailerManSailerMan Posts: 337
    edited 2006-10-24 16:31
    I Guess I should have said in SX/B not ASM.. Master Clock meaning that the Clock will originate in the SX28. I didn't know if that was needed information. [noparse]:)[/noparse]
  • BongoBongo Posts: 65
    edited 2006-10-24 16:42
    Oooh, I don't know SX/B, but you must be close if you are shifting bits out.· You did set the pin to input?, and maybe someone else can help with the SX/B



    bongo
  • Sparks-R-FunSparks-R-Fun Posts: 388
    edited 2006-10-24 19:04
    Eric,

    I do not have an example I can share right now. However, if you will post what you have that works for shifting out and what you are trying to use for shifting in, I (and hopefully others) can probably offer meaningful suggestions that may help.

    In general it looks to me (from a previous oscilloscope posting) that you should:
    • Lower the Clock line...
    • Pause...
    • Raise the Clock line and sample the data,
    • Pause...
    • Repeat eight times being sure to shift the data into your result variable in the proper direction.

    - Sparks
Sign In or Register to comment.