Newbie from BS2 to SX Microcontroller
Hi,
I am a mechanical engg. I had a prior experience of working with the Basic Stamp2 and a newbie to SX. So I hav a question regarding the serial communication in SX28 microcontroller.
I am trying to use SERIN command in SX/B to get the data from the GPS module. And then I am trying to use SEROUT command to read the GPS data into my computer from the SX controller. For BS2, I used, SEROUT 16 (pin),(baud),(variable) ,16 being the pin number. This statement in BS2 will help me read the GPS data into my computer. But I am not able to conceive which pin to be used with SEROUT to do the same in SX28 controller. And my SX is connected to PC by a serial cable and an SX Blitz key interfacing the serial cable and the stamp.
And I am using the SX Tech Board, SX28 and also SX Blitz Key (serial).
Thanking you,
Suman Sadhu
Comments
You cannot use the SX-Blitz to communicate with the PC.
SX/B Help should fill you in on the other SEROUT details.
If you don't want to get an SX-Key, then get an LCD (a serial LCD would be best.)
So my question is how to communicate with PC with SX microcontroller and how can I view the sensor reading in Hyperterminal of the PC.
Post Edited (Suman) : 4/28/2008 12:10:21 AM GMT
Just realize that the SX-Blitz and SX-Key devices are primarily for programming the SX chips. The SX-Key allows for debugging but that isn't going to provide the output to HyperTerminal that you are after. Just ignore the SX-Blitz and SX-Key for now and just use them for getting new code into your SX chip.
Getting the SX chip to send data to your PC running a HyperTerminal session is easy! You'll probably want to add a MAX232 or other line driver to get the SX processor to use the proper voltage levels for RS232 communications (and also invert the signal). Once that is done just use the SX/B serial commands to send out the data.
I did something very similar for my SC-01 to SpeakJet translator program that appeared in the December 2007 issue of SERVO magazine. I sent out debug info which I watched in a HyperTerminal session to see how the translation was going. You can see the code at:
http://www.servomagazine.com/media-files/813/SC01TOSJ_POLLED.SXB
The code for debugging should provide an example to get you started.
Robert
Suman Sadhu