Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
April 18, 2024, 03:36:24 15:36


Login with username, password and session length


Pages: [1] 2  All
Print
Author Topic: MCU serial communication with Hyper Terminal....... Need Help  (Read 11523 times)
0 Members and 1 Guest are viewing this topic.
abcsantosh
Junior Member
**
Offline Offline

Posts: 57

Thank You
-Given: 33
-Receive: 3


« on: November 04, 2009, 06:04:21 18:04 »

 Hi all, so many times I made some projects including PIC Micro controllers on board serial communication, and each time I don't get any response with hyper terminal. Recently I compiled one project with Attiny2313 using it's serial com port. Some settings and other functionality will be configured from Hyper terminal. So I connected this project to computers serial port and started the Hyper Terminal. But I didn't get any message on screen. I don't know what went wrong ? will somebody help me on this ? I am familiar with Pic uC and this is my first project in AVR. 
Logged
cncbasher
Junior Member
**
Offline Offline

Posts: 91

Thank You
-Given: 107
-Receive: 51


« Reply #1 on: November 04, 2009, 06:07:40 18:07 »

firstly , do not use hyperterminal for any type of development testing , it's just terrible .

post your project or pm me with it and lets see what is wrong


Logged
sam_des
Senior Member
****
Offline Offline

Posts: 253

Thank You
-Given: 124
-Receive: 146


« Reply #2 on: November 05, 2009, 03:09:39 03:09 »

Hello cncbasher,

I've use HyperTerminal on many of my projects when a independent full-fledged program wasn't necessary or requested. If you are not getting any output on hyperterminal then check hyper-terminal settings match with your settings..
0) COM port you are connecting is same as your selected port in HyperTerminal
1) Baud Rate
2) Stop Bits
3) Data Bits
4) Parity Bits
5) Flow Control - Hardware/Software, XON/XOFF chars
6) You must manually enable local key echo which is disabled by default
7) You terminal emulation - Usually 'Auto Detect' will do

If everything is OK, check the your uC software.
1) Are you correctly initializing USART ?
2) Are actually writing the something into transmit buffer ?
3) Have you setup i/o ports correctly(PORT/DDR) ?
4) If you're doing interrupt-driven comm., are you enabling global interrupts, serial tx &/or rx interrupts. There are more than one interrupts associated with USART. TX complete, TX buffer empty, RX complete etc ?
5) For buffered comm., are you correctly reading from buffer ?

If you find no errors, try to run the code in  simulator with terminal capabilities - Proteus. Step through the code & watch the USART & other config registers so that they are indeed getting intialized & working correctly. See if some other code is not accidently over-writing & nulling the USART init or something other.

If everything works fine in simulator & not actually on Hardware now is the time to switch on oscope & multimeters.
1) Check if you level translator is correct.
2) If you are using some charge-pump based IC, all caps are mounted correctly.
3) See if you are connecting you tx/rx pins from uC to level translator & level translator to DB9 correctly,
4) Check that you have indeed connected GND to DB9
5) Check for cable faults. Make your whatever your handshake is, cable follows it. Not that even if you are not using any handshaking CTS/RTS/DSR pins must be connected.
6) Watch the tx/rx pins on scope, you can see your transmissions/receptions if you lower your baud enough & repeatedly send some test character.

If you're still facing problems, post your code & schmeatic & we'll look into it.

Hope that helps,

regards,
sam_des
Logged

Never be afraid to do something new. Remember Amateurs built the Ark, Professionals built the Titanic !
oldvan
Senior Member
****
Offline Offline

Posts: 372

Thank You
-Given: 154
-Receive: 107


If the van is a Rockin'...


WWW
« Reply #3 on: November 05, 2009, 03:26:46 03:26 »

Silly thougth, but Perhaps missed the need for TTL to RS232 levelconverter/inverter like a MAX232?
Logged

Give a man a fish and you feed him for a day.
Teach a man to fish and he will sit around in a boat drinking beer all day.
abcsantosh
Junior Member
**
Offline Offline

Posts: 57

Thank You
-Given: 33
-Receive: 3


« Reply #4 on: November 05, 2009, 05:11:23 05:11 »

Hi, I found this project on net. 
here is the schematic http://elm-chan.org/works/smc/smc3.png

and here is the code http://elm-chan.org/works/smc/smc3.zip

and here is the description of the project http://elm-chan.org/works/smc/report_e.html

I have built the entire project. But since this is my first project in AVR, I am bit confused with fuses. oscillator etc. I compiled it with avr studio 4. If possible, pls post the compiled hex file.
Also I tried it with max232. But as you said, their is possibility of handshaking pins not connected.
tell me which software is used instead of Hyper Terminal.
Help me
have a nice day
Logged
janakfun
Junior Member
**
Offline Offline

Posts: 36

Thank You
-Given: 4
-Receive: 4


« Reply #5 on: November 05, 2009, 05:16:50 05:16 »

well while you are connected with hyperterminal.. , in the background you can use HDD free serial port monitor software to see the data bytes...
if your project is for two way communication that is if you can send some data to controller through selines.. than you can use windmill software.. this software also shows the data bytes received...
Logged

Regards,

Janak
cncbasher
Junior Member
**
Offline Offline

Posts: 91

Thank You
-Given: 107
-Receive: 51


« Reply #6 on: November 05, 2009, 09:48:18 09:48 »

here's the compiled project files ,

it is important you use a max232  instead of the ttl 74hc14 ( see attached (use txd rxd pins for tiny , as this shows a mega16 layout ) newer pc's especialy laptops are more sensitive to levels required
connect up the rs232 circuit and confirm by shorting out TXD & RXD at the cpu , then typing in a terminal application you should get loopback , i.e what you type on the keyboard will be shown in your terminal program , once you reach this stage confirming your hardware & wiring is correct , then you can move forward to programming etc
handshake is not required only txd , rxd , gnd pins & no flow control , remember to start with keep it simple ! .

then use a simple program to test serial communications , ( i will send one later )
Logged
Sun_rise_pt
Junior Member
**
Offline Offline

Posts: 91

Thank You
-Given: 87
-Receive: 9


« Reply #7 on: November 05, 2009, 09:51:50 09:51 »

The circuit seems ok. The hardware for communications between AVR's and a RS232 terminal are very simple...  On the MCS Electronics site  you obtain the schematics with 2 transistor and few more passive components.  Allways works on my projects!

Take care with (important) fuse programmation. Try to disable the clock divider and slelect the last option of oscilator  (xtal osc) and program this. With no correct parameters can't obtain the good baudrate.

You have a other terminal emulator. The Adrcom (good, simple and free...)  on  www.ontrak.net/adrcom.htm

Good work
« Last Edit: November 05, 2009, 09:57:52 09:57 by Sun_rise_pt » Logged
0815achim
Junior Member
**
Offline Offline

Posts: 50

Thank You
-Given: 224
-Receive: 25


« Reply #8 on: November 06, 2009, 06:09:54 06:09 »

I think that many people (like me) who start AVR programming have problems with the right setting of the fuses. Possibly anybody could post a screenshot of the settings in AVR Studio for abcsantosh's project.
For my projects with the serial Port i always use Terminal V1.9b.
It has everything you need and is very easy to use and FREE.
http://www.microchipc.com/make_a_solderless_RS232_crossover_cable/terminal_v1-9b.zip

Greetings 0815achim
Logged
zippozappo
Newbie
*
Offline Offline

Posts: 21

Thank You
-Given: 25
-Receive: 13


« Reply #9 on: November 06, 2009, 07:11:56 07:11 »

I had sometimes problems with output level of the 232 (i worked with serial devices 'hard to ear'  )
i solved changing caps on the Max232 with 4.7uF instead of 1uF
hope this helps  Wink
Logged
abcsantosh
Junior Member
**
Offline Offline

Posts: 57

Thank You
-Given: 33
-Receive: 3


« Reply #10 on: November 06, 2009, 02:13:41 14:13 »

 Hi cncbasher, I am using your compiled file. Also I removed the 74hc14 and hooked the circuit to MAX232 as per your schematic direction. But nothing happened. All the connection are seems OK. I have checked it twice.     

 Hi zippozappo , I am using 1uF Caps of tantalum Electrolytic type. Is anything wrong with them ? Which type of caps you are using ? ie.. Elec or disk type. I will test it as per your directions.

 Hey everybody, like 0815achim said, post some screen shots of avr studio fuse settings or tell me how to set fuses in program. Which is read by programming software. I am using PonyProg with JDM type serial programmer.
 
 I just lost two uC because of playing with fuse settings. (I didn't touch the security settings) Also tell me how to recover them.

 Before playing with fuses, I have got somthing not readable on screen. Now I didn't get anything at all.
 :-)

Have a nice day 

Logged
cncbasher
Junior Member
**
Offline Offline

Posts: 91

Thank You
-Given: 107
-Receive: 51


« Reply #11 on: November 06, 2009, 07:38:49 19:38 »

lets move forward slowly can you remove the cpu and connect the txd & rxd pin together ? ( ideal if the cpu is on a socket ! )
then with the board powered up ( as the max232 needs power ) and your termnal application running you should be able to type on your keyboard and it should echo back on your terminal (if not then you could have your rs232 cable wired wrong , or the cable is crossing over pins 2 & 3 ) as this simple test only pins 2,3 & Gnd are used  .
( you can also test the rs232 cable by also shorting out pins 2 & 3 ) this will test your terminal application and rs232 lead are in working order , although not if the pins are wired correctly , only that data is correct
we need to confirm that the hardware is correct before looking deeper into software .
Logged
zippozappo
Newbie
*
Offline Offline

Posts: 21

Thank You
-Given: 25
-Receive: 13


« Reply #12 on: November 07, 2009, 09:20:12 09:20 »

eletrolytic  Smiley, polarization like MAX232 official datasheet
Logged
cncbasher
Junior Member
**
Offline Offline

Posts: 91

Thank You
-Given: 107
-Receive: 51


« Reply #13 on: November 07, 2009, 09:31:55 09:31 »

1uF electrolitic caps will be fine , it is only when working with non standard rs232 ports on some pc's ( especialy laptops , read cost cutting ! , and lower voltage circuits ) that due to timing issues and lower than normal voltage level swings  , that you need to start to look at using other methods such as changing the buck convertor caps on the max232 .

this is not related to your problems , so no need to worry
Logged
abcsantosh
Junior Member
**
Offline Offline

Posts: 57

Thank You
-Given: 33
-Receive: 3


« Reply #14 on: November 08, 2009, 07:48:02 07:48 »

Hi all, I have tested the port for loop back test. But I didn't get any echo on screen. Is there any possibility of my port on motherboard is gone ? I used serial port monitor software. It showed me some activity on port, but I didn't sure about it.

I have atached the screenshot of serial port monitor. I typed some characters in Hyper Terminal and serial port monitor captured it.

Have a nice day
Logged
zuisti
Senior Member
****
Offline Offline

Posts: 409

Thank You
-Given: 242
-Receive: 780


« Reply #15 on: November 08, 2009, 08:39:12 08:39 »

Hi all, I have tested the port for loop back test. But I didn't get any echo on screen.
Is there any possibility of my port on motherboard is gone ?
I used serial port monitor software. It showed me some activity on port, but I didn't sure about it....

Hi!
I think it's a HW problem, I hope this site helps to you:
http://zone.ni.com/devzone/cda/tut/p/id/3450 (How to Do a Serial Loopback Test)
Good luck
zuisti
Logged
abcsantosh
Junior Member
**
Offline Offline

Posts: 57

Thank You
-Given: 33
-Receive: 3


« Reply #16 on: November 08, 2009, 10:41:27 10:41 »

Hi all, suggest me some solution to use instead of serial port on motherboard. i.e. USB to Serial converter or may be pci card with serial ports.

another point is how can I confirm the problem is with my Hardware not in connections.  Is there any software to find this ?

Have a nice day
Logged
cncbasher
Junior Member
**
Offline Offline

Posts: 91

Thank You
-Given: 107
-Receive: 51


« Reply #17 on: November 08, 2009, 10:49:52 10:49 »

open hyperterminal , with no hardware handshaking  , on your pc serial port connect pins 2 & 3 as shown in the last post
whatever you type in hyperterminal should be echo'd back




Logged
abcsantosh
Junior Member
**
Offline Offline

Posts: 57

Thank You
-Given: 33
-Receive: 3


« Reply #18 on: November 08, 2009, 11:52:25 11:52 »

Hi cncbasher, I have done as you said in previous post. I do shorted pin 2 and 3 together on direct cable and also with MAX232 with it's power on. But I didn't get anything echoed back. Also I have checked the settings in Hyper Terminal about echo typed characters locally and no hardware control. What do you think ? Is the port damaged or anything else?

Have a nice day

Posted on: November 08, 2009, 12:09:35 12:09 - Automerged

Hi all, is this the loop back test which means seeing typed characters back on screen ? with only pins 2 and 3 shorted.

Have a nice day
Logged
cncbasher
Junior Member
**
Offline Offline

Posts: 91

Thank You
-Given: 107
-Receive: 51


« Reply #19 on: November 08, 2009, 12:50:13 12:50 »

yes thats good , that proves your serial port on your pc is ok ,
now connect up your avr board and power up , do not change anything in hyperterm ,  but this time connect the txd and rxd pins at the cpu ( remove chip and jump across pcb or socket with a peice of wire  ) you should now be able to type as you did before , if not working this time then the possibility exists that your rs232 cable from the pc to your avr board has crossed over  pins 2 & 3 , or some error in the max 232 circuit ( confusing txd & rxd is usualy the problem , as to the data direction

some times making a rs232 lead with only pins 2,3,& gnd is helpful
depending on the circuit you will need the rs232 leads wired as

9 pin
2 -2
3-3
5 -5

or
2 -3
3 - 2
5 -5

see how you progress now

 
Logged
abcsantosh
Junior Member
**
Offline Offline

Posts: 57

Thank You
-Given: 33
-Receive: 3


« Reply #20 on: November 08, 2009, 01:15:17 13:15 »

Hi cncbasher, This step by step conversation is really becoming a walk through tutorial for beginners like me. It helped me a lot. Now I have followed the suggested procedure and see what I got in attached picture. Also I found that my cable is straight and I used only txd and rxd pins.     

Posted on: November 08, 2009, 02:10:50 14:10 - Automerged

Hi cncbasher, Now I have got another problem. I have connected the project board to serial port. Only Txd And Rxd pins are used through Max232. Upon power up The termite window shows me the text which is not readable. Guide me further.

Have a nice day
Logged
cncbasher
Junior Member
**
Offline Offline

Posts: 91

Thank You
-Given: 107
-Receive: 51


« Reply #21 on: November 08, 2009, 01:37:13 13:37 »

make sure you have rs232 pin 5 grounded at your project board , you should have 3 wires from your avr board remember pins 2 & 3 and do not forget ground pin 5 , if you can open circuit the serial data pins you have shorted at the avr cpu and you now get NO  echo'd characters then thats fine , this proves the chars are going from the pc through the max 232 and being returned to the pc .



 
Logged
abcsantosh
Junior Member
**
Offline Offline

Posts: 57

Thank You
-Given: 33
-Receive: 3


« Reply #22 on: November 08, 2009, 01:54:07 13:54 »

Hi, RS232 gnd pin is connected to the avr side. Also the rx and tx pins are properly connected. (Not short circuited) In this configuration I have got the unreadable characters.

I also tried with open Gnd, but no characters received at all.

Have a nice day
Logged
Ichan
Hero Member
*****
Offline Offline

Posts: 833

Thank You
-Given: 312
-Receive: 392



WWW
« Reply #23 on: November 08, 2009, 02:41:08 14:41 »

Quote
Upon power up The termite window shows me the text which is not readable.
Pardon me, did you properly connect the VCC and GND pin of the MAX232? It is hidden pins on CNCBasher schematic.

-ichan
Logged

There is Gray, not only Black or White.
abcsantosh
Junior Member
**
Offline Offline

Posts: 57

Thank You
-Given: 33
-Receive: 3


« Reply #24 on: November 08, 2009, 03:23:02 15:23 »

Hi Ichan, I have checked the Vcc and Gnd pins of MAX232. These pins are connected properly and Vcc has proper voltage.

May be this has to do something with AVR fuse settings ? Show me the fuse settings in Ponyprog software if possible.

Have a nice day
Logged
Pages: [1] 2  All
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC