Critical SERIN show stopper in BS2 Rev G
Kwooda
Posts: 1
I have tried all day long to get SERIN to work on a BS2 Rev G. I have the following command:
SERIN 16, 84, [HEX2 command, HEX2 thrs, HEX2 tmins] ' 9600 bps 8-1-N non-inverted on DEBUG port
If I type the input manually, it works fine, because I cannot type at 9600 bps. But if I connect to a serial port and programmatically send a byte sequence, say "0A0130", only the command byte 0A is received and it sits waiting for the next two bytes. At 9600 bps, in fact, I have to insert a 40 ms delay between each byte on the sending end to get it to work. Unfortunately, where my Stamp is going to be used does not have any way for me to add such a delay. I have even tried 1200 bps with the same results, although it only needed 7ms between bytes, but it may as well be 700ms, as I need the Stamp to operate at full 9600 bps throughput.
Is there any way around this? This is a complete show stopper for me.
SERIN 16, 84, [HEX2 command, HEX2 thrs, HEX2 tmins] ' 9600 bps 8-1-N non-inverted on DEBUG port
If I type the input manually, it works fine, because I cannot type at 9600 bps. But if I connect to a serial port and programmatically send a byte sequence, say "0A0130", only the command byte 0A is received and it sits waiting for the next two bytes. At 9600 bps, in fact, I have to insert a 40 ms delay between each byte on the sending end to get it to work. Unfortunately, where my Stamp is going to be used does not have any way for me to add such a delay. I have even tried 1200 bps with the same results, although it only needed 7ms between bytes, but it may as well be 700ms, as I need the Stamp to operate at full 9600 bps throughput.
Is there any way around this? This is a complete show stopper for me.
Comments
Can you send your data as binary instead of hex representation of ASCII text? Reason being, the BS2 is slow at processing incomming serial data when there are formatters in the SERIN command (i.e. HEX2). If you eliminate them like this:
then the processing time is reduced and you might be able to receive the data. Of course, you have to change your sending program to match this and send only one byte per variable.
Having said that, I am a bit surprised that it wouldn't work at 1200, since the truck scales I work with operate at 4800 with the BS2 Stamp and data strings almost twice as long as your example.
Cheers,
Jeff T.