-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use I2C on pins PF3 and PF2 #112
Comments
Hi! It is correct that these pins can be used for i2c communication, but this is in slave mode only and this "dual-mode" as it is called in the datasheet is not supported by MegaCoreX. I don't have an example to give you, sorry. You can read more about it in the PORTMUX and TWI section in the complete ATmega4809 datasheet: |
Read the manual more closely, They can only be used as pins for a Wire slave (ie, the atmega480x acting as slave). and only in dual mode. Only PA2/3 and PC2/3 can be master. @MCUdude - you should seriously steal the megaTinyCore/DxCore version of Wire (I made a pass at trying to make sure that it worked with MEGACOREX parts too, so it would just need a bit of testing). We have come a tremendous way since our wire cores were last similar. There's been a total from the ground up reimplementation, dual mode is now supported (though that doesn't change the fact that PF2/3 are slave pins only), sleep mode doesn't have the risk of blowing up the whole I2C bus, and the missing features that were needed in order for the slave to implement something that acts like a typical I2C device (what I call the "register model", so you can make I2C slaves that use I2C as more than a glorified USART. Oh and the baud rate configuration (finally) actually baud rates pretty close to what you asked for (though it can never guarantee a specific baud rate - the modern AVR TWI watches the levels on the pins so with weak pullups, or high bus capacitance, it'll always run slower than expected, because the rise time is longer) |
Hi,
ATMega4809's manual informs that pins PF3 and PF2 can be used for I2C communication (page 7). How can I use those pins for a
Wire
communication? Is it possible to show a small example?The text was updated successfully, but these errors were encountered: