Foreword:
In the new year, Lichuang has started holding activities again, based on the development and design of Renesas RA-MCU.
The effect is shown in the picture, including USB power supply, serial port download, J-LINK debugging interface, touch button, touch button and LED driver.
The MCU used this time is R7FA2E1A72DFL.
After reading the chip manual, I found that it comes with RTC function, so I simply made a 4-digit time alarm clock.
Figure 1: Overall renderings
Plan ideas:
1Decomposition of hardware ideas :
a) Power supply: USB power supply is used, which is convenient, simple and easy to implement. Compared with the past, this time I tried to use the type-c interface.
As shown in the picture:
b) Download: USB to serial port standard configuration, refer to previous project-CH340 design
c) Debugging: jlink interface, including VCC, gnd, swdio and swclk
d) Mode: The RA chip has higher performance than the ordinary 51 and supports many functions, so downloading requires hardware switching mode.
As shown in the picture:
When we download, we just need to select 1-3 to connect. When running, pull out the short circuit and reset it to run.
e) Reset: Use the touch button and connect to Pin20 of mcu
f ) Buzzer: Just choose an active 5V buzzer, and the driver circuit simply uses a current-limiting resistor.
As shown in the picture:
g) Display and driver: LED dot matrix, plus 1640 driver, a simple iic driver can handle it.
2 Software idea decomposition :
a) Documents: as shown in the figure
rtc.c and .h contain related operating functions of the real-time clock
1640.c and .h display related definitions and functions
uart. and .h simple serial port printing
Main function large loop: refresh the display every 500ms.
b) Time accumulation: After turning on the interrupt, the seconds are superimposed once per second, and then the time is in base 60 and base 24.
c) Display: The 1640 driver uses the GPIO analog IIC method, which is simple to implement. After writing, the LED dot matrix can display the numbers you want.
d) Usage of serial port: After configuring according to the Getting Started Guide in the attachment, modify it to channel 9, and you can get the serial port with the same IO as the download. After downloading, open the serial port assistant to print the serial port information.
3 Shell and face patch :
a) Lichuang EDA Professional Edition supports shell design, which is also very powerful. The LED dot matrix adopted this time involves complex operations such as segmentation, so the housing design needs to be flexible and changeable. Drawing with SW is necessary.
b) Face mask design: It is also a function of the professional version, so in addition to this project, there is also a professional version project.
--Attached-- tutorial link
Show results:
Runtime:
Precautions:
Unimplemented features:
a) Although the rtc peripheral is started, the reading function // R_RTC_CalendarTimeGet(&g_rtc0_ctrl, &get_time); // gets the RTC count time . The number of seconds read is indeed superimposed every 40 seconds, so the alarm clock cannot be implemented.
b) After trying the jlink link N times, it still reported an error and could not connect, so the touch experiment had to be abandoned.
Difficulties to be solved:
a) For the configuration of peripheral rtc, according to the manual, the accurate second time cannot be obtained.
b) When installing and using the e2 software, the menu bar of the setup_fsp_v3_6_0_e2s_v2022-01 version will disappear the next day.
Next revision:
a) The light shielding of the surface sticker is not ideal, and the printing shell is severely light-transmitted.
I hope that friends will pay more attention to these problems when they want to try it. At the same time, you are also welcome to discuss solutions with me.
All reference designs on this site are sourced from major semiconductor manufacturers or collected online for learning and research. The copyright belongs to the semiconductor manufacturer or the original author. If you believe that the reference design of this site infringes upon your relevant rights and interests, please send us a rights notice. As a neutral platform service provider, we will take measures to delete the relevant content in accordance with relevant laws after receiving the relevant notice from the rights holder. Please send relevant notifications to email: bbs_service@eeworld.com.cn.
It is your responsibility to test the circuit yourself and determine its suitability for you. EEWorld will not be liable for direct, indirect, special, incidental, consequential or punitive damages arising from any cause or anything connected to any reference design used.
Supported by EEWorld Datasheet