Basic Stamp2sx, MAX232, and Hyperterminal
C
Posts: 9
Hi
I am trying to have my BS2sx send data using the TX-434 to a receiver, RX-434, which is connected to a MAX232 chip to then connect to the serial port (RS-232) of my PC. I just want what I send to be displayed to the Hyperterminal!
My receiver picks up garbage no matter if my BS2sx is transmitting or not. I have bypassed the RX/TX package and still get nothing to display. I am using the SEROUT and have double checked my numbers for a Baudrate of 2400. I have all the necessary connections and still cannot figure out what I am doing wrong! Also, when I use DEBUG, everything is correct.
Later, I will need to implement this into a system that will display an object's distance (ft) from a mini-car and the new direction (left/right) the mini-car will take to avoid the object. The collision avoidance program is finished and works fine. Implementing this part will be easy once I can figure out how to send information and have it appear on the hyperterminal correctly. I have combed through some of the topics and still find no help with the similar issues described on this forum.
Here is my code. Please, in any form and from anyone, help would be greatly appreciated!!!!
I am trying to have my BS2sx send data using the TX-434 to a receiver, RX-434, which is connected to a MAX232 chip to then connect to the serial port (RS-232) of my PC. I just want what I send to be displayed to the Hyperterminal!
My receiver picks up garbage no matter if my BS2sx is transmitting or not. I have bypassed the RX/TX package and still get nothing to display. I am using the SEROUT and have double checked my numbers for a Baudrate of 2400. I have all the necessary connections and still cannot figure out what I am doing wrong! Also, when I use DEBUG, everything is correct.
Later, I will need to implement this into a system that will display an object's distance (ft) from a mini-car and the new direction (left/right) the mini-car will take to avoid the object. The collision avoidance program is finished and works fine. Implementing this part will be easy once I can figure out how to send information and have it appear on the hyperterminal correctly. I have combed through some of the topics and still find no help with the similar issues described on this forum.
Here is my code. Please, in any form and from anyone, help would be greatly appreciated!!!!
bsx
709B
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
M
I am gonna check to see if I am getting correct voltage levels on my input and outputs.
I have already checked and looped back on the Hyperterminal- it displays what I type, but only when I don't power my RX-MAX232 circuitry; therefore I think it is not an issue with Hyperterminal now.
Thanks again!!
-C
Therefore, I expect something wrong with my actual SEROUT command. I have checked and tried various Baud rates for my BS2sx code and adjust accordingly for the Hyperterminal to read. Nothing displays but garbage on the Hyperterminal, even when my TX/BS2sx is not transmitting! I have also bypassed the TX/RX package for now and am just trying to use SEROUT to send data to be displayed on the Hyperterminal (using the MAX232 converter chip still).
What could be wrong? Somehow it seems that the PC ignores the data sent from BS2sx or it displays other stuff incorrectly--this leads me to believe incorrect Baud rate, but I have changed it multiple times. Here is my code simplified:
dat VAR Byte 'Data storage variable
BAUD CON 18447 '1200 Baud
start:
FOR dat = 1 TO 255
SEROUT 0,BAUD,[noparse][[/noparse]dat] 'out P0
PAUSE 2000 '2s delay
NEXT
GOTO start
Jeff T.
If you're trying to send out the numbers 1 - 255, then your line should be:
SEROUT 0,BAUD,[noparse][[/noparse]DEC dat]
Update·-- without DEC, Hyperterm assumes everything coming over to be ASCII (and a lot of the values between 1-255 aren't ASCII, as you may know.)· DEC converts the number into ASCII characters of the number.
Post Edited (PJ Allen) : 4/14/2007 8:37:49 PM GMT
I also have [noparse][[/noparse]DEC dat] back again (originally had it-must've deleted for another purpose previously attempted).
Please, anyone with any ideas to help would be great. I have to complete this ASAP. A simple code like this should work no problem.
Appreciate everyone's input so far
-C
Jeff T
*Note: I thought I should connect the RX line to the BS2sx, but TX line is what has given some results (and a description of each pin states that p11 is Driver Input 1 and p12 is Receiver Output 1).
Thanks,C
Jeff T.
And I already checked my wiring. I hope I figure it out by tomorrow. I greatly appreciate your help.
Thanks,C
This way you can see that the voltage converters are working (essential they.)
I use the same setup on my PC with a TX on a BS1 project board and it has been working well for a few weeks now. I only just looked at your code and apologize, I'm still getting used to this forum.
I noticed a big difference between your code and mine regarding the number of times data is transmitted.
Mine repeats 10 times, I found the receiver needed to be 'spun up' before it started to work reliably.·Anything more than a PAUSE 40 between sends also had the receiver becoming unstable and noise being received.
· FOR rep = 1 TO 10
··· SEROUT 5,T1200,(64,"sPsv1",stat,rec)
··· PAUSE 10
· NEXT rep
In case you are not using a wire antenna, I tried a few different wire antennas and anything over 6 inches worked for a short distance, 10 inches worked for 60 feed, and no antenna had the receiver missing alot of transmissions just a few feet away.
Hope that helps,
M
·
M
Thanks for the help, C
I get a +8v on pin2 and a -8v on pin6, and all other voltage levels seem fine for the MAX232!
However, I did get a 8.5v and 4.5v, both positive on pin1 (I am pretty sure this is ok) and 0v on pin13 (also seems ok since this is the pin that will receive anything from the RS-232 port, which I am only sending data to).
Thanks for the advice, C
Stupid wire making the transmitter and receiver circuits have common ground kept getting loose. And I must've fixed whatever problem I had with the RX/TX when I bypassed them previously.
Thanks everyone!
-C