2011-09-09 01:41 AM
Hi,
I got the temperature sensor example form the standard library and it works fine on my STM3210E-EVAL board. But I would like to know, why the FSMC must be disabled before a I2C communication is performed. In every iteraten there is the sequence: #ifdef USE_STM3210E_EVAL /* Disable FSMC */ RCC_AHBPeriphClockCmd(RCC_AHBPeriph_FSMC, DISABLE); /* Initialize the Temperature Sensor */ LM75_Init(); #endif /* USE_STM3210E_EVAL */ /* Get double of Temperature value */ TempValue = LM75_ReadTemp(); #ifdef USE_STM3210E_EVAL /* Enable FSMC */ RCC_AHBPeriphClockCmd(RCC_AHBPeriph_FSMC, ENABLE); #endif /* USE_STM3210E_EVAL */ I tried to comment out the disable/enable calls, and this indeed resulted in not working the example (I get always the same value then), so the disable/enable seems indeed to be needed. But why is this necessary? Regards Dirk2011-09-09 02:40 AM
The fact that it's conditional on a flag called USE_STM3210E_EVAL suggests that it's something specifically to do with the STM3210E-EVAL board - doesn't it?
So: * Do the STM3210E-EVAL board schematics give any clue? * Is there anything in the STM3210E-EVAL board's User Guide about this?2011-09-09 03:03 AM
> The fact that it's conditional on a flag called USE_STM3210E_EVAL suggests that it's
> something specifically to do with the STM3210E-EVAL board - doesn't it? sure. > * Do the STM3210E-EVAL board schematics give any clue? No, the temperature sensor is connected to PB5 (INT), PB6 (SCL) and PB7 (SDA). I don't see how this interferes with the FSMC > * Is there anything in the STM3210E-EVAL board's User Guide about this? Nothing. Regards Dirk2011-09-09 07:20 AM
No, the temperature sensor is connected to PB5 (INT), PB6 (SCL) and PB7 (SDA). I don't see how this interferes with the FSMC
PB7 = I2C1_SDA, FSMC_NADV, TIM4_CH2 (Remap:USART1_TX) Is this sufficiently illuminating?
2011-09-12 05:38 AM
Thanks, yes. The FSMC_NADV signal is not used on the eval board, but I think it es nevertheless driven as long as the FSMC clock is running.
NB: just found in the errata, that switching off the FSMC clock is a suggested workaround due the to conflict between I2C1 SDA and FSMC_NADV. This leads to another problem I have but this will be a new thread. Regards Dirk