MCUdude / MegaCore

Arduino hardware package for ATmega64, ATmega128, ATmega165, ATmega169, ATmega325, ATmega329, ATmega640, ATmega645, ATmega649, ATmega1280, ATmega1281, ATmega2560, ATmega2561, ATmega3250, ATmega3290, ATmega6450, ATmega6490, AT90CAN32, AT90CAN64 and AT90CAN128
Other
374 stars 115 forks source link

ATmega 128 I2C doesn't work #194

Closed krchan closed 10 months ago

krchan commented 1 year ago

I have been using megacore for a standalone project on Atmega 128. I have followed the procedures. I was able use most of libraries but when it comes to I2C, it is not working. Is there a configuration/setup change there. Using a pullup register also in the SDA/SCL pins. The I2C Scanner example code gets struck at Scanning..... I am using Arduino IDE with ATMEL ICE as the programmer for the project. I was interfacing TSL2561 with Atmega128, I checked the sensor with Arduino Due and library and code works well. But when Atmega 128 is used the code shows scanning

MCUdude commented 1 year ago

It may be that your i2c target device is pulling the SDA or SCL line low. This will pretty much freeze the microcontroller until released because the current Wire library doesn't support timeouts yet. It's in the works though. Can you try with a different i2c device, just to check if there's anything wrong with your setup?

I have an ATmega128 myself, and it works perfectly fine with the Wire library

krchan commented 1 year ago

I switched to another board and found the wire library to work perfectly with the same devices.

Thank you for the support and help.

On Mon, Dec 26, 2022 at 3:39 AM Hans @.***> wrote:

It may be that your i2c target device is pulling the SDA or SCL line low. This will pretty much freeze the microcontroller until released because the current Wire library doesn't support timeouts yet. It's in the works though. Can you try with a different i2c device, just to check if there's anything wrong with your setup?

I have an ATmega128 myself, and it works perfectly fine with the Wire library

— Reply to this email directly, view it on GitHub https://github.com/MCUdude/MegaCore/issues/194#issuecomment-1364744950, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC2FNDTGWKSTQHJLVFI6RRTWPDAZPANCNFSM6AAAAAARZA52QQ . You are receiving this because you authored the thread.Message ID: @.***>

--

Regards,

Chandan Kumar