CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Additional PWM control

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
ferrumvir



Joined: 01 Feb 2006
Posts: 64
Location: England

View user's profile Send private message Visit poster's website

Additional PWM control
PostPosted: Mon Apr 10, 2006 3:51 pm     Reply with quote

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? Question
Are there other chips similar to the DS1050, which my search has missed? Question

Thanks for your help

Cheers Scott
kender



Joined: 09 Aug 2004
Posts: 768
Location: Silicon Valley

View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger

Re: Additional PWM control
PostPosted: Mon Apr 10, 2006 4:06 pm     Reply with quote

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? Question


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

View user's profile Send private message Visit poster's website

PostPosted: Tue Apr 11, 2006 12:04 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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