Yes, right the pic would be a slave. Here is what I have.
shiftin latchPin_in, clockPin_in, MSBFIRST, [latch_receive, clock_receive]
' clockPin_in is a pin on the pic that is attached to the clock line of the NES gamepad port
' latchPin_in is a pin on the pic that is connected to the latch line of the NES gamepad port
if latchPin_in = 0 then 'if we receive a zero from the master's latch output data then shiftout serial data.
shiftout serialOut_pin, clockPin_in, MSBFIRST, [serial data output] 'send a byte out to the master.
In this case what do I do with the clock data received when shifting in? I'm not sure how to handle the clock data received.
Does a 4021B shift register (slave) receive latch and clock data in a standard (fixed) way? Or does this rely on how the latch and clock data are being sent from the master?
You said I would "tie up" the pic doing this. If that's true than maybe I'll skip this and just use a pic to send the parallel input into a real shift register, then out to the master.
I was thinking about using a pot via ADCIN and then send the shifted out serial bits based on the pot reading. Would that work with shiftin and shiftout going on as well?
Thanks again,
T
Bookmarks