Shop OBEX P1 Docs P2 Docs Learn Events
slowing down the Shiftin clock pulses — Parallax Forums

slowing down the Shiftin clock pulses

joel grayjoel gray Posts: 4
edited 2006-10-02 16:01 in BASIC Stamp
I am using a BS2px and having a timing problem with the shiftin instruction.· I am trying to Shiftin from·a custom piece of hardware/software and it requires a 5usec high and then a 15usec low clock pulse.· The bs2px provides a 3.6usec high and then a 11.8usec low.· This is just a bit too fast for me.· Is there any way to slow it down?··Any ideas out there besides switching to a slower BS2?

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2006-10-02 13:30
    Sorry, gotta say "switch to a slower BS2". And why is 3.6 uSec too fast for your "custom" hardware? 3.6 uSec is a long time (usually) in terms of TTL or CMOS logic.
  • joel grayjoel gray Posts: 4
    edited 2006-10-02 14:10
    The custom hardware is a PIC16F630 that is doing a lot of stuff and there is some sort of timing loop I have been told.· That piece of hardware is not designed or controlled by us so I have limited knowledge about it and limited ability to get it changed.· I have requested that they speed it up, but I am not sure if it can be.· In the meantime, I will try switching to a slower BS2.· Thanks much for your reply.
  • RickBRickB Posts: 395
    edited 2006-10-02 14:39
    Joel:

    Bit bang it the way it's done with the BS1. There are examples in the Stamp handbook. You can make it as slow as you want.

    Rick
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-10-02 14:44
    Yeah, that could work. Of course, then you're down into the 80 uSec high, 80 uSec low (at best -- could be 300 uSec high 300 uSec low). Still, that could work, and maintain your higher processing speed in other parts of your program.
  • joel grayjoel gray Posts: 4
    edited 2006-10-02 15:26
    Good news.· I have just tried the BS2 and it is working for me at this point.··I will take a look at the BS1 approach later on today and see whether·the tradeoffs would be
    ok.· Thanks for the suggestions.

    Joel
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-10-02 15:41
    I think you missed the point. "Bit-Banging" means you use PBasic code to pulse the 'clock' line, read the 'data' line, then pulse the 'clock' line again. You can easily do this on any BS2 flavor.
  • joel grayjoel gray Posts: 4
    edited 2006-10-02 16:01
    Thanks for the clarification.· That is what I assumed was meant by bit banging.· What I should have said is·I will take time later·to actually try it out and see whether the speeds would be·in the right range (slower, but not too slow).

    Joel
Sign In or Register to comment.