Shop OBEX P1 Docs P2 Docs Learn Events
USB PSC help — Parallax Forums

USB PSC help

tstewart1tstewart1 Posts: 5
edited 2006-09-13 05:56 in Robotics
Hello,

I have a USB PSC which I am using to control 6 servos. In addition to moving the servos, I would also like to turn on/off a LED via one of the servo pins. I don't think the PCS pins can act as a binary output (similar to what the pico pic does), is this correct? After playing around with the PSC, I was surprised to see .373v on the SS pin. Why would there be a voltage on that pin when the servo isn't being used? When I played around with a BOE I found the SS pin would read 0v when not in use. Can anyone think of a way I can turn on/off a LED with the PSC?

Thanks for any help you can provide.

Tim

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2006-09-13 05:56
    1) I don't think the PSC pins can be used as a binary output. They are designed to produce pulses from 0.5ms to 2.5ms in width about every 20ms. Even though the PSC commands use a 16 bit value for the pulse width with a 2us unit, I think the PSC limits the range of values allowed. You could use a resistor and capacitor so that the pulses charge the capacitor to a voltage proportional to the pulse width, then use a comparator so that the comparator turns on when the voltage exceeds a threshold which is the voltage with 1ms pulses. The comparator could drive the led directly. A quad comparator and some passive parts could give you 4 channels. A 1ms pulse could give you roughly a 0.5 volt threshold (1ms/20ms = 0.5V/5V). If you want to use a diode and second resistor per channel, you could speed up the charge time and increase the threshold voltage.

    2) The PSC controls all of the channels all of the time as far as I know. The BOE (as does all Stamps) initializes all I/O pins to inputs which is high impedance. Unused pins would remain so until changed by a program.
Sign In or Register to comment.