I'm working on at serial gateway, and i'm not 100% sure how get my devices connected right to my Arduino. I know that i can't just connect one device to pin 0,1 be curs of the voltage and "TTL", and i also need 2 serial ports...
So my question is if i buy 2 TTL to RS232 converter and connect
Device 1 "i need to send data from Arduino to heat energy meter and receive."
A heat energy meter that need to be connected via RS-232
1200/8/2/N only RX,TX,GND
I am not sure that you can get two extra ports to work under the new software serial. You might have to only use one (for the slower device) and use the hardware serial (pins 0 & 1) for the faster device.
Ok thats also fine, and the converter i can use the same for both right?
And what about the stop bit that is 2 on the slow device is that a problem?
I also thought about to buy 2 MAX232 just for testing at home, and i found some post about that, but i did not got it 100% clear what type no of the chip to use and witch capisator to use, can you give me the answer
It is no problem receiving two stop bits in place of one on the arduino but sending only one might be a problem for the receiving device. Two stop bits is very non standard with 8 data bits. You could always send the characters on at a time with a small delay between each.
There are lots of different converter chips, for the exact capacitor requirements, and circuit see the data sheet or the chip you choose. I tend to use a MAX202 but that is only because I have a hand full of them in my junk box.
I believe... not sure... but believe I've read that you CAN set up two ports via NewSoftSerial, BUT...
You have to be sure that only one of them is "active" at a given moment. From your specs, I would think you can provide for that in your software? I'd certainly give that approach a try, anyway... Can't see that you could "break" anything...
It is no problem receiving two stop bits in place of one on the arduino but sending only one might be a problem for the receiving device. Two stop bits is very non standard with 8 data bits. You could always send the characters on at a time with a small delay between each.
Ok for the reciving device "PLC" i can chose baud rate and the other settings, so do mean for the "PLC" the settings will be better with 9200/8/2/N. ?
For the "Meter" i cant change the settings so i have to use 1200/8/2/N >:(.
There are lots of different converter chips, for the exact capacitor requirements, and circuit see the data sheet or the chip you choose. I tend to use a MAX202 but that is only because I have a hand full of them in my junk box.
Ok i just orderd some MAX232CPE and capacitor so i hope soon i get it op running
tkbyd
I believe... not sure... but believe I've read that you CAN set up two ports via NewSoftSerial, BUT...
You have to be sure that only one of them is "active" at a given moment. From your specs, I would think you can provide for that in your software? I'd certainly give that approach a try, anyway... Can't see that you could "break" anything...
Yes i will give it a try, there is no problem for me that the they not have to be active at the same time ;).
I got some other problems, i took a look at the DB9 connector for the meter and there is a small circuit inside at the PC side, so i wonder if this is a RS232 to TTL converter, but i do not have mutch clue about electronics but i got the schematic so if someone can see what this is for me, if it is a RS232 to TTL converter i don't need to build 2 ;),
No, its not a true RS232-TTL convertor, its a fudge used on serial Arduinos to make them work on typical PC RS232 interfaces that aren't too picky about voltage levels, it inverts the signal so that it suits the Arduino way of doing things. It may or may not work in your application. The standard way of doing it correctly is to use something like a MAX-232 chip.
So do you think that i can skip using this cable with this "converter" and use my own RS232 serial converter with the MAX232, i really don't wont to use this cable. or connect i direct to the arduino
I don't see why you shouldn't use your own RS232 convertor with the Arduino. Personally I'd stick with USB if thats an option.
The diagram i showed you is from a cable that gos from the meter and to the PC, and if i understood you right the diagram was a fudge RS232 to TTL converter right? if so that means that the meter/"device1" has a TTL connection right? and can this not be connected directly to pin 0 and 1 on the arduino..
If it uses 5v and has the signals the right way up you should be able to connect it directly. I'd put something like 10k resistors on the TX & RX lines 'in case' . I thought the the circuit was from a serial Arduino, its very similar. If your meter uses the same then it should work directly.
On the board where i connect the cable from the arduino is there to Photocouple one for rx and one for tx, end the Photocouple they have used are the PC357N Series but not 100 % sure.
So now i tried to connect my arduino to the Heat meter with a resistor but no result.
From Arduino Heat meter
Pin0 10kOhm =Data Out "J1=7"
Pin1 10kOhm =Data Req "J1=6"
So i got the schematic over the heat meter where i do the connecting,
but they told me with a TTL i have to put in a 1 k Ohm resistor and a 4,7 k Ohm pull up resistor, but i don't know where to put them, can some of you electrical guys se that.
i can wait until Monday and talk with them but i really love to play in the weekend..