Arduino_Core_STM32F1 & I2C

The official STMicroelectronics Arduino core
fpiSTM
Posts: 227
Joined: Fri Sep 16, 2016 12:33 pm
Location: Le Mans, France

Re: Arduino_Core_STM32F1 & I2C

Post by fpiSTM » Wed Jun 07, 2017 9:18 am

Hi @caniggia,
@Wi6Labs has raised an issue on the repo to follow this issue.
https://github.com/stm32duino/Arduino_C ... /issues/47
If his correction is ok it will be merged.
Else as I mentioned, this point will be duplicated on the new repo and fixed on it when F1 will be merged.

caniggia
Posts: 27
Joined: Tue Dec 06, 2016 2:38 pm

Re: Arduino_Core_STM32F1 & I2C

Post by caniggia » Thu Jun 08, 2017 8:44 am

Hi @Wi6Labs & @fpiSTM

Thanks for your effort to get this slave library to work.
The delay inside the slave loop example must be less than the delay between read and write command inside the loop of master example. Maybe you can just remove it.
The Serial speed must be increase to allow to exit the function receiveEvent() before the master send the next request (I tried with 115200 baud).
Sounds very logical.
I don't know how did i missed delay in slave loop. I should realy get some glasses :)

I'll try it as soon as i have some time, probably tommorow.

Thanks
caniggia

caniggia
Posts: 27
Joined: Tue Dec 06, 2016 2:38 pm

Re: Arduino_Core_STM32F1 & I2C

Post by caniggia » Mon Jun 12, 2017 12:25 pm

Hi @Wi6Labs

In slave sketch i've commented out delay in loop.
And also Serial.print's in receiveEvent.

It works OK even without delay between Read & Write in master.

Then i've changed the order in master. First Write then Read.
Because i'm gonna use it that way.
Master sends command and then get data depending on that command.
I've needed 100us(micro sec.) delay between Write & Read.

I've run it over the weekend and it looks OK to me.

Thnx
caniggia

User avatar
Wi6Labs
Posts: 25
Joined: Fri Sep 16, 2016 11:39 am
Location: Rennes, France
Contact:

Re: Arduino_Core_STM32F1 & I2C

Post by Wi6Labs » Mon Jun 12, 2017 12:43 pm

Hi @caniggia

Thank you for your feedback.
Performances look like very good.
We will merge the patch.

Thanks
Wi6Labs
Wi6Labs team

Post Reply