Description :
This is the little application test that uses the I2C1 on the extension Primer connector.
We implemented the "M24C08_EEPROM" example from the ST Library as a CircleOS application.
It shows how to use peripheral which pins are shared with FSMC.
Explanations :
The I2C1 on the extension card does not run because of sharing PB7 (I2C1_SDA) with the FSMC (FSMC_NADV) used for the LCD management.
So, the only solution is to temporarily unvalidate the FSMC before calling I2C functions.
This can be done by this function, followed by a delay :
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_FSMC, DISABLE);
for(i=0; i<1000; i++);
Then call
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_FSMC, ENABLE);
and the LCD will run again.
This fixes the START generation, but sometimes the program still stalls. So, we also must disable temporarily the TIM2 interrrupts (MEMS), with the instruction :
TIM_Cmd( TIM2, DISABLE );
Versions :
1.1 Compiled with new ST library version 3.x and CircleOS version 4.x
1.0 First release