• 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.

Generating PWM using PIC10F206(6 pin controller)

Ian Rogers

User Extraordinaire
Forum Supporter
Most Helpful Member
I have a software implementation for the pic 12's... As the pic10 has no interrupts if you are going to struggle... Plus what are you going to use to change the pulse width?? There are no adc ports...

What is the application..
 

ronsimpson

Well-Known Member
Most Helpful Member
What other jobs will the pic do while it is making the PWM signal?
There is very little room on the stack and only a very simple timer.
If there is only one job, to make 1khz at 10% then yes. Like NE555 IC can do.

The PIC12F1571 has stack=16 so you can do subroutines. AND it has 3 PWMs in hardware. You can start them and they run with out software help.
Hardware PWM

You might also look at the PIC12F320. Stack=8 and two PWMs.
 
Last edited:

Pommie

Well-Known Member
Most Helpful Member
i need a PWM signal having a frquecny of 1 khz with a duty of 10% ..Does this guy can do this job?
Yup, can do it with change. Delay 10mS, toggle pin, delay 90mS, toggle pin, rinse and repeat.

Mike.
BTW, if this is all it's got to do then the 10F200 can handle it.
 

Ian Rogers

User Extraordinaire
Forum Supporter
Most Helpful Member
i need a PWM signal having a frquecny of 1 khz with a duty of 10% ..Does this guy can do this job?
Then its simply a pulse out as Pommie said... The whole idea of PWM is it's adjustable...
 

ronsimpson

Well-Known Member
Most Helpful Member
Delay 10mS, toggle pin, delay 90mS,
The compiler I use; uses 100% of the CPU time to "delay". You might have to make a delay function that allows you to do another job. BUT With no/little stack it will be hard to do anything inside the 90mS delay. If the duty cycle varies it makes the timing harder.
 

alec_t

Well-Known Member
Most Helpful Member

Nigel Goodwin

Super Moderator
Most Helpful Member
True, but I don't think that was the point.... I still don't get the PWM reference.... As it has been said. 555 will do the job...
The term PWM is often misused :D

However, as for a 555 - a PIC would do this better, and with many less components - and particularly small as the PIC is only 6 pin.

I wouldn't consider using one though, I'd just use a much higher spec 8 pin one instead - the 12F1840 is my 8 pin of choice.
 

Ian Rogers

User Extraordinaire
Forum Supporter
Most Helpful Member
the 12F1840 is my 8 pin of choice.
Mine too.... Wonderous little device... In fact I used one upside down to replace a 555 in the field once... Worked like a dream...
 

mpgMike

New Member
The PIC10F320_2 can be had in a 6-Pin SMT (SOT) configuration. It is remarkable for what it is, far surpassing the PIC10F2XX offerings. Plus the 320_2 has ADC. What input or trigger would you use to determine the desired PWM DC%?
 

alec_t

Well-Known Member
Most Helpful Member
According to Microchip one of that chip's features is "a PWM with a fixed 50% duty cycle and an increased frequency resolution function". How can it be PWM if the duty cycle is fixed? o_O I call that misleading if the only variable is the frequency.
 

Pommie

Well-Known Member
Most Helpful Member
According to Microchip one of that chip's features is "a PWM with a fixed 50% duty cycle and an increased frequency resolution function". How can it be PWM if the duty cycle is fixed? o_O I call that misleading if the only variable is the frequency.
Looking at the datasheet, it appears to have 2 fully functioning PWM modules. Are you referring to the Numerically Controlled Oscillator as this has a fixed duty cycle mode. Very powerful chip for the size.

Mike.
 

alec_t

Well-Known Member
Most Helpful Member
Are you referring to the Numerically Controlled Oscillator
I haven't checked the details; I was just curious about the apparent contradiction in the introductory blurb.
 

alec_t

Well-Known Member
Most Helpful Member
It's clearly stated in the page 1 Summary of the post #14 link that the NCO has two functions, the first of which is (and I quote) "a PWM with a fixed 50% duty cycle".
 

Latest threads

EE World Online Articles

Loading

 
Top