me doing a project on laser show using pic16f84 plz give a code to generate pwm using pic16f84 with optimal flowchat/algorithm used to control dc motor
Hi, now are you using assembly or C and other languages for writing program?
Added after 1 hours 13 minutes:
hi, there are three function for generating PWM using C code:
- setup_ccp1(CCP_PWM); // Configure CCP1 as a PWM
- setup_timer_2(T2_DIV_BY_1, 255, 1); //f =11Khz, XTAL = 12MHZ
- set_pwm1_duty(value);//value for time of duty cycle of pulse out
using 16f84 will require a lot of coding as it does not really has embeded the embede compare capture pwm register like 16f877(a) that has such a register
try and download the datasheet for the two components then u will get a view of what i am saying. in ur best use i6f877(A). But meanwhile i will try some coding 4 you.
Why don't you use 16F628A as 16F84 has been replaced by this one? It has in-built CCP module. Just set up the registers correctly and your job is done!