2340 views|1 replies

24

Posts

2

Resources
The OP
 

[Silicon Labs BG22-EK4108A Bluetooth Development Evaluation] 2. Hardware Testing: Lighting and Code Explanation [Copy link]

 This post was last edited by lang518899 on 2022-1-10 21:23

Silicon Labs BG22-EK4108A was tested with hardware, buttons and LED lights. Since the soc_blinky project always crashes during debugging and the cause of the debug problem is not found, I will develop another one later. Here I mainly test the blink_pwm_baremetal project to achieve the breathing light effect.

1. First, according to the SDK example, select the new key project, the new project wizard pops up, select Platform, and then select Platform_Blink PWM.

2. In the pop-up project creation naming window, configure the project name, path, etc., as shown in the figure below

3. After creation, click the hammer icon to start compiling. After compilation, it will be as shown in the figure below.

4. Click the Beetle logo to start debugging. Before debugging, the firmware will be downloaded to the MCU first, as shown in the figure below.

5. Click Run and then power on again, you can see the LED light flashing with a breathing effect.

f795d5634f45c8b961c2faccd6ad43d7.mp4 (783.07 KB, downloads: 6)



6. The following is a code description. Open main.c and check the code entry function. As shown in the figure below, you can see the initialization of the underlying hardware, APP, and the PWM adjustment function to change the brightness of the light in the main loop.

7. In the system bottom hardware initialization function, the following functions are called. Here you can see the parameter configuration for initializing PWM.

8. The PWM parameter configuration function is shown in the figure below. The frequency and polarity can be changed manually.

9. In the initialization APP function, you can see the start PWM function. Call this function to start PWM output.

10. In the main loop, PWM automatically adjusts the light intensity, as shown in the figure below. The PWM cycle is changed every 6ms, gradually changing from dark to bright, and then from bright to dark, thus achieving the breathing light effect.

11.

微信图片_20220110211816.png (49.12 KB, downloads: 0)

微信图片_20220110211816.png

Latest reply

It would be even better if you post a picture or video of the breathing light effect   Details Published on 2022-1-10 22:22
 
 

6593

Posts

0

Resources
2
 

It would be even better if you post a picture or video of the breathing light effect

 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list