2555 views|6 replies

1453

Posts

1

Resources
The OP
 

【CH579M-R1】+ PWM breathing light [Copy link]

 

In the example, the effect of PWM regulation is hard to see if it is not observed on an oscilloscope, so the only way to make the effect more obvious is to modify the program. In addition, since the output of PWM is not connected to the corresponding LED, an external LED light is needed to solve the problem.

I looked through all the small modules I had, but couldn't find one that worked for me. So I had to use a DHT11 module that didn't work very well. Since it has a power indicator light, I let it act as an LED, and the power supply is provided by the PWM output.

The PWM channel used for the test is PWM7, which is the PB1 pin.

The main program for the test is as follows:

int main()
{
 char i;
 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_PWM7, 64*i/64, Low_Level, ENABLE);
              mDelaymS(500);
  }

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

The display effect after downloading is a breathing light effect that gradually dims and brightens, as shown in Figures 1 and 2.

Figure 1 Gradual brightening effect

Figure 2: Darkening effect

This post is from Domestic Chip Exchange

Latest reply

Breathing light, a must for lighting!   Details Published on 2020-9-10 19:25
 
 

101

Posts

0

Resources
2
 

Is it convenient to develop network and USB on this board? Can it develop and use these two functions at the same time?

This post is from Domestic Chip Exchange

Comments

Still need to be tested, preheat first.  Details Published on 2020-9-6 00:57
 
 
 

1453

Posts

1

Resources
3
 
ersha4877 posted on 2020-9-5 15:04 Is it convenient to develop network and USB on this board? Can it develop and use the two functions of network and USB at the same time?

Still need to be tested, preheat first.

This post is from Domestic Chip Exchange
 
 
 

931

Posts

3

Resources
4
 

There are idle LEDs on the board. The first pins on P7 and P9 are connected to LED3 and LED4 respectively, which can be connected with Dupont wires.

This post is from Domestic Chip Exchange

Comments

I didn't look at it carefully at the time and habitually thought it was a standard feature of the Ethernet interface. I only used it to light the lamp later.  Details Published on 2020-9-10 22:25
 
 
 

7422

Posts

2

Resources
5
 

Breathing light, a must for lighting!

This post is from Domestic Chip Exchange

Comments

At first, the LED was the first to be lit, which could be called a one-lamp wizard. Now PWM is not valuable anymore, so it should also be included in the ranks of one-lamp wizards!  Details Published on 2020-9-10 22:29
Personal signature

默认摸鱼,再摸鱼。2022、9、28

 
 
 

1453

Posts

1

Resources
6
 
hujj posted on 2020-9-10 17:16 There are idle LEDs on the board. LED3 and LED4 are connected to the first pins on P7 and P9 respectively. They can be connected with Dupont wires.

I didn't look at it carefully at the time and habitually thought it was a standard feature of the Ethernet interface. I only used it to light the lamp later.

This post is from Domestic Chip Exchange
 
 
 

1453

Posts

1

Resources
7
 
freebsder posted on 2020-9-10 19:25 Breathing light, a must for lighting!

At first, the LED was the first to be lit, which could be called a one-lamp wizard. Now PWM is not valuable anymore, so it should also be included in the ranks of one-lamp wizards!

This post is from Domestic Chip Exchange
 
 
 

Guess Your Favourite
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