Hi everyone. I'm using STR912FAW44X6. I need to initial Output Compare for buzzer. Please, check my code below:
TIM1->CR2 = 150; TIM1->OC1R = 5000; TIM1->CR1 = 1 << 10; // Set the FOLV1 TIM1->CR1 |= 1 << 8; // Set OLVL1 TIM1->CR1 |= 1 << 6; //Set OC1E TIM1->CR1 |= 1 << 15; //Enable Counter Init_Ports ( 3.7, Pin_Out_Alt3, 0 ); //Buzzer. Output Compare OC1
The frequency for timer is 96000000/8/8/150 = 10000Hz. The output function for pin is right. I can see the GPIO3->GPIOOUT[3] register, it's right for TIM1_OCMP1( pin 3.7 -> Out_Alt_3). On pin 3.7 is 3V everytime. What i need to add to my code? What is wrong?
If i'm using interrupt i can setup for 1 sec - it's working ( i send message throught UART).
The GPIO3 not in reset and clocked as well. I'm using pins P3.0 and P3.1 for UART0.