SERIN problems
nondem
Posts: 15
I am stuggling to get my BOT to respond to input to pin 2 of the serial input cable.
I've got a BOE BOT - using a Stamp(BS2) on a Board of education.
I'm using a laptop and a USB to serial adapter to connect to the serial port on my BOEBOT.
I'm VERY familiar with communications with a DB9 serial cable....I've written several applications using data streamed into a serial port from GPS hardware(NMEA).
For some reason - I'm beating my head against a wall trying to get my BOT to "hear" commands sent to it via a VB.NET application I've written.
I'm sending the string "fwd" to the serial port using my application, and have confirmed that the "fwd" string is actually getting sent to whatever is connected to the other end of the serial cable.
I'm using various version of this simple program to try to confirm that the BOEBOT is receiving the command:
' {$STAMP BS2}
' {$PBASIC 2.5}
serdata var word
SERIN 1, 16468, [noparse][[/noparse]WAIT("fwd"), DEC serData]
HIGH 6
pause 10000
end
I've also tried using 84 and about a jillion other Baudrate/Databits/Stopbits/parity configs....nothing will lite the led circuit on pin 6
I setup a serout program using the same configs and they work fine...Hyperterminal displays the string I send w/serout fine.
I've also tried using
serdata var byte - and a numeric value for the trigger. No dice.
Do any of you guys have an idea what I should look at next? I must be missing something....
I've got a BOE BOT - using a Stamp(BS2) on a Board of education.
I'm using a laptop and a USB to serial adapter to connect to the serial port on my BOEBOT.
I'm VERY familiar with communications with a DB9 serial cable....I've written several applications using data streamed into a serial port from GPS hardware(NMEA).
For some reason - I'm beating my head against a wall trying to get my BOT to "hear" commands sent to it via a VB.NET application I've written.
I'm sending the string "fwd" to the serial port using my application, and have confirmed that the "fwd" string is actually getting sent to whatever is connected to the other end of the serial cable.
I'm using various version of this simple program to try to confirm that the BOEBOT is receiving the command:
' {$STAMP BS2}
' {$PBASIC 2.5}
serdata var word
SERIN 1, 16468, [noparse][[/noparse]WAIT("fwd"), DEC serData]
HIGH 6
pause 10000
end
I've also tried using 84 and about a jillion other Baudrate/Databits/Stopbits/parity configs....nothing will lite the led circuit on pin 6
I setup a serout program using the same configs and they work fine...Hyperterminal displays the string I send w/serout fine.
I've also tried using
serdata var byte - and a numeric value for the trigger. No dice.
Do any of you guys have an idea what I should look at next? I must be missing something....
Comments
' {$STAMP BS2}
' {$PBASIC 2.5}
SERIN 2, 16468, [noparse][[/noparse]WAIT("fwd"), DEC serData]
HIGH 6
Gotta have that ground!
Can you "see" the string with the same code on another pin? or another stamp (if ya got one)....
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<FONT>Steve
What's the best thing to do in a lightning storm? "take a one iron out the bag and hold it straight up above your head, even God cant hit a one iron!"
Lee Travino after the second time being hit by lightning!
It's worked fine for everything else I've done. I can point my VB.NET application to another port that loops back to another "phantom" port using (com0com) to see what is getting sent to the stamp but I can't monitor whats sent in real-time.
Since I am using the DB9 connector on the BOE, I can't easily change which pin on the stamp gets the signal. I appreciate the suggestions though. Maybe I should make the connection directly to the stamp through the other BOE breadboard-type connections bypassing the DB9 connector????
When using the programming port (SIN, SOUT) as a serial data port, there is one anomaly about which you should probably be aware. I'm not sure that this has any bearing on your problem, but anything sent to to the Rx pin on the Stamp (SIN) will also appear, concurrently (ECHOED), on the Tx pin (SOUT) of the Stamp. This means any extraneous data received by the sending program must but be ignored.
I hope that's helpful.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
So from your description the SERIN command should read SERIN 16, 16468, [noparse][[/noparse]WAIT("fwd"),DEC serData]
The fact you are using "fwd" in your protocol takes care of the echo that Bruce mentions but is something to bear in mind in future apps.
Another thing worth mentioning is that in my experience at 9600 baud using a WAIT instruction I have to seperate the wait string and data with a small delay in the VB code. This doesn't seem to be a problem at 4800 so it may be worth dropping the baud while you do your tests. Lastly , and I feel you have probably taken care of this already, when you transmit your data from the PC to the Stamp terminate it with a nl or cr character.
Jeff T.