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

PWM AND REVERSE

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



Joined: 19 Jun 2015
Posts: 21
Location: Banned - Spammer

View user's profile Send private message

PWM AND REVERSE
PostPosted: Tue Aug 31, 2021 6:42 am     Reply with quote

Hi
Anybody can create a pwm and reversed pwm also with 18f4580 chip
one time runs ones not a same time same pwm and reversed pwm.
Sorry for bad english.
Code:

   //ECCP1CON     EPWM1M1 EPWM1M0 EDC1B1 EDC1B0 - ECCP1M3 ECCP1M2 ECCP1M1 ECCP1M0
   ECCP1CON = 0x51;     //  0x51 Enable Pulse Steering on P1C(RC3)
   ECCP1DEL = 0x80;
   //ECCP1AS = 0x00;
   CCP1CON = 0x00;
   CCPR1L  = 0x0C;


void yon_ver(int8 yonun){
   if (yonun == 2){       
     // setup_ccp1(CCP_PWM|CCP_PULSE_STEERING_SYNC|CCP_PULSE_STEERING_A);
      setup_ccp1(CCP_PWM | CCP_PWM_FULL_BRIDGE_REV);   
   }
   if (yonun == 4){
   // setup_ccp1(CCP_PWM|CCP_PULSE_STEERING_SYNC|CCP_PULSE_STEERING_B);
      setup_ccp1(CCP_PWM | CCP_PWM_FULL_BRIDGE);
   }
}

I load 18f45k80 program but did not worked.
Anybody can help me.
ta2eh
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Sep 01, 2021 11:08 am     Reply with quote

Here are some links with sample code for H-bridge motor control:
http://www.ccsinfo.com/forum/viewtopic.php?t=29565&start=1
http://www.ccsinfo.com/forum/viewtopic.php?t=45034
http://www.ccsinfo.com/forum/viewtopic.php?t=40467
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