I have bought very basic board with STM32F103C8T6 uC.
I am trying to make the icu to work w/o success.
The ICU seems not to start as the line is low after starting and enabling the ICU.
Very similar code works well on STM32F4 board.
Code: Select all
DHT_icucfg.mode = ICU_INPUT_ACTIVE_HIGH;
DHT_icucfg.frequency = DHT_ICU_FREQ;
DHT_icucfg.width_cb = DHT_icuwidthcb;
DHT_icucfg.period_cb = DHT_icuperiodcb;
DHT_icucfg.overflow_cb = NULL;
DHT_icucfg.channel = ICU_CHANNEL_1;
DHT1122_data data;
// REQUEST SAMPLE
palSetPadMode(GPIOB, 6, PAL_MODE_OUTPUT_OPENDRAIN);
palWritePad(GPIOB, 6, PAL_LOW);
chThdSleepMilliseconds(20);
palSetPadMode(GPIOB, 6, PAL_MODE_STM32_ALTERNATE_PUSHPULL);
icuStart(&ICUD4, &DHT_icucfg);
icuEnable(&ICUD4);
The code suppose to communicate with DHT22 sensor.
The B6 alternate function is default I2C1_SCL/TIM4_CH1.
I am not using I2C.
As I said before, the B6 line is low no matter to ICU_INPUT_ACTIVE_HIGH.
Should I do any splecial remaping or sth.?
Thanks in advance.
Greetings
Piotr Klimczak