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

Multiple PWM outputs

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








Multiple PWM outputs
PostPosted: Wed Nov 12, 2003 2:51 am     Reply with quote

Hello,

I need 4 PWM outputs and found that the 18F448 has 5.

How do I setup this use of 4 PWM's for 10 bit output ?

Are the duty cycle's independent of another ?

How do I set duty cycle for each PWM ?



Kind regards,

Gerrit
Ttelmah
Guest







Re: Multiple PWM outputs
PostPosted: Wed Nov 12, 2003 3:27 am     Reply with quote

Anonymous wrote:
Hello,

I need 4 PWM outputs and found that the 18F448 has 5.

How do I setup this use of 4 PWM's for 10 bit output ?

Are the duty cycle's independent of another ?

How do I set duty cycle for each PWM ?



Kind regards,

Gerrit

I'm afraid you can't.
Re-read the data sheet. The chip has one 'normal' CCP module, and one 'ECCP' module. The latter offers four outputs, _but_ the mode giving all four output pins, only allows two of them to be active at a time (this is designed for 'full bridge' power driving, where only two of the four driver transistors can be on at a time, or there is a risk of shorting the supply...). Basically, you can have three independant pulse widths from the chip, but not four.
To get four independant pulses, running at the same time, you will need to 'rethink' your hardware.

Best Wishes
dazlogan



Joined: 19 Oct 2003
Posts: 24
Location: Cambridge, UK

View user's profile Send private message Send e-mail

idea?
PostPosted: Sun Nov 16, 2003 3:17 pm     Reply with quote

couldn't you use a timer to control 4 pins high/low - the high/low times being controlled by a counter variable?

i.e. make your own PWM???

only trouble is, will this be accurate?

i guess the timer interrupt would need to be top priority.

regards,
darren
Guest








Re: idea?
PostPosted: Wed Jul 19, 2006 5:39 pm     Reply with quote

dazlogan wrote:
couldn't you use a timer to control 4 pins high/low - the high/low times being controlled by a counter variable?
i.e. make your own PWM???
only trouble is, will this be accurate?
i guess the timer interrupt would need to be top priority.
regards,
darren


You could....but running 4 of them at 20khz, your processor would pretty much have nothing left over to do anything other than PWM.
MGP



Joined: 11 Sep 2003
Posts: 57

View user's profile Send private message

PostPosted: Thu Jul 20, 2006 8:15 pm     Reply with quote

This is a little off-topic, but I wish Microchip would spiff up their peripheral mix a bit and add more hardware PWM channels to a few PICs, especially in the 18F family. I know they have added some features to the dsPIC and PIC24 family, but those PICs all require a whole new toolset and aren't pin compatible with the smaller PICs.

I've been doing a lot of MSP430 designs lately and the bigger MSP430's have some really excellent peripherals. For example, my last design used an MSP430F44x part that used 160 (4x40) LCD segments, 2 hardware UARTS, six 12-bit A/D channels and 6 hardware PWM channels (Timer B). It also used two CCP (input capture, Timer A) channels. If you are willing to give up a UART, you can get either hardware SPI or I2C. You can get all the same peripheral mix minus the LCD driver in the MSP430F14x family. There aren't ANY PICs that even come close to being able to do all that in hardware. TI has done a very good job, IMO, of picking the mix of peripherals to include on their parts.
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