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 CCS Technical Support

Dual channel software PWM at 10khz

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







Dual channel software PWM at 10khz
PostPosted: Mon Jan 24, 2005 3:14 pm     Reply with quote

HI all,

For my last project , I need to implement a software PWM that works at 10 khz (minimum 5Khz may be) , the duty cycles of PWM s has to be changed %0 to %99 independently. I will use each of the PWM signals to activate / deactivate 6 output ports of PIC C and D , each connected a 3 phase IGBT blocks to drive 2 different BLDC motors.

When I use TIMER 0 with DIVIDE BY 1 mode at 20 MHz , I should get around 10 Khz, yet the simulator PROTEUS VSM shows 500 Hz only.

Could any body help me to fix the problem , did somebody worked on a similar thing?

Thanks
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

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

PostPosted: Mon Jan 24, 2005 8:06 pm     Reply with quote

20MHz / 4 = 5MHz
5MHz / 256 = 19.5KHz

So timer0 will interrupt at a rate of 19.5KHz. Now if you are planning on a counter inside of timer0 interrupt and have 100 levels that will bring the frequency to about 195Hz. Maybe you are planning on just setting the timer value?? That probably isn't going to do it for you either.

What PIC are you using?
Mesut YIGIT
Guest







Soft PWM
PostPosted: Tue Jan 25, 2005 3:09 am     Reply with quote

I am using 16F877 at 20 mhz.
bluetooth



Joined: 08 Jan 2005
Posts: 74

View user's profile Send private message

PostPosted: Tue Jan 25, 2005 6:19 am     Reply with quote

You need to use the right chip for this requirement.

Look at the 18F2331, for example. It has an enhanced power control module (with the necessary 6 outputs) and support for commutation, whether you do this with position sensors or with the a/d. I don't see how you're going to be able to keep up with the commutation requirements with just an '877 (or any other regular PIC), especially with software PWM generation, and all this for TWO motors. The 2331 also has hardware fault support (great for preserving those expensive IGBT blocks), and has a quadrature encoder module.

I suggest you look at Microchip's AN885 and AN899 - they'll give you a lot of insight into these requirements.

Why not use two 18F2331's? A lot less work and much higher chance of success! Rolling Eyes

-- edited to fix AN889 -> AN899
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