STM32f103C8, framework Arduino
Wire.setSDA(pin) e Wire.setSCL(pin) are just to remape I2C1 (PB6,PB7 → PB8,PB9) but not I2C2 an I am not able to discover how use I2C2 (PB10,PB11).
The second question is haw to output TIM4_CH1 on PB6
It generate a pulse long TIM4_CCIR1 every TIM4_ARR
``
void setup() {
pinMode(PB6, PWM); // THIS IS WRONG
TIM4->CR1 = TIM_CR1_CEN |TIM_CR1_ARPE;
TIM4->CR2 = 0;
TIM4->SMCR = 0;
TIM4->DIER = 0;
TIM4->EGR = 0;
TIM4->CCMR1 = (0b110 << 4 ) | TIM_CCMR1_OC1PE;
TIM4->CCMR2 = 0;
TIM4->CCER = TIM_CCER_CC1E ;
TIM4->PSC = 71;
TIM4->ARR = 0x5000;
TIM4->DCR = 0;
TIM4->CCR1 = 1000;
}
t
With Arduino and Roger Clark’s board manager Pin mode(PB6, PWM) is OK and connecting timer to port
Hopping for an help