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

PIC18f1230/1330 power pwm examples needed

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



Joined: 17 Feb 2009
Posts: 1
Location: POWYS

View user's profile Send private message

PIC18f1230/1330 power pwm examples needed
PostPosted: Fri Feb 20, 2009 8:05 am     Reply with quote

Hi
Can anyone help?

I am searching for any examples of CCS code related to setting up and using the power PWM feature in the PIC 18f1230/1330 devices.

I am beginning to think that I am the only person in the universe using (trying to) this device!
_________________
Dave Cairns
Ttelmah
Guest







PostPosted: Fri Feb 20, 2009 10:30 am     Reply with quote

Most of the stuff, is common to any chip with the ECCP.
So setup for example, as:
Code:
setup_timer_2(T2_DIV_BY_16,207,1);
 setup_ccp1(CCP_PWM_HALF_BRIDGE|CCP_SHUTDOWN_AC_L|CCP_SHUTDOWN_BD_L|CCP_PWM_H_H);

set_pwm1_duty(416L); //Should be 50% duty cycle

Gives half bridge operation, with 50:50 mark space.
However the one thing that seems to be missing from the compilers I have tried, is the dead time configuration. I just set this directly, with:
Code:
#byte PWM1CON = 0xFB7 
PWM1CON=0x81;   

For one cycle of deadband delay.

You are not alone in controlling this chip, but the other people have just looked at examples for other ECCP's, and the listing file, and then set whatever else they need by going DIY.

It'd 'help' if you said what you actually want to configure the PWM to do?.

Best Wishes
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