I2C AVR

A forums to allow bugs and problems with Flowcode v6 to be reported and resolved.

Moderator: Benj

Post Reply
User avatar
cubitus54
Flowcode v5 User
Posts: 110
Joined: Wed Jun 19, 2013 7:18 am
Has thanked: 7 times
Been thanked: 32 times
Contact:

I2C AVR

Post by cubitus54 »

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
Flowcode V6.1.2.0(11 05 2015)

User avatar
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

Post by Benj »

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.

Post Reply