Requirements: Use PWM of PIC 16F887 to control 1 led. Let the frequency of the quartz capacitor be 20MHz. Given a PWM period of 0.8ms. Let's calculate the parameters and write a program to control the led light with level 1 equal to 1 tenth of the maximum brightness. Circuit diagram on Proteus simulation software: Figure 1. The control circuit changes the light intensity of the lamp using PWM Main program : File: main.c ___________________ #INCLUDE <16F887.H> #FUSES NOWDT,PUT,HS,NOPROTECT,NOLVP #USE DELAY(CLOCK=20M) UNSIGNED INT16 BIEN_TOC_DO; VOID MAIN() { SET_TRIS_C(0X00); SETUP_CCP1(CCP_PWM); SETUP_TIMER_2(T2_DIV_BY_16,249,1); BIEN_TOC_DO=500; SET_PWM1_DUTY(BIEN_TOC_DO); WHILE(TRUE){} } ___________________ Link download: https://drive.google.com/file/d/1bTFkDOBbnVMOfTfktRKmekfiYAq1Ipf6/view