0
Offline
Newbie
Karma: 0
Posts: 39
|
 |
« Reply #30 on: April 10, 2012, 05:20:02 am » |
I mistake my response. I solder TX with RX that is the pinout of RS232 connector. This is my scheme:
DFROBOT TX-> Arduino pin 7 DFROBOT RX-> Arduino pin 8 DFROBOT VCC -> Arduino 5V DFROBOT GNG -> Arduino Gnd
solder in DFROBOT DB9 pinout TX and RX (2 and 3)
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 39
|
 |
« Reply #31 on: April 11, 2012, 09:44:26 am » |
Dear all: I have changed to an Arduino Mega. I have tried the loopback and is OK. The character that I send, I receive it. I have changed my code. because Arduino Mega. This is my new code:
void setup() { Serial.begin(9600); Serial3.begin(9600); }
void loop() { if (Serial3.available()) { Serial.print((char)Serial3.read()); } if (Serial.available()) { Serial3.println((char)Serial.read()); } } I have connected my device Extron to DFROBOT RS232 through to Serial3 of Arduino, Then, I sent this command: ! (admiration), and the device must respond the input selected. But I have no response from the device. When I send the command: !, I see that Rx of DFROBOT light, but doesn't light the TX light. I mean, I don't get response from the Extron device. Can you help me please? Many thanks
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
UK
Offline
Brattain Member
Karma: 138
Posts: 19066
I don't think you connected the grounds, Dave.
|
 |
« Reply #32 on: April 11, 2012, 09:48:18 am » |
Is the bit rate correct? Is the character format (8,n,1) OK for the receiver?
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 39
|
 |
« Reply #33 on: April 11, 2012, 01:05:14 pm » |
Baud rate is 9600 for Arduino and Extron device. Other parameters, Do I have to configure it writing code? How can I do it? Parameters for Extron device are: Parity bit : none Data bit: 8 Stop bit: 1 Handshake: none. Thank you very much
|
|
|
|
|
Logged
|
|
|
|
|
Manchester (England England)
Offline
Brattain Member
Karma: 277
Posts: 25501
Solder is electric glue
|
 |
« Reply #34 on: April 11, 2012, 04:39:07 pm » |
Parameters for Extron device are:........... That is the same as the arduino so there is nothing extra to do. When I send the command: !, I see that Rx of DFROBOT light, but doesn't light the TX light. I mean, I don't get response from the Extron device. This would suggest you are not sending the correct command. Your code is wrong try this:- void setup() { Serial.begin(9600); Serial3.begin(9600); }
void loop() { if (Serial3.available()) { Serial.write((char)Serial3.read()); } if (Serial.available()) { Serial3.write((char)Serial.read()); } }
|
|
|
|
|
Logged
|
|
|
|
|
Toronto, Canada
Offline
Edison Member
Karma: 2
Posts: 1233
"Keep it R.E.I.L. - "Research, Experiment, Investigate and Learn"
|
 |
« Reply #35 on: April 11, 2012, 06:07:18 pm » |
Extron device Any datasheet ? I would like to see it. Maybe you need to read the datasheet of the so call "Extron device" Ok... You want to send ---> ! Is it ASCII code ? or a binary code ? If I have a device to received a data, I need to know : Baud rate 8 bits Parity or Not Stop bits Start bits So your device is : 9600 baud - 8 bits - no parity - 1 stop bit OK Code sequence into the device ? Answer in the datasheet <-- Maybe ASCII into the device ? Answer in the datasheet <-- Maybe You see what I mean ....
|
|
|
|
« Last Edit: April 11, 2012, 06:13:02 pm by Techone »
|
Logged
|
|
|
|
|
|
|
Manchester (England England)
Offline
Brattain Member
Karma: 277
Posts: 25501
Solder is electric glue
|
 |
« Reply #37 on: April 12, 2012, 03:56:49 pm » |
So the first thing I would do is to see if it is talking to you, the book says:- When a power-up occurs, the switcher responds by sending the following message to the host: Copyright 2005, Extron Electronics, IN1508, Version x.xx] Version x.xx is the firmware version number. So write some code to see this message by transferring it from the software serial input to the hardware serial output and displaying it on your monitor.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 39
|
 |
« Reply #38 on: April 16, 2012, 03:57:09 am » |
Thank you very much. I have tried with the new code and When I connect Extron I don't get anything. Must be a problem with the cable? Do you know the pinout? I don't know how to solve this.
|
|
|
|
|
Logged
|
|
|
|
|
Manchester (England England)
Offline
Brattain Member
Karma: 277
Posts: 25501
Solder is electric glue
|
 |
« Reply #39 on: April 16, 2012, 04:25:22 pm » |
I don't know how to solve this. You solve it by using the right tools. Use an oscilloscope to see that your device is sending data to you. You use it also to see that you have got the baud rate right and that the signal is the right way up. It should go to a logic one after it has finished sending stuff. If all that checks out you look again at your software serial stuff and see it is recieving.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 39
|
 |
« Reply #40 on: April 17, 2012, 06:56:34 am » |
How I said in a above message, I connected the device right to a PC and hyperterminal and I get the the message from Extron device. I have no an oscilloscope is to expensive for me. Is there any other to posibility to test it? or oscilloscope software?
Do you know other cheap serial devices to make trying with Arduino and serial? Many thanks
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
UK
Offline
Brattain Member
Karma: 138
Posts: 19066
I don't think you connected the grounds, Dave.
|
 |
« Reply #41 on: April 17, 2012, 07:01:30 am » |
Tell us what equipment you do have, and what equipment you know how to use.
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
|