BS2 SERIN-Problem with long protocols
ProPinball
Posts: 3
Hello,
we are trying to use the BS2 module to access a LCD display and a RFID reader. The LCD display part is completed and works perfectly, but we have some problems with the RFID reader. The reader has a seriell protocol which is in fact very easy, if·you use a PC. But with the basic stamp it gets something more difficult. I have to set the reader into "reading mode" (13 Byte protocol from BS2 -> RFID, 9 Byte ACK from RFID -> BS2, 11 Byte Status from RFID -> BS2 and again an ACK from BS2 -> RFID). This works. But now the reading result from a RFID card is more complex.
This can be a result protocol in a length of 19 up to more then 50 characters.
How can I get such long protocols with variable length (embedded between a START $31 end END $4 character)·into the BS2? As the BS2 has only 26 Bytes var·memory, I tried it with 2 or more SERIN commands. And always after·the SERIN command I wrote the received data into the EEPROM.
But it seems that the BS2 is too slow to do the write-process. As after the next SERIN I don't get the·whole·missing protocol.
Is there any way to do this with the stamp? Maybe another type, like the BS2E where I have scratch pad RAM. Would this be fast enough?
We are using 2400 Baud (normally 19.2k, but lowered to 2.4), No Parity, 8 Databit,·1 Stopbit. And we have to use this RFID reader, no other one .
Any ideas?
Thanks in advance,
ProPinball.
we are trying to use the BS2 module to access a LCD display and a RFID reader. The LCD display part is completed and works perfectly, but we have some problems with the RFID reader. The reader has a seriell protocol which is in fact very easy, if·you use a PC. But with the basic stamp it gets something more difficult. I have to set the reader into "reading mode" (13 Byte protocol from BS2 -> RFID, 9 Byte ACK from RFID -> BS2, 11 Byte Status from RFID -> BS2 and again an ACK from BS2 -> RFID). This works. But now the reading result from a RFID card is more complex.
This can be a result protocol in a length of 19 up to more then 50 characters.
How can I get such long protocols with variable length (embedded between a START $31 end END $4 character)·into the BS2? As the BS2 has only 26 Bytes var·memory, I tried it with 2 or more SERIN commands. And always after·the SERIN command I wrote the received data into the EEPROM.
But it seems that the BS2 is too slow to do the write-process. As after the next SERIN I don't get the·whole·missing protocol.
Is there any way to do this with the stamp? Maybe another type, like the BS2E where I have scratch pad RAM. Would this be fast enough?
We are using 2400 Baud (normally 19.2k, but lowered to 2.4), No Parity, 8 Databit,·1 Stopbit. And we have to use this RFID reader, no other one .
Any ideas?
Thanks in advance,
ProPinball.
Comments
-Phil
What there needs to be is a serial interface product designed for hobbyist needs like this, when we have to look at a large string of data with a slow micro. I think something like this used to exist, in the form of the "Ram Pack B" by solutions-cubed (and once upon a time sold by Parallax). I forget the specs, but it would continuously monitor for input data, and then regurgitate it at request.
If you decide to use the 31xx UART, let me know and I'll provide some example code to communicate with it.
If this alone is not satisfying, we will check for a serial buffer. And maybe then I come back here, if I encounter any problems.
Thanks,
ProPinball.
That's neat that someone still makes a device like that. The only problem I see with it is it's limited to 9600 baud, I have some applications where I need to do 19.2Kbaud. The 32 byte buffer is good, though. I also wonder how it handles concurrent requests - can you be receiving data with it at the same time that you are transferring data to the micro?
ProPinball,
Yes, the BS2p should do what you need, as long as you can anticipate the serial data coming. Remember, the BASIC Stamp is a single-task machine; if you present serial data to it while it's not listening, the data gets lost. I have run into problems where I send a serial command and then have to listen for a response to come back, and because the turn-around time on the Stamp isn't fast enough, the first several bytes get lost. At this point you would need a buffer or a UART.
Have fun with your project!
It handles large protocols with up to 66 Bytes @2.4 baud without any problem. Today I will try with higher baudrates to optimize the whole thing.
Thanks again,
ProPinball.