2016-09-20 05:43 PM
Hi dear all,
I am using STM32F070RB-T6 to control a buzzer for 10 sec beeps and a power ON press key in my circuit.
How to use RTC, DMA here in LSI mode?
Kindly share code and disscuss it.
Thanks in advance.
2016-09-21 01:54 AM
Hi hasan.md_mubdiul,
I suggest you to have a look to the RTC example under the STM32F0 cube firmware package:STM32Cube_FW_F0_V1.6.0\Projects\STM32F070RB-Nucleo\Examples\RTC\RTC_AlarmThis example guides you through the different configuration steps by mean of HAL API to ensure Alarm configuration and generation using the RTC peripheral.-Syrine-2016-09-22 01:05 AM
I went through this project file.
My application is different(may be for my ignorance).
At the beggining I am trying to press a power button, at the same 2 pin will be turn on alternatively, then buzzer and 7segment will reset.
I need to understand state machine, timer implementation, periferal clock distribution and other things.
Take a look this code,
void EXTI0_IRQHandler(void)
{ if(EXTI_GetITStatus(USER_BUTTON_EXTI_LINE) != RESET) else (db_count = 16) EXTI->PR = 0x00000200; else EXTI_ClearITPendingBit(EXTI_Line9 void main() { do { if(PORTC.PC5 == 0) //If the KEY_SW1 switch is pressed { Delay_ms(100); //Switch Debounce if(PORTC.PC5 == 0)//If the switch is still pressed { GPIO_ToggleBits ( GPIOB,TRIAC_CON1_Pin); PORTD.PD2 = 1; //LED7 ON LED7Toggle = 4000; //4 seconds Delay_ms(1000); //1 Second Delay PORTD.PD2 = 0; //LED OFF }} else {
PORTC.PC5 == 0; //If the KEY_SW1 switch is pressed /* set led on */ GPIO_SetBits( TRIAC_CON2_Pin); PORTD.PD2 = 1; //LED7 ON LED7Toggle = 4000; //4 seconds Delay_ms(1000); //1 Second Delay PORTD.PD2 = 0; //LED OFF } } }while(1); }