Hi, I am trying to send data from one controller to another directly ie without converting it into serial. Now when i send the data using 232 it is being received alright and the out put is also displayed. i am using putchar and getchar. but when i try this by directly connecting the Tx of first controller to Rx of next the data is either not being read properly or not being transfered properly. I'm just not getting what is going wrong. it should work i think i have even made the ground common for both the controllers.
Thanks Ajay.
TTL is just an old name - Transistor-Transistor Logic. It doesn't say too much about the actual signal levels. Common voltages right now are 1.8V to 5V.
You need to have the same signal levels on both chips, i.e. if one chip is using 5V signalling levels, the same logic levels are needed on the other too, or the chip with the higher voltage may kill the chip with the lower voltage, while signals in the other direction may fail to be detected as high.
In some cases it may be enough to just use a serial resistor between the two chips in case they use different voltages, but that requires that the chip with the higher voltage are low-level compatible, i.e. have a very low threshold for detecting a signal as high.
Normally, the best way to interface logic with different logic levels is to use a level-converter chip inbetween. Even if this represents an extra chip, it is still better than to need two RS-232 converter chips - especially since the RS232 converter chips either needs a very high supply voltage or external capacitors to pump up the voltages to the required RS-232 levels.
Are the two controllers on the same circuit board? Note that if they are not, you should add EMI filters, serial resistors and some overvoltage protectors on the signals. The controller I/O pins are not always as sturdy as the RS-232 chips.
...i have even made the ground common for both the controllers.
Note that this is not an optional extra. It is a strict requirement that the two units have a common ground reference for the signals if you are going to communicate without use of transformers, opto-couplers or similar.
Hi Per,
--> level-converter chip
I am using 8051 and 2051 can you suggest a level converter ?
--> Are the two controllers on the same circuit board?
No They are not but i was thinking of using same supply for both or may be i can bring them on a same board.
Thanks for your suggestions i will try those out also please suggest a level converter.
Exactly what voltages will the two chips be supplied with?
If both are going to use the same supply voltage, then you would normally not need any level converters. Level converters are used if one chip is - for example - using 1.8V logic, and one is using 3.3V.
...i was thinking of using same supply...
So the two boards will be close together? If not, then you should probably think about some form of buffer chip - such as the RS-232 buffers - between the boards. Besides protecting the controllers, they also increase the noise margin for the communication.
You don't want relatively high-impedive signals - with fast flanks - sent over a long cable. Especially if the cable isn't twisted.
Hi, They both use 3.3V and they are not very far away actually not more than a few feet. so basically i do not need a Level converter ?.
not more than a few feet You WILL get into trouble without 232 transceivers.
Direct serial is OK within the same box, but a disaster when you go outside the box.
You say you are 'testing' what on earth does that 'prove' besides "it seems to work, when located on your workbench"?. Now take your EMI generator (I use an old router named 'sparky') and put it next to your direct serial outside the box and see it fail moiserably.
Erik
Hi erik,
I am sure that you are very correct when you say that it won't work out side the testing environment . i am just trying to see if i can avoid redesigning the board that is already present. the thing is i have two board 1 uses 232 but the other dose not so i wanted to see if it is feasible to pass data between them without changing the boards around. and i'm going to try and put it under as harsh conditions as possible.
Thanks ajay
View all questions in Keil forum