so I'll experiment with a bit lower Vcc while waiting for correct solution with converter.
How do you wanna lower the Vcc on the Arduino? The power input is sent to a voltage regulator which keeps it at 5V and the USB voltage is always above 5V. Not that I say it's impossible, just curious how you do it.
so I'll experiment with a bit lower Vcc while waiting for correct solution with converter.
How do you wanna lower the Vcc on the Arduino? The power input is sent to a voltage regulator which keeps it at 5V and the USB voltage is always above 5V. Not that I say it's impossible, just curious how you do it.
Well one could power the board directly via the 5v shield pin with an adjustable regulated DC power supply for such testing purposes.
I've managed to get into electronics store 5 minutes before closing and bought transistors to build converter described in "Using 4 transistors" section of Arduino Playground - I2CBi-directionalLevelShifter.
It makes perfect voltages on both sides - 5V on Arduino and 3.3V on Aurora side.
I do receive some frames as before....and as before it hangs!
I can order more sophisticated converter and check again, but I'm not sure if that's really my problem.
Will I be forced to buy some simple oscilloscope like USBee to fix that?
Thanks for your suggestions. I would be grateful for new ideas...
Just a wild guess: If an edge or two get lost from the Aurora, the Arduino hangs waiting for more bits. You might have to make the code a bit more tolerant for such stuff if the signals from the Aurora aren't as good as you might want them.
Will I be forced to buy some simple oscilloscope like USBee to fix that?
The old and unrecognized problem here.
Arduino I2C standard and even some custom libraries are tend to hang in some circumstances.
Every time I discus this problem here, I'm driven to check/fix hardware.
No one can figure out that hanging is the worst thing that may happen with any board, good library menas you can't drive board to uncontrolled state with any manipulation from outer pins but over-voltage.
If there is loop in twi library, something like this
while(TWI_MRX == twi_state),
than you get a bomb that can be activated in any time.
Suppose you control segway or quadcopter and I2C signal is overlaped by EM noise or some other hardware problem, you even doesn't have ability to shut down the system safely.
I working on I2C long distance transmission and met the hanging problem again.
@kaor: I agree totally. I had similar problems with a library for RN-XV (WiFly) bees. If any byte was not transferred exactly as in the datasheet (without checksums and the like), the library was just in an endless loop. My plant watering system hanged every day or two. I changed the library to have a timeout in every function and adapted my code to react on the error codes returned. Since then the system works for months without interruption (except a small power outage about 4 weeks ago).
The problem with the Wire library might be, that it can be used in situations where timer 0 is used for other stuff and millis() and micros() is not available. Best solution probably is to have two versions of the Wire library, one with timeouts and one without.