3533 views|12 replies

931

Posts

3

Resources
The OP
 

【CH579M-R1】+PWM breathing light and serial communication experiment [Copy link]

 
 

I originally planned to compile and download the manufacturer's BLE routine directly. I opened the peripheral project file according to the steps in the "Instruction Manual" and tried to compile but an error occurred. The main error was the lack of macro definition (as shown below). I couldn't find the macro definition file for a while and couldn't debug it, so I had to switch to other experiments.

First, I copied teacher jinglixixi's homework and tested the breathing light. I used LED3 and LED4 on the board directly, and drove them through PB0 and PB1. The following is the program code. At first, it ran with a delay of 500 milliseconds, but the breathing light changed too slowly. Later, I changed it to a delay of 50 milliseconds, and the effect was better:

int main()
{
char i;
GPIOB_ModeCfg(GPIO_Pin_0, GPIO_ModeOut_PP_5mA); // PB1 - PWM6
GPIOB_ModeCfg(GPIO_Pin_1, GPIO_ModeOut_PP_5mA); // PB1 - PWM7
PWMX_CLKCfg( 4 );
PWMX_CycleCfg( PWMX_Cycle_64 );
while(1)
{
for(i =0;i<64;i++)
{
PWMX_ACTOUT( CH_PWM6, 64*i/64, Low_Level, ENABLE);
PWMX_ACTOUT( CH_PWM7, 64*i/64, Low_Level, ENABLE);
mDelaymS(50);
}

for(i= 64;i>0;i--)
{
PWMX_ACTOUT( CH_PWM6, 64*i/64, Low_Level, ENABLE);
PWMX_ACTOUT( CH_PWM7, 64*i/64, Low_Level, ENABLE);
mDelaymS(50);
}
}
}

The compressed file of the video of the breathing light experiment is over 25M and cannot be uploaded. I will add the photos tomorrow.

After that, I experimented with serial communication. I used the UART1 project example provided by the manufacturer without any modification. I just used a TTF to USB module from Qinheng when debugging. The computer could recognize the serial port, but could not send or receive data. Later, I used a module bought from Taobao and the test was successful. Here are the test photos:

It is just that the power supply cannot be obtained through the TTF to USB module, and the development board needs to be powered separately. I used a power bank, but the download test is troublesome and requires changing the cable.

Below is a screenshot of the serial port debugging tool test:

This post is from Domestic Chip Exchange

Latest reply

Learned   Details Published on 2024-10-6 09:00
 
 

1w

Posts

204

Resources
From 12
 

Qinheng CH579M-R1 Development Board Review

Summary post: https://bbs.eeworld.com.cn/thread-1140005-1-1.html

This post is from Domestic Chip Exchange
Add and join groups EEWorld service account EEWorld subscription account Automotive development circle
Personal signature

玩板看这里:

https://bbs.eeworld.com.cn/elecplay.html

EEWorld测评频道众多好板等你来玩,还可以来频道许愿树许愿说说你想要玩的板子,我们都在努力为大家实现!

 
 
 

310

Posts

5

Resources
2
 

It seems that the header file is missing, typedef custom data type

This post is from Domestic Chip Exchange

Comments

It should be, but I don't know where this header file is.  Details Published on 2020-9-12 08:18
 
 
 

931

Posts

3

Resources
3
 
Song Yuanhao posted on 2020-9-11 22:28 It seems that the header file is missing, typedef custom data type

It should be, but I don't know where this header file is.

This post is from Domestic Chip Exchange
 
 
 

931

Posts

3

Resources
4
 

Here are some photos of the breathing light experiment:

This post is from Domestic Chip Exchange
 
 
 

1455

Posts

1

Resources
5
 

Not bad, like it!

This post is from Domestic Chip Exchange

Comments

Thank you for the compliment. This breathing light is copied from you.  Details Published on 2020-9-12 10:02
 
 
 

931

Posts

3

Resources
6
 

Thank you for the compliment. This breathing light is copied from you.

This post is from Domestic Chip Exchange

Comments

Not really, technology belongs to everyone, looking forward to new posts.  Details Published on 2020-9-12 18:04
 
 
 

1455

Posts

1

Resources
7
 
hujj posted on 2020-9-12 10:02 Thank you for the compliment. This breathing light is copied from you.

Not really, technology belongs to everyone, looking forward to new posts.

This post is from Domestic Chip Exchange
 
 
 

9717

Posts

24

Resources
8
 

Make a GIF to see the breathing light effect will be better

Recommend an open source gif conversion software ScreenToGif

This post is from Domestic Chip Exchange

Comments

Thanks for the recommendation, I am downloading and installing it. I have downloaded and installed several conversion software or online conversion before, but they either charge a fee or a huge watermark occupies the center of the picture, making it impossible to watch.  Details Published on 2020-9-12 21:13
Personal signature虾扯蛋,蛋扯虾,虾扯蛋扯虾
 
 
 

931

Posts

3

Resources
9
 
littleshrimp posted on 2020-9-12 20:56 It would be better to make a GIF to see the breathing light effect. I recommend an open source GIF conversion software ScreenToGif

Thanks for the recommendation, I am downloading and installing it. I have downloaded and installed several conversion software or online conversion before, but they either charge a fee or a huge watermark occupies the center of the picture, making it impossible to watch.

This post is from Domestic Chip Exchange
 
 
 

931

Posts

3

Resources
10
 

My first attempt to convert the mp4 format to gif format was successful, but the file size did not decrease much. The mp4 video file was more than 25M, and after the conversion it was still more than 24M. I will try again.

This post is from Domestic Chip Exchange

Comments

Can reduce resolution and frame rate  Details Published on 2020-9-12 22:14
 
 
 

9717

Posts

24

Resources
11
 
hujj posted on 2020-9-12 21:24 The first attempt to convert mp4 format to gif format was successful, but the file size did not decrease much. The mp4 video file is more than 25M, and the conversion...

Can reduce resolution and frame rate

This post is from Domestic Chip Exchange
Personal signature虾扯蛋,蛋扯虾,虾扯蛋扯虾
 
 
 

110

Posts

0

Resources
13
 

Learned

This post is from Domestic Chip Exchange
Personal signature欲穷千里目 更上一层楼
 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Related articles more>>

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