Continue to Site

Error while serial communication between PC and microcontroller

Status
Not open for further replies.

samthunderbolt

Newbie level 4
Newbie level 4
Joined
May 31, 2012
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
India
Activity points
1,342
Hi, I am tying to connect my Atmega8 microcontroller to my PC for serial-communication. I have prepared a level-converter circuit according to this tutorial ( https://extremeelectronics.co.in/avr-tutorials/rs232-communication-the-level-conversion/ ). A method for testing the circuit is given on the same page below. It says that if we connect the Rx and Tx wires that were supposed to go into the microcontroller, any data that is sent by the PC would be returned to itself, and so the input character would be echoed on the screen in the Hyperterminal.
However, when I open the hyperterminal and type the alphabets, I am getting some strange characters and not the character that I typed. ( See image attached : ) Can anyone explain why ?
 

Have you connected the GND between the PC RS-232 Port and the MAX232 circuit along with the TX and RX lines?

It is imperative that both devices share a common ground (GND), a fact which the tutorial does not appear to clearly indicate.

If you examine the photos there are three lines attached to the DB9 connector, TX, RX and GND.

What type of power supply is powering the MAX232 circuit?

BigDog
 

Have you connected the GND between the PC RS-232 Port and the MAX232 circuit along with the TX and RX lines?

It is imperative that both devices share a common ground (GND), a fact which the tutorial does not appear to clearly indicate.

If you examine the photos there are three lines attached to the DB9 connector, TX, RX and GND.

BigDog

Yes, indeed the COM Port connection and the MAX232 circuit are sharing the same ground. The tutorial indeed does not show that the 15th and 16th pins of MAX232 should be connected to ground and Vcc ( +5V), but I did realize that the circuit was not receiving power from somewhere. On futher googling, I found this tutorial ( https://sodoityourself.com/max232-serial-level-converter/ ) where the 15th and 16th pins are marked clearly


What type of power supply is powering the MAX232 circuit?

I am providing 5V supply to MAX232 via a USB port. Is that okay ?
 

Yes, indeed the COM Port connection and the MAX232 circuit are sharing the same ground. The tutorial indeed does not show that the 15th and 16th pins of MAX232 should be connected to ground and Vcc ( +5V), but I did realize that the circuit was not receiving power from somewhere. On futher googling, I found this tutorial ( https://sodoityourself.com/max232-serial-level-converter/ ) where the 15th and 16th pins are marked clearly

So you have pin 5 of the DB9 on the MAX232 circuit attached to GND? And TX and RX attached to pins 2 and 3?


I am providing 5V supply to MAX232 via a USB port. Is that okay ?

Yes, that should be sufficiently regulated.

BigDog
 

So you have pin 5 of the DB9 on the MAX232 circuit attached to GND? And TX and RX attached to pins 2 and 3?

Yes, pin5 of DB9 is connected to ground of MAX232. Pins 2 and 3 of DB9 are connected to pins 14 and 13 respectively of MAX232.
 

Hi Friend,

You don't mention any programming detail in uC in your post about. Sometime problem also in program not in circuit because circuit diagram of MAX232 it very easy.

Also, you can check and debug Receiver and Transmitter fucntion one by one like in First program only data send from PC and uC check that data and result indicated by means of port PIN,
then in second program some continous string of data send from uC and check on PC without any interrupt.

Good Luck
Ghanshyam Dudhat
 

Hi,

One more thing to check on the hardware side, is the chip you have a Max232 or a Max232A ? If its an A version then it needs different capacitors.
See - **broken link removed**

On the software side, lots of possibilities, but have you tried changing the baud rate up or down one level in hyperterminal and seeing what difference that makes.
What baud rate settings are you using on the micro and hyperterminal ?

Also try this program PuttY, instead of HT, it seems a lot easier to use. http://www.chiark.greenend.org.uk/~sgtatham/putty/
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top