Um… I asked you three questions…
Sorry!
-
These SSC-32 connections are going to the DB9 right?
Yes. I am using TX0 and RX0 from the router. Please consider this photo:
-
Can you go into more detail as to how it doesn’t work?
I don’t understand this question. It just don’t work: it has the indicator on, and no changes in the light when wrt and ssc-32 are connected via max3232. -
Does the green LED on the SSC-32 go out?
No.
The LED on the SSC-32 is not a power light, but a status indicator. Its job is to turn on when powered up, then to go out when it has received serial data, and blink when it’s receiving data. The data can be the wrong baud rate, formatted incorrectly, and complete total jibberish. The LED will still go out. If your LED is not going out then NOTHING is being received by the SSC-32.
This is “what”, my quesion is “why”.
It is obvious that it is not receiving anything! Could you please give some idea, may be a new test I could to to figure it out why no data is flowing (considering that max3232 and router ports and ssc-32 are all healthy there)?
Shouldn’t pin 14 on the MAX3232 (t1out) goto the RxD pin on on the SSC-32 DB9 connector?
And alternatively, then shouldn’t the DB9 pin for TxD on the SSC-32 goto r1in (pin 13) on the MAX3232?
I see Tx from the router going to Tx on the SSC-32 in the MAX3232 wiring diagram. There seems to be a similar problem with Rx going to Rx…
Man I’m getting rusty. It’s clearly indicated in the schematic that the output of the 232 chip is going to the TX on the SSC-32. djsfantasi’s right, there’s your problem.
Thank you!
I corrected the schema and now wrt is sending commands, but still I can’t read anything from the ssc-32, i.e. input doesn’t work!
My baud rate is 9600 on both devices.
I issued:
echo ‘A’ > /dev/tts/0
and then tried both:
echo < /dev/tts/0
and also:
cat < /dev/tts/0
but no input!
Do you have any idea how I can test this?
I’m no comm guru, but I’m pretty sure when you ask for data from the SSC-32 it’s getting sent long before you type something into a terminal to read it. I.e. there is no delay, well there is a very short delay, then the data is sent. If your not ready on the Rx end you missed it.
My test configuration:
- two console opened in Windows XP,
- both connected to the router
- FIRST, in one of them I issue “cat < /dev/tts/0”
this command as you know, redirects input from serial (which is truly connected on tts/0 and tested). Just after I issue it, Linux starts to “wait” for input. - NEXT, in the second one, I issue: “echo ‘#0p2000’ > /dev/tts/0”, and then “echo ‘Q’ > /dev/tts/0”, to query the movement.
I get no result. Also, if I query “echo ‘A’ > /dev/tts/0” again no result. When I “short” serial of the router to itself, with the above setup I get the right result, i.e. anything I echo in one window, I have it at once in the other window. So logically there must be a different kind of problem? Well, I am confused because I even can’t think of a test to approach to the essence of the problem
First, issue “cat < /dev/tts/0” in a console window. You say Windows XP and but use Linux commands; I assume you are running cygwin or similar. For example, are you executing the cygwin echo command or the windows echo command? Windows echoes the single quotes in the command while Linux does not.
Assuming the syntax is correct in your situation, then in a second console window, issue “echo ‘VER’ > /dev/tts/0”. This will request the SSC-32 to send several bytes indicating the release of the firmware.
Did the green LED flash when you issue the VER command via echo? Did you get a response?
I’ll now go to implement this test you kindly explained, but before that I just explain how I issue Linux command:
- I installed an OpenSSH in Windows XP, so I ssh to the router, where I have OpenWRT Linux.
- I do this from two console, so I have two connection with the router (both wireless).
- When I issue a Linux command it is the router that is executing it!
Sorry for inaccurate information! Now I’ll go to implement your test, with many hopes that I get the version back
Windows echoes the single quotes in the command while Linux does not.
Consider that “I successfully run my motor connected to #0” when I “directly” connect TX of router to RX of ssc-32.
issue “echo ‘VER’ > /dev/tts/0”
Did the green LED flash when you issue the VER command via echo?
Did you get a response?
Well ‘VER’ didn’t return anything. I suspected if the serial data is being sent as it is. I did this test:
CONFIG> TX of the router to RX of ssc-32 "directly", RX of the router to TX of ssc-32 "via max3232"
TEST> issued: "echo '#0p2400' > /dev/tts/0"
RESULT> LED went off, and the motor worked correctly.
CONFIG> TX of the router to RX of ssc-32 "via max3232", RX of the router to TX of ssc-32 "via max3232"
TEST> issued: "echo '#0p2400' > /dev/tts/0"
RESULT> LED went off, BUT the motor DIDN'T worke correctly!
CONFIG> TX of the router to RX of ssc-32 "DIRECTLY", BUT, RX of the router to TX of ssc-32 "via max3232"
TEST> issued: "echo 'VER' > /dev/tts/0"
RESULT> LED went off, AND I HAVE OUTPUT ON CONSOLE! But this output is @xgg, where x is a triangle sign!
CONFIG> same
TEST> issued: "echo 'Q' > /dev/tts/0"
RESULT> LED went off, AND I HAVE OUTPUT ON CONSOLE: '4'.
One interesting issue is that it sometimes gives output and sometimes after a restart it won’t give any output for any kind of query!
So, I get some data but not clear! why this happens? Any idea?
A screen shot where you could see this:
I don’t know anything about linux, but are you sending a carrage return at the end of your string, kind of like below?
“echo ‘#0p2400’/r > /dev/tts/0”
Yes! the C/R is there! Consider that my commands to run the motor actually work! I use the same commanding pattern to query the ssc-32. The issue is 99% in level shifting, as the message is sent to ssc-32 via max3232, but with some unwanted data conversion, may be due to error in voltage.
Why are you bothering with the max232? The ssc-32 can use either TTL or rs232 logic. From the below, looks like the router will be very busy.
I am NOT bothering with max232, but max3232, because my router won’t work with neither TTL nor rs232.
Well it’s not the router, but I am very busy connecting actually 2 ssc-32, arduino and the router! To find the problem with the router, yes you found it, I am doing just the same thing with arduino, but the same result. I can’t use arduino to control my motors because they are going to be around 20 on this robot. So, arduino here is to fix the problem with the serial.
I know you have connected the TX and RX pins together for a loop test on the WRT54GL.
…but have you also tried to connect the Tx1out and Rx1in pins of the MAX3232 for a loop test at the output of the chip?
If this works, you know the router is ok and the MAX3232 is ok. One more link in the comm chain confirmed.
I appreciate your support!
Yes I did this too, and the test FAILED! I had two brand new max3232, so I just replaced the original one, and the test failed with the second one too.
I also measures the outputs of max3232, they give around 5.7v and 3.38v at the right place.
I suspect that the router serial port is somehow involved in this problem, but I can’t figure out, what is that test that reveals the real problem! (considering that I don’t have access to any oscilloscope!).
**Edit: I just repeated the test and it PASSED OK!
It is working logically. When I echo ‘A’, it receives ‘A’ but C/R characters are both sent too automatically.
Then why ssc-32 could not receive the command?!**
Going out on a limb here. Don’t attack me… The MAX 232 chip is an inverter. Is it possible the data is arriving at the SSC-32 inverted? The SSC-32 LED will blink when receiving data even if it is complete jiberish. It can’t be the baud rate as the direct connect works perfectly. One other thing. The MAX 232 chip should provide positive and negative voltages on the DB9.
If the shorted Tx1out and Rx1in pins of the MAX3232 loop test passes, then there isn’t any problem with the chip. The more I think about it. You need to invert the data sent from the arduino so the 232 chip is sending the correct data format.