Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/

WebIDE Pi I2C "Error accessing..."

by teachop on Sun Feb 10, 2013 6:26 am

If talking to an AVR from the Raspberry Pi and you see that error message, read this:
http://elinux.org/BCM2835_datasheet_errata#p35_I2C_clock_stretching
Last edited by teachop on Mon Feb 18, 2013 5:11 pm, edited 1 time in total.
teachop
 
Posts: 25
Joined: Sun Feb 10, 2013 6:10 am

Re: WebIDE Pi I2C "Error accessing..."

by teachop on Mon Feb 11, 2013 7:10 pm

See...
Last edited by teachop on Mon Feb 18, 2013 5:12 pm, edited 2 times in total.
teachop
 
Posts: 25
Joined: Sun Feb 10, 2013 6:10 am

Re: WebIDE Pi I2C "Error accessing..."

by teachop on Mon Feb 11, 2013 7:32 pm

Below...
Last edited by teachop on Mon Feb 18, 2013 5:13 pm, edited 2 times in total.
teachop
 
Posts: 25
Joined: Sun Feb 10, 2013 6:10 am

Re: WebIDE Pi I2C "Error accessing..."

by teachop on Thu Feb 14, 2013 4:46 pm

Even though the problem is actually with the Pi I2C hardware, it can be worked around. This is a changed to the slave CPU, not the Pi. Putting a time delay in the Wire library twi.c allows talking to Arduino-likes from the Raspberry Pi on I2C. My atmega328p CPU is @ 8 MHz so perhaps this needs to be tweaked for 16 MHz cases (normal Arduino). Anyway, this bandaid completely stopped the problem (twi.c, in SIGNAL(TWI_vect) routine):
Code: Select all | TOGGLE FULL SIZE
    // Slave Receiver
    case TW_SR_SLA_ACK:   // addressed, returned ack
    case TW_SR_GCALL_ACK: // addressed generally, returned ack
      delayMicroseconds(3);
teachop
 
Posts: 25
Joined: Sun Feb 10, 2013 6:10 am