aytwartoofyoroo

[Hangshun Training Camp] Direct plug-in LED kitchen electronic clock +272650A

 
Overview

Video has been updated.

LD has always wanted a kitchen clock, so let’s take advantage of the sailing event and make one! The project is a high-precision LED electronic clock based on HK32F030MF4P6. First of all, I would like to thank Jialichuang, Hangshun and Chuangxin Workshop for their support. Thank you Chuangxin Workshop for providing the PowerLink programmer. A programmer can solve programming and serial communication at the same time, which is very powerful. Higher-end offline burning products are suitable for mass production. You don’t have to worry about firmware leakage. It’s very good and powerful!

Product characteristics of this project

  • High-looking 0.8-inch white large-screen LED digital tube
  • Based on HK32F030MF4P6 microcontroller
  • RTC clock IC uses DS3231M
  • The countdown alarm function is suitable for kitchen use. The software is designed for kitchen countdown and does not design a fixed-point cycle alarm clock.
  • Switchable automatic light sensing
  • USB direct plug adapter, convenient to use on 86 box socket adapter, no need to connect USB cable

Note that the project has two branches: 1. RX-8025T branch 2. DS3231 branch

main chip

The main chip uses Hangshun HK32F030MF4P6, and the normal price is said to be within 1RMB. Of course, the global chip market is now bullish, and its price has also risen a bit. It can replace ST's STM8S003, Xintang's N76E003AT2 and other 8-bit Flash MCUs. The hardware pins are compatible and it is said to be the lowest price among M0 core MCUs. The HK32F030M series uses the ARM® CortexTM-M0 core, with a maximum operating frequency of 32MHz, and built-in 16K-Byte FLASH, 448-Byte EEPROM and 2-KByte SRAM. Through the register configuration of the FLASH controller, the interrupt vector can be remapped in the 16K-Byte space. All pins of HK32F030M except power and ground can be used as GPIO, peripheral IO or external interrupt input (TSSOP20 package product supports 16 GPIO); providing the maximum possible number of pin signals in application scenarios with limited pin count. Please note when using it, it does not support 5V.

image.png

Digital Tube

Using white high-value common anode digital tube

image.png

RTC

Using DS3231M with built-in MEMS, the accuracy is ±5ppm.

image.png

other

Designed with 3 side-mounted micro buttons to adjust the clock and countdown. Buzzer implements alarm prompt. Date adjustment and seconds adjustment are not involved, and the default number of seconds written each time is 0.

software

After several attempts, the RTT transplant failed, and it was finally decided to use bare metal to complete it.

The main business logic is completed using timers. I designed a total of four timers:

  1. The TIM2 hardware timer provides a benchmark to achieve microsecond and millisecond level delays.
  2. There are three software timers designed:
  • 1ms software timer provides key ticks benchmark
  • 300ms software timer is used to flash the display in setting mode
  • 1000ms software timer to read RTC update clock or countdown display
  1. The chip's built-in ADC is used to automatically adjust the brightness, and can always display at a constant maximum brightness. Switch anytime.
  2. The prompt sound uses a passive buzzer and also uses the built-in BEEP function of the chip.
  3. Reading RTC uses hardware I2C
  4. TM1637 communication uses software to simulate I2C
  5. The two libraries multi_button and multi_timer are used to complete the buttons and timers. Thanks to the original author for the excellent library.
  6. I originally planned to use RX8025T as the RTC, but I couldn't adjust it. Both hardware I2C and software I2C have been tried. The hardware I2C communication has no response, and the data returned by the software I2C is wrong! Maybe it’s because of the Taobao items I bought? Lichuang does not have this IC. I even bought a logic analyzer, but finally decided to give up! Next time you buy the genuine product, try it again.
  7. The countdown alarm supports a maximum of 99 minutes. When setting the countdown alarm, 1 to 10 minutes are in 1-minute increments, 10 to 30 minutes are in 5-minute increments, and 30 to 99 minutes are in 10-minute increments. Displays minutes/seconds during countdown. At the end of the countdown, the 00:00 bell prompt will be displayed until it exceeds a certain number of times or any key is pressed.
  8. Pitfalls I’ve stepped into:
  • If the serial port prints no output, it may be because the Use MicroLib option is not selected.
  • If the IO port of the ADC is AIN3, then Channel3 must be used accordingly.
  1. The official provides an excel table that can easily find the multiplexing function of each GPIO: image.png

Physical picture 1

First version: RX-8025T, failed! ! image.png Second edition: DS3231M, success! back: image.png

front: image.png

The digital tube lights up the screen:

QQ20210330-183024@2x_1.png

Can be plugged directly into the adapter of the 86 box QQ20210330-183417@2x.png

参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2024-11-22 12:12:46

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号