avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] i2c works on ATMega32 but not on ATMega128


From: Ian Caddy
Subject: Re: [avr-gcc-list] i2c works on ATMega32 but not on ATMega128
Date: Fri, 04 Aug 2006 09:15:46 +0800
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20051201 Thunderbird/1.5 Mnenhy/0.7.3.0

Hi Onno,

The only thing off the top of my head that I can think about is the fuse setting to make sure you are using the external oscillator clock and not the internal RC oscillator on the chip which from memory is either 4MHz or 8MHz.

I hope this helps.

regards,

Ian Caddy


Onno van Eijk wrote:
Hi,

I've written some code that writes and reads to some i2c enabled
devices. I have written this code on the ATMega32 running on 3.68 Mhz
and everything works fine. TWBR = 10 (no prescaler), so according to the
datasheet the i2c interface should run at 100khz.

I now want to run the same code on an ATMega128 running as 16 Mhz. So I
changed the target to atmega128, changed the F_CPU define and changed
TWBR to 72 (still no prescaler). The code compiles and runs, but when I
try to write to a i2c address the code throws an bus error (TW_STATUS =
0) after writing the slaveaddress.

Got any suggestions were to look for the cause / solution? Is there a
extra fuse or register on the ATMega128 I should know about? The
ATMega103 compatibility mode Fuse has already waisted a lot of my time
:-( so it aint that.

Thanks in advanced for your help.
grz,
Onno

Ps.
I run the ATMega32 on an stk500 with the onboard oscilator running at
3.68 Mhz. SDA on Pc1 and SCL on Pc0
The ATMega128 I run on the stk501 addon with an external cristal running
at 16 Mhz. SDA on Pd1 and SCL on Pd0
Both pullups on the SCL and SDA line are 10k


_______________________________________________
AVR-GCC-list mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list


--
Ian Caddy
Goanna Technologies Pty Ltd
+61 8 9221 1860





reply via email to

[Prev in Thread] Current Thread [Next in Thread]