BS2 Master - Slave
Tumbler
Posts: 323
Hello,
I'm planning to make a bs2pe used as an eeprom controller.
see picture...
About the eeprom controller:
i want to make a FAT-based eeprom controller: sending data, receiving data, get directorys etc...
The internal eeprom of the slave would be used for storing package information (date, time, id, package length, wich eeprom is used, address data,...)
I have read an article from Jon Williams ( a tale of two stamps), but as i can see the master can only talk to the slave? or is it possible in two ways?
And this slave code: SERIN SIOpin\FCpin, N2400, 200, LCD_Update, [noparse][[/noparse]ioByte]
does it mean that the slave only can receive data if the FCpin is high? that's not clear for me.
and can i use the same code·for the master? so i can talk in two ways?
regards
I'm planning to make a bs2pe used as an eeprom controller.
see picture...
About the eeprom controller:
i want to make a FAT-based eeprom controller: sending data, receiving data, get directorys etc...
The internal eeprom of the slave would be used for storing package information (date, time, id, package length, wich eeprom is used, address data,...)
I have read an article from Jon Williams ( a tale of two stamps), but as i can see the master can only talk to the slave? or is it possible in two ways?
And this slave code: SERIN SIOpin\FCpin, N2400, 200, LCD_Update, [noparse][[/noparse]ioByte]
does it mean that the slave only can receive data if the FCpin is high? that's not clear for me.
and can i use the same code·for the master? so i can talk in two ways?
regards
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Don't worry. Be happy
After some tests, this is what i have:
Master (a basic stamp2)
SLAVE ( a BS2pe)
With these examples i can send a DIR,GET and PUT command to the slave. (slave answers with a ACK and a dec value)
But how can i prevent to send a command while the slave is busy?
i think i have to check the FCpin, but i don't know how to do it.
Is it not working?
The SERIN commands in the slave and the master control the output state of the FCpin. When the slave hits a SEROUT, it checks its FCpin "clear to send" as an input to see that the master is ready. And vice versa, when the master hits a SEROUT, it checks its FCpin "clear to send" as an input to see that the slave is ready to receive. So the flow control goes both ways.
Be sure you have ~1kOhm resistors in the lines between the two stamps, just in case there is a contention. That shouldn't happen in this program but it is a precaution.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
The code above is working, but when the master sends 2 commands i don't receive the ACK anymore. In fact, i don't receive anything from the slave.
example (2 commands)
SEROUT SIOpin\FCpin, Baud, [noparse][[/noparse]CMD,PDATA]· ' send put command to slave
pause 10
SEROUT SIOpin\FCpin, Baud, [noparse][[/noparse]CMD,GDATA]· ' send get command to slave
Do i have to check the FCpin before i send a command?
I tried if the pin is low or high, but it takes me to nothing.
·
This is working now...
yihaa, it's working...