Arduino Mega 2560 R3
Macro component Stop ()
generates a delay of 10 ms, the standard indicates tBUF = 4.7 microseconds
in the macro (AVR_CAL_I2C.c) there delay_ms (10); !!!!
Init macro component
The speed I2C Harward is false and badly managed.
100 kbd -> 47 kbd really
400 kbd -> 58 kbd really
1 Mbd -> 111 kbd really
Meanwhile, this can be corrected with C
TWBR = 0; to 1M
TWBR = 12; for 400k
TWBR = 72; for 100k
I2C AVR
Moderator: Benj
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: I2C AVR
Hello,
I will investigate this and see if we can get the timings cleaned up a bit for AVR devices.
The 10ms delay avoids a potential lockup on some devices. We felt it was better to have things working but slow rather then an unexplained potential lock up. Maybe we can also manage this better via a property in the component or a flag in the definition file highlighting the issue for the specific targets.
I will investigate this and see if we can get the timings cleaned up a bit for AVR devices.
The 10ms delay avoids a potential lockup on some devices. We felt it was better to have things working but slow rather then an unexplained potential lock up. Maybe we can also manage this better via a property in the component or a flag in the definition file highlighting the issue for the specific targets.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel