Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 4

Experiment 8: Using RTC

 Set alarm @ 23:15:03 everyday


Algorithm:
Step 1: Create a new project in STM32CubeIDE.
Step 2: Refer the schematic and configure the CAN 1, CAN 2 module in IOC file.
i). For CAN 1,configure Strobe pin,Tx,Rx pins.
ii). For CAN 2,configure Strobe pin,Tx,Rx pins.
Step 3: set the baud rate for both the CAN which is available in parameter settings.
Step 4: Configure the LCD enabling pins(RS,EN,D0-D7).Configure BUZZER for alarm.
Step 5: Configure RTC & enable the Tamper pin for generating output.
Step 6: Generate the Code
Step 7: Define the TX header & Rx header variable.
Step 8: Make the CAN 1 & CAN 2 strobe pin as LOW.
Step 9: Load the values for structure elements in TX header
Step 10: Configure the Filter configuration & activate it by using API
Step 11: Start both the CAN module by using API.
Step 12: load the hour,min,sec,date,month,year values in the tx buffer
Step 13:Transmit datas through CAN 1 by using CAN Tx API.
Step 14: By using RTCSetTime API ,Set the received values.
Step 15: By using RTCGetTime get the hour,month,min,sec,date,year
Step 16: make the BUZZER ON when RTC values matches the alarm.
Step 16: Connect the CAN 1 & CAN 2 module by using CAN bus..
Step 17: Display the RTC datas in LCD.
OUTPUT

You might also like