This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Difference between Serial and TTL communication

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.

  • I forgot to mention one more thing i did not remove the 232 from the picture, it is still there i'm trying to take the data directly as i require the 232 for other use.
    will that make a difference and if so what can i do?

    Thanks
    Ajay

  • Hi,

    Thats correct. You should remove (or disable) the RS232 buffer, otherwise two outputs, one from the RS232-buffer, the other from the microcontroller itself are connected together !

    Regards

    Luc

  • 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.

  • Never two outputs connected togehter, unless they are open-collector or similar, or are individually controlled using enable signals.

  • 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.

    Thanks
    Ajay.

  • Hi Luc,

    I can not remove the 232 but how can i disable the buffer for a short while?
    Thanks
    Ajay

  • 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

  • No, you do'nt have to use a level shifter.
    If I do not misunderstand, the Rx from the receiving controller is connected to the Tx of the sending controller AND is also connected to a RS232 buffer.
    In that case you must use a 2->1 multiplexer to select one of the "sources".

    Regards.
    Luc.

  • No level converter needed.

    However, you might have to need to think about conditioning the signals, since a couple of feet of cable may pick up a lot of noise depending on environment and cable type.

  • rephrasing Pers post:

    level converter needed.
    OR
    you might have to need to think about conditioning the signals, since a couple of feet of cable may pick up a lot of noise depending on environment and cable type.

    Erik

    PS with all that, why not just use a MAX232(equivalent) and be sure?

  • 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

  • Hi Luc,

    I am using 4066 a switch IC to give out put to the 232 now the problem is i'm using both the ports of 232. i use one to communicate to a device and the other to communicate with the PC. but now i am trying to use another device instead of PC this device dose not have a serial port which is why i want to use the logic signal, and the 232 still is in picture.

    Thanks
    Ajay

  • Hi Erik,

    Just Trying to avoid redesigning , is it possible to avoid redesigning and still have data transmitted using 232 ?

    Thanks
    ajay