|
|
View previous topic :: View next topic |
Author |
Message |
ferrumvir
Joined: 01 Feb 2006 Posts: 64 Location: England
|
Additional PWM control |
Posted: Mon Apr 10, 2006 3:51 pm |
|
|
Hi,
I'm using a CAN enabled PIC, one of the PIC18Fxx8(x) series chips to interface with a CAN network (think I've just stated the obvious)
The 28 pin chips only have one CCP module and the 40 pin chips have two. Unfortunately for my application I require 1 CCP and 2 PWM outputs (which are on the CCP pins).
I was wondering what the options for expanding the PWM channels were and which were best/simplest?
These are the options I think I have.
1. To use DS1050-xxx, which are 5bit PWM outputs controlled through a two wire interface (I2C effectively), however these power up to 50% duty cycle and therefore I would require a relay to prevent power flow during this period. This is the only digital interface PWM chip I could find.
2. To use a second PIC (something like the PIC16F636, 14pins 2 CCP modules) and program it as I2C slave, giving me the 2 additonal PWM outputs I require.
3. Bit Bang a standard pin (a software PWM), which I suspect will be less than accurate and certainly will not be an elegant solution.
Are there any options I'm over looking?
Are there other chips similar to the DS1050, which my search has missed?
Thanks for your help
Cheers Scott |
|
|
kender
Joined: 09 Aug 2004 Posts: 768 Location: Silicon Valley
|
Re: Additional PWM control |
Posted: Mon Apr 10, 2006 4:06 pm |
|
|
ferrumvir wrote: |
3. Bit Bang a standard pin (a software PWM), which I suspect will be less than accurate and certainly will not be an elegant solution.
Are there any options I'm over looking?
|
4. There is another option similar to your #3. You can generate PWM with the timer ISR. This method is nearly as accurate as PIC's hardware PWM. But the PWM frequency has to be relatively low, otherwise you might overwhelm the PIC. The interesting feature of this method is that computational expense of having several PWM outputs is close to that of just one PWM output.
What's your desired:
... PWM frequency?
... frequenc6y accuracy (offset and dither)?
... duty cycle resolution? |
|
|
ferrumvir
Joined: 01 Feb 2006 Posts: 64 Location: England
|
|
Posted: Tue Apr 11, 2006 12:04 am |
|
|
Hi,
The frequency of the manual controller we're using is 25KHz, and I was intending to duplicate this, though I suspect a slower PWM would probably not cause the motors a problem.
The PWM frequency accuracy is an not an issue for this applicaton, power flow controller to a motor.
Idealy I'd like 1% resolution, the minimum we'd accept would be 10% (4bit).
I'll have a look into the ISR Timer, am I correct in thinking that this just using the Timer0 interupt, and then setting the timer with a number corresponding to delay to the next switch (up or down)?
Cheers Scott |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|