UART on STK500 using USB

Go To Last Post
7 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi all, i have a STK500 board with Atmega16 on it.. i just want to write a simple code to use the USART in the chip.. so far i have successfully programmed the chip from my laptop (i dont have a serial porta nd i am using a JTAGMKII)).. i have written hello world in the program.. now i want to see hello world on my laptop.. can i see the output using hyperterminal? i am using a USB to serial converter and connecting it to the RS232 Spare serial port on the STK500. Also I have connected port d (PD0 and PD1) pins yo the RXD and TXD pins of RS232 SPARE on my board.. what am i doing wrong? any help appreciated..

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You probably have the wrong speed on your AVR. You think you are running at the STK500 clock and you are still running on internal 1MHz RC.

1. double check fuse settings
2. ditto STK jumpers
3. try different speeds on Hyperterminal

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Debugging a serial port is not trivial...there are all kinds of things that can go wrong.

1. Clock Frequency of AVR (affects baud rate).
2. Baud rate not set correctly.
3. Over running transmit buffer (not waiting for correct status).
4. Jumper backwards that connects to uart port.
5. And all sort of other things.

The most useful tool for debugging a UART is a scope. If you have access to one, use it to monitor TXD from the AVR. Using the scope you can at least verify that you are sending characters out.

Also, since you are using the JTAG pod, if you pause your code, you can use the debugger to directly write data into the transmit data register and if everything is properly connected, you will see a character show up on the terminal screen (assmuming that there is nothing wrong).

Anyway...hope that some of this will help. Once you get the uart transmitting...generally the rest is pretty easy.

-Jim
http://www.noniandjim.com
Analog and Digital Electronics
Music Synthesizers

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

thanks for your help,i will certainly try a scope to monitor the TXD line..i had a question about the hyperterminal.. when i open hyperterminal it gives me three options 1)modem 2)com3 and 3)winsock
what should i select here? i dont have a com port and i am using a USB.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

when i open hyperterminal it gives me three options 1)modem 2)com3 and 3)winsock
what should i select here? i dont have a com port and i am using a USB.

The drivers for the USB-to-serial converter supplies a virtual COM port on your PC. Go into the device manager to find what COM port number that is. Let's hope that it is COM3. If so select that in HyperTerminal.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

thanks for your help,i will certainly try a scope to monitor the TXD line..i had a question about the hyperterminal.. when i open hyperterminal it gives me three options 1)modem 2)com3 and 3)winsock
what should i select here? i dont have a com port and i am using a USB

I hate hyperterminal...the RS232->USB converter is probably what is showing up as COM3. The only way to know for sure is to go to the control panel, open up the System Icon, click on the Hardware Tab, and then click Device manager. Scroll down to Ports (COM & LPT) and expand this. You should see the name of your RS232->USB port listed there.

When you have a free moment...I recomend locating TerraTerm. A much better (and free) program.

-Jim
http://www.noniandjim.com
Analog and Digital Electronics
Music Synthesizers

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

it was actually Com 5 i had to install the drivers for the USB to RS232.. i get something to echo in my hyperterminal but its all garbled.. i guess i need to try diff. baud rates and CPU frequencies..