PDA

View Full Version : special serial comm!



Cranz
01-05-2006, 03:59 AM
Hi!

I'm in serious trouble right now!

I try to communicate with a greenhouse computer, but the greenhouse computer communicate this way:

computer to stamp:

The computer generates clock pulses and shifts out the data on the·rising edge of the clock.

stamp to computer.

The computer generates clock pulses and the stamp needs to shift out the data on the rising edge.

I really want to use the shiftin/out command, but it makes one pin input and the other pin clock output. But in my case the greenhouse computer will generate the clock even if I want to receive data.

Can anyone help me write a piece of code to make this work?

Something that will check a pin every time the clock pin goes high. when I want to send there is no problem since shiftout will work just fine. (i think?)

the clock is something between 20 and 30 khz.

8 bit data, 1 parity bit
·

Jon Williams
01-05-2006, 04:15 AM
I don't think you'll find the Stamp fast enough to act like a syncronous slave. You would switch the to the SX and program it with SX/B -- even at 4 MHz you'd have plenty of horsepower to act like a slave to your greenhouse PC's liking.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax