Skip to content
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

Using usitwislave on ATmega328 (arduino uno) #3

Open
maali-mnasri opened this issue Apr 23, 2014 · 4 comments
Open

Using usitwislave on ATmega328 (arduino uno) #3

maali-mnasri opened this issue Apr 23, 2014 · 4 comments

Comments

@maali-mnasri
Copy link

Hi,
I wonder if this library "usitwislave" can be used on ATmega328p (arduino uno) or at least is there a chance to make it run on ATmega if I adapt the registers to my device ?

@eriksl
Copy link
Owner

eriksl commented Apr 23, 2014

I wonder if this library "usitwislave" can be used on ATmega328p
(arduino uno) or at least is there a chance to make it run on ATmega if
I adapt the registers to my device ?

You don't need this library on an ATmega328p, this microcontroller has a
"complete" hardware supported twi/i2c, it's no "USI" implementation. You
can find USI mainly on "ATtiny" devices.

@maali-mnasri
Copy link
Author

For a special case I need to use a software I2C (slave) library and not the I2C hardware module of the ATmega. USI is not implemented on ATmega328p but isn't it similar to USART ? Don't you think it (usiTwiSlave) may function on ATmega if I change the register names to the USART registers? Thank you.

@eriksl
Copy link
Owner

eriksl commented Apr 24, 2014

On 24-04-14 00:27, ilaam wrote:

For a special case I need to use an I2C slave software library and not
the I2C hardware module of the ATmega. USI is not implemented on
ATmega328p but isn't it similar to USART ? Don't you think it may
function on ATmega if I change the register names to the USART
registers? Thank you.

I see your point but the library is really tailored for USI, including
timings. I guess you'll have to search e.g. for i2c using bitbanging
(which I am sure do exist). I know the USART on the ATmega328p can be
used as secondary SPI device, but that's really something different.
It's a nice challenge ;-)

I guess you need the TWI pins for something else ;-)

@maali-mnasri
Copy link
Author

Yes exactly TWI pins are already used.
Thank you for your reply 👍 Now that you told me it's challenging to try to adapt usiTwiSlave to USART, I'll try again to find some bitbanging i2c lib because I already searched and all I could find were i2c master libraries not slave ones .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants