Shop OBEX P1 Docs P2 Docs Learn Events
Flow control for the Prop — Parallax Forums

Flow control for the Prop

NewzedNewzed Posts: 2,503
edited 2007-02-19 00:35 in Propeller 1
The Propeller has no flow control per se, as far as I know.· With my Prop piggyback I felt this was essential so I came up with my own.·

I tied Pins 5 of the Master and Slave together.· When the Master·is ready to·receive data the Slave was previously told to accumulate, it goes to a "receive" method where pin 5 is made a high output.· When the Slave has the data ready to send, it goes to a "senddata" method where it is told:

repeat until Ina[noparse][[/noparse]5] ==·1·····
· waitcnt(clkfreq + cnt)
sendstr(string("· .........data",))

It stays in this 1-second cycle until the Master takes Pin 5 high, at which time it sends the data.

For testing purposes, I had the Slave wait ten seconds before the repeat instruction to give the Master time to perform other tasks and stay busy for more than 10 seconds, then it goes to the receive method and takes Pin 5 high.

There may be better ways to accomplish this but it works for me.· I saw no reason for flow control in the other direction since the Slave only responds to commands from the Master, and data flow is only from Slave to Master.· With a 512K EEPROM on the Slave I should be able to store more data than I will actually need.

Sid

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yesterday is history, tomorrow is a mystery, and today is a gift.

That is why they call it the present.

Don't have VGA?
Newzed@aol.com
·
Sign In or Register to comment.