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

Problem with codes for MPPT
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Mar 28, 2007 5:51 pm     Reply with quote

Add the line shown in bold below to your program. Also add a #use rs232
statement, and a connection to the serial port on your PC (with a
MAX232-type chip).
Quote:

printf("pwm_value = %lu \n\r", pwm_value);
set_pwm1_duty(pwm_value);
delay_ms(1000);
} // end of while

Then watch the values that your program gives to the set_pwm1_duty()
function, as they are displayed in a terminal window on your PC.
This will help you to understand what the program is doing and help
you to debug it.


Also, try the PWM demo program shown in this post:
http://www.ccsinfo.com/forum/viewtopic.php?t=17729&start=1
This program should produce a PWM output. If it doesn't, you've
got other problems -- possibly with hardware or the compiler.
(Change the PIC, the #use delay() clock speed, and the oscillator
fuse to fit your hardware).
quium



Joined: 19 Jan 2007
Posts: 27

View user's profile Send private message

PostPosted: Thu Mar 29, 2007 10:16 am     Reply with quote

Hi
I have tested my circuit by giving an external PWM instead of generating a PWM from the PIC and the circuit was working fine.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Mar 29, 2007 11:21 am     Reply with quote

Quote:

I have tested my circuit by giving an external PWM instead of generating
a PWM from the PIC and the circuit was working fine.

But this thread isn't about the external circuits. You started the thread
by saying you had a problem with making the PIC generate PWM pulses.
Here is what you said:
Quote:

But the problem is I am not getting any PWM at ccp1.
Is there any problem with my codes


In my latest post, above, I suggested ways to trouble-shoot the
problem. I suggested that you display the PWM duty cycle value,
so you can see what duty cycle is being given to the CCS PWM
routines.

I also suggested that you use a simple test program (given in a link)
to see if your PIC can put out PWM pulses. This would confirm if
the PIC's CCP1 pin driver is working OK, and if the PIC is working OK,
and if the compiler is working OK.

I think I'm done with this thread. I don't think I can help any more.
quium



Joined: 19 Jan 2007
Posts: 27

View user's profile Send private message

PostPosted: Fri Mar 30, 2007 9:19 am     Reply with quote

Thanks PCM programmer for the help, I actually left the master clear pin not connected , So I was having problem in getting the pwm, Now I have corrected it and its working fine

Many Thanks
Quium
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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