Shop OBEX P1 Docs P2 Docs Learn Events
special serial comm! — Parallax Forums

special serial comm!

CranzCranz Posts: 9
edited 2006-01-04 21:15 in BASIC Stamp
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
·

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-01-04 21:15
    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
Sign In or Register to comment.