EmbeddedRelated.com
Forums
Memfault Beyond the Launch

Problem w serial comms ATmega128 <-> PC

Started by A. Drosos December 4, 2005
Problem with serial communications between ATmega128 and PC

I have used WinAVR and Peter Fleury's interrupt controlled uart library
successfully in the past with the STK500 board and the AT90S8515 and
ATmega16 devices. Moving on to a bigger project I purchased the STK501 board
with an ATmega128. Connecting it to the STK500 I can program the device with
the default xmas_tree_leds_flashing program so I assume it is working OK.
However, trying out a simple test_uart program I get nothing out of the
serial port. I have fiddled with fuses, clocks, pins etc. and still nothing.
There is probably something here that I have not understood, some setting or
connection that I should do and am not doing.

My setup:

- STK500+STK501 with the ATmega128 device
- default settings on all jumpers both boards
- RS232 spare pins to PD0 and PD1 on STK500
  (assume this still works with STK501/ATmega128 combo)
  - listen to PC com port with Bray's terminal application at 9600 baud
  - internal clock for device (no external osc) have tried all settings
    available on AVRStudio (latest version 4.12 - build 460) from 1 to 8 MHz.
    
My suspicion is that the 501 board uses another port for serial comms other
than portD or requires some other jumper? / connection? than the default
one.

Someone must have the same parts as I do and hopefully has this working.
Please give me some pointers on what I should look into.

Thank you
Rich Webb wrote:
> On Sun, 4 Dec 2005 16:52:01 +0000 (UTC), drososa@otenet.gr (A. Drosos) > wrote: > > >>Problem with serial communications between ATmega128 and PC
Check the ATmega103 compatibility fuse. It is set by default. Regards, Alejandro.
On Sun, 4 Dec 2005 16:52:01 +0000 (UTC), drososa@otenet.gr (A. Drosos)
wrote:

> >Problem with serial communications between ATmega128 and PC > >I have used WinAVR and Peter Fleury's interrupt controlled uart library >successfully in the past with the STK500 board and the AT90S8515 and >ATmega16 devices. Moving on to a bigger project I purchased the STK501 board >with an ATmega128. Connecting it to the STK500 I can program the device with >the default xmas_tree_leds_flashing program so I assume it is working OK. >However, trying out a simple test_uart program I get nothing out of the >serial port. I have fiddled with fuses, clocks, pins etc. and still nothing. >There is probably something here that I have not understood, some setting or >connection that I should do and am not doing. > >My setup: > >- STK500+STK501 with the ATmega128 device >- default settings on all jumpers both boards >- RS232 spare pins to PD0 and PD1 on STK500 > (assume this still works with STK501/ATmega128 combo) > - listen to PC com port with Bray's terminal application at 9600 baud > - internal clock for device (no external osc) have tried all settings > available on AVRStudio (latest version 4.12 - build 460) from 1 to 8 MHz. > >My suspicion is that the 501 board uses another port for serial comms other >than portD or requires some other jumper? / connection? than the default >one.
The internal RC oscillator, especially if you don't apply the calibration byte, isn't likely to be sufficiently close to the nominal frequency to support reliable serial coms. Have you checked the TX pin? Is there anything happening there at all? -- Rich Webb Norfolk, VA
A. Drosos wrote:

> Problem with serial communications between ATmega128 and PC > > [snip] > > Someone must have the same parts as I do and hopefully has this working. > Please give me some pointers on what I should look into.
The Mega128 requires a tristatebuffer at the normal serial 1 since the SPI programming pin is shared with the serial 1. There is also a serial 2. Rene -- Ing.Buero R.Tschaggelar - http://www.ibrtses.com & commercial newsgroups - http://www.talkto.net
Uzytkownik "Rich Webb" <bbew.ar@mapson.nozirev.ten> napisal w wiadomosci
news:c1d6p1tmlklpivjg2uoiptdo8kp4apnuon@4ax.com...
> On Sun, 4 Dec 2005 16:52:01 +0000 (UTC), drososa@otenet.gr (A. Drosos) > wrote: > > > > >Problem with serial communications between ATmega128 and PC > > > The internal RC oscillator, especially if you don't apply the > calibration byte, isn't likely to be sufficiently close to the nominal > frequency to support reliable serial coms. Have you checked the TX pin? > Is there anything happening there at all?
I have used UART on internal oscillator for test purposes many times and I never had troubles with internal oscillator frequency different from nominal. Best regards, Jacek
On Fri, 9 Dec 2005 00:37:23 +0100, "Jacek Meyerhold"
<jacekmey@poczta.onet.pl> wrote:

>Uzytkownik "Rich Webb" <bbew.ar@mapson.nozirev.ten> napisal w wiadomosci >news:c1d6p1tmlklpivjg2uoiptdo8kp4apnuon@4ax.com... >> On Sun, 4 Dec 2005 16:52:01 +0000 (UTC), drososa@otenet.gr (A. Drosos) >> wrote: >> >> > >> >Problem with serial communications between ATmega128 and PC >> > >> The internal RC oscillator, especially if you don't apply the >> calibration byte, isn't likely to be sufficiently close to the nominal >> frequency to support reliable serial coms. Have you checked the TX pin? >> Is there anything happening there at all? >I have used UART on internal oscillator for test purposes many times and I >never had troubles with internal oscillator frequency different from >nominal. >
Then you have never tested your devices over any sort of temperature range. The inter oscillator changes quite a lot with temperature. For any sort of device which should work years without problems you need to test that it works over at least the temperature range -10 C to 70 C for reasonably hot regions. For desert countries, one probably need to go to at least 85 C, and for cold countries probably down to -40 C. Regards Anton Erasmus
> >Problem with serial communications between ATmega128 and PC > >My setup: > >- STK500+STK501 with the ATmega128 device >- default settings on all jumpers both boards >- RS232 spare pins to PD0 and PD1 on STK500 > (assume this still works with STK501/ATmega128 combo) > - listen to PC com port with Bray's terminal application at 9600 baud > - internal clock for device (no external osc) have tried all settings > available on AVRStudio (latest version 4.12 - build 460) from 1 to 8
MHz. Hi, I think the problem is, that you use the wrong connection between the UART outputs and the STK500. Are you using the UART 0 ? If so you must connect PE0 with SpareRx and PE1 with SpareTX - not PD0,1. Good luck Michael

Memfault Beyond the Launch