Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

pwm generation using pic

Status
Not open for further replies.

Prashu

Newbie level 2
Joined
May 21, 2008
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,294
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
 
Hi
i think these are the library functions specific to a compiler ,u can not use them unless u have the same compiler
Shakeel
 

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.

regards
 

thnks 2 all who replied i am not using C ..me using assembly language programming
 

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!
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top