PDA

View Full Version : RS232 output from a BS2 is different then RS232 from a computer??? PLEASE HELP!



Grant_O
04-25-2006, 07:20 AM
Ok so most of my projects that involve RS232 ASCII communications work great, but IV been beating my head agents the desk on this project.
·
What I have is a Yaskawa linier stage controller that is controlled by RS232 ASCII. When I connect it to the Com port on my computer and type in the commands through HyperTerminal it works fine. But when I connect it to the APPmod RS232 port on the BS2 and send the exact same code, it doesn’t respond. I also plugged the BS2's port into my computer and I see the ASCII code as it’s supposed to be. is there a difference in the signal / noise. it is on a transformer power supply and the ocilliscope says its a little noisey when improperly grounded.·but yea Iv also tried tuneing the baud rates of the BS2·from 70 -to- 90 but i think 84 is the best and i cant change the baud on the Yaskawa, well... i can go up in speed with it but 9600 is as low as it goes. man this is bugging the heck outa me!
·
Code Iv tried:
·
SEROUT 2, 84, ["SH", CR]
·
"and/or"
·
SEROUT 2, 84, ["SH", 13]
·
---------------------------------
and iv tried
·
SEROUT 2, 84,· [ "S"]

PAUSE 100

SEROUT 2, 84, ["H"]

PAUSE 100

SEROUT 2, 84, [CR]
·
nothing seems to work!!!!!!!!!
Please Help, i dont want to have to buy a whole nother computer just for this reason http://forums.parallax.com/images/smilies/smhair.gif··
·

Post Edited (Grant_O) : 4/24/2006 11:53:41 PM GMT

PJ Allen
04-25-2006, 08:12 AM
Have you tried 16468 for a Baudmode (just for yucks)?

Another think, the Yaskawa to the PC is via a serial extension, right (male to female), right?

In that event, using the DCE AppMod, you'll need a Null Terminal cable (with pin2 on A going to pin3 on B, pin3 on A going to pin 2 on B.)· Yes?

[ A Null Modem is a female-to-female, swapped as above, a Null Terminal is a male-to-male cable as above.· Others may not dig the difference.· They'll call it a "male-to-male null modem." ]

So, what's the story, morning glory?




Post Edited (PJ Allen) : 4/25/2006 12:20:17 AM GMT

Grant_O
04-25-2006, 08:38 AM
Yea, i tried a Null connection. still nothin... the only two baud rates i have optional are 9600 and 19200.

i was thinking though.... i used the default settings in Hyperterminal minus the hardware flow control. but is the serial output of the Bs2 truly:

9600 baud
8 data bits
no parity
1 stop bits
no flow control?

Jon Williams
04-25-2006, 09:06 AM
Since you're now going directly from the chip and not through an inverter, you need to use inverted mode.· Instead of embedding "magic numbers" into you SERIN/SEROUT statements, use the attached template; it will you get things right and you only need to change one place (Baud constant).

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax

Grant_O
04-25-2006, 11:12 AM
Jon,

Yea i guess i should have used a constant for the baud rate. But you say to use "inverted mode". What is that exactly? And how is it different from what im doing?

thanks.

Jon Williams
04-25-2006, 11:30 AM
This is covered in the manual (hint, hint, grin) -- but what that means is that a start bit is high (logic 1); in true mode (what you're using) the start bit (and 1 bits) are at logic 0. If you're communicating with someth that normally connects directly to a PC serial port you need to use inverted mode (normally you would go through a level shifter that would invert the signal and transform to RS-232 levels).

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax

Grant_O
04-25-2006, 02:32 PM
I thought that the Parallax #29120 RS232 DCE AppMod took care of all that?

Chris Savage
04-25-2006, 10:17 PM
You said when connected to Hyper Terminal the device communicates.· Is it possible it's using lines such as DTR and DSR?· Currently you are only supplying RX, TX, RTS and CTS.· You should check the device manual to see what lines it uses.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com (mailto:csavage@parallax.com)

Jon Williams
04-25-2006, 10:18 PM
You're right, it does -- my miss that you're using the AppMod (it wasn't clear to me what you meant until now). So yes, use True mode. The best thing to do is connect the demo circuit an make sure you're getting data in and out of the AppMod.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax