![]() | ![]() | ![]() |
| |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
![]() |
| | Tools |
| | #1 |
|
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..? | |
| |
| | #2 |
|
first obtain the delay code from piclist now define two variables N(on time) Set a Pin 1 (high) delay N us Set the Pin 0 delay 1000-N us loop vary N is you require
__________________ Gods own Country Incredible !ndia www.flickr.com/photos/_akg/ "Give a man a fish, and he will eat for a day. Teach that man to fish, and he will eat for a lifetime." | |
| |
| | #3 |
|
thanx a lot.. i'll try that way
| |
| |
| | #4 |
|
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. | |
| |
| | #5 |
|
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.. i've started writing a code tho.. just trial and error, will post it here and someone could lead me on from there... | |
| |
| | #6 | |
| Quote:
| ||
| |
| | #7 | |
| Quote:
| ||
| |
| | #8 | |
| Quote:
| ||
| |
| | #9 | |
| Quote:
__________________ Inside every little problem, is a big problem trying to get out. | ||
| |
| | #10 |
|
wow!!! how encouraging!!
| |
| |
|
| Tags |
| pwm |
| Thread Tools | |
| Display Modes | |
| |
Similar | ||||
| Title | Starter | Forum | Replies | Latest |
| A/D with pic 12f675 | ndspinney | Micro Controllers | 8 | 23rd December 2006 10:55 AM |
| 12F675 GPIO.3 help. | mramos1 | Micro Controllers | 8 | 5th September 2006 12:22 PM |
| Cannot read 12F675 with ICSP | dprischak | Micro Controllers | 4 | 1st June 2006 03:37 AM |
| 12F675 Problem | brodin | Micro Controllers | 10 | 29th December 2003 10:40 PM |
| 12F675 Calibration? | brodin | Micro Controllers | 7 | 25th December 2003 06:26 PM |