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

Generated PWM

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



Joined: 01 Apr 2012
Posts: 5
Location: Malaysia

View user's profile Send private message AIM Address

Generated PWM
PostPosted: Thu Jun 07, 2012 11:41 am     Reply with quote

Hi,
I am using PIC16F877 to generate PWM signal. I found that the generated signal is having Vmax=2.40V and Vmin=-2.56V . The waveform as shown as image below:


Is this normal? As i know, the PWM signal should be from 0V to 5V. But the generated PWM is from -2.56V to 2.40V.

I am using the following code:
Code:
#include <16F877.h>
#fuses HS, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP
#use delay(clock = 20000000)

main()
{
output_low(PIN_C1);   // Set CCP2 output low
output_low(PIN_C2);   // Set CCP1 output low

setup_ccp1(CCP_PWM);  // Configure CCP1 as a PWM
setup_ccp2(CCP_PWM);  // Configure CCP2 as a PWM

setup_timer_2(T2_DIV_BY_16, 124, 1);  // 500 Hz     
set_pwm1_duty(31);                    // 25% duty cycle on pin C2
set_pwm2_duty(62);                    // 50% duty cycle on pin C1

while(1);
}


I am using this generated PWM signal for L298 to control my peltier. Voltage supply is 12V. When i supply 90% duty cycle to L298, the output voltage that i measured for peltier is only equal to 7.8V. I am wondering whether this generated PWM is the factor or not.
Thanks
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Jun 07, 2012 12:18 pm     Reply with quote

You have the scope in AC input coupling mode. Push the AC/DC button
and put it in DC mode. Keep it there.
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