Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PWm using 12F675

Status
Not open for further replies.

Divs

New Member
hi guys... i've read a lottt of posts on this site and its awesome!

i have a slight problem however.. i need to generate a PWM with 1KHz constant frequency and a duty cycle varying from 5-95% using a PIC12F675..

i cannot use a 12F683.. :(.. however i did try this using 555. although the duty cycle varies as desired, the frequency does too... any ideas on this would be welcome too...

i dont want a program.. please give me some suggestion on how to go abt it.. i'm new to PIc's and so far all i've done is flash an LED..

thanx in advance.. hoping something would come up..? :)
 
What kind of resolution do you want for your duty cycle? You stated a range of 5-95% but do you want to increment by 1%, 5%, 0.5%, etc.? If the resolution isn't too small, you can use Timer 0 and interrupts to free your PIC up for other processing.

It's too bad that you can't use the 12F683. Ignoring the fact that it has a PWM generator, it also has Timer 2 which has a period register and its internal oscillator can run at 8MHz giving you better resolution if you choose to implement a software PWM setup.
 
hey! thanx so much for your reply...
a 0.5% resolution should do nicely i guess.. i know, but then my boss says no to 12F683.. or any IC which has a CCP module.. so here i am, struggling, cuz all i've managed to learn so far in assembly language programming is to blink an LED.. :confused:
i've started writing a code tho.. just trial and error, will post it here and someone could lead me on from there...
 
Divs said:
hey! thanx so much for your reply...
a 0.5% resolution should do nicely i guess.. i know, but then my boss says no to 12F683.. or any IC which has a CCP module.. so here i am, struggling, cuz all i've managed to learn so far in assembly language programming is to blink an LED.

Blinking an LED is PWM - you just need to blink it faster!.
 
Divs said:
my boss says no to 12F683.. or any IC which has a CCP module..

why would he say that ? is he deliberatley trying to make this as difficult as possible ?:confused:
 
Sounds more like a school project!
Or his boss is really cheap and won't spring for an extra 5 cents for the 12F675. It could also be that the company already stocks the 12F675 and wants to minimize inventory. But most likely a school project, since their "engineer" is only flashing LEDs so far. :D
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top