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

MPPT using PIC16F877A

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



Joined: 23 Aug 2010
Posts: 3
Location: Banned for deleting his own posts

View user's profile Send private message

MPPT using PIC16F877A
PostPosted: Mon Aug 23, 2010 5:37 am     Reply with quote

Surprised

Last edited by Lee_831 on Tue Sep 14, 2010 12:11 pm; edited 1 time in total
pmuldoon



Joined: 26 Sep 2003
Posts: 218
Location: Northern Indiana

View user's profile Send private message

PostPosted: Mon Aug 23, 2010 8:17 am     Reply with quote

Can't explain the SIM thing, but just a comment:
You will be happier if you put the delay back in after switching AD channels.
Make sure the source impedance is <5K or so and delay for 10-20uS (micro, not milli) should be fine. You can go a bit tighter it just depends on your circuit - the rest is in the AD section of the Datasheet.
Ttelmah



Joined: 11 Mar 2010
Posts: 19327

View user's profile Send private message

PostPosted: Mon Aug 23, 2010 8:41 am     Reply with quote

Also note that your pwm values, _must_ be passed to the set_pwm function, as _long_ integers, not 8bit values.

set_pwm1_duty((int16) pwm);

Otherwise your PWM range is only 0-13, not 0-49....

Best Wishes
Lee_831



Joined: 23 Aug 2010
Posts: 3
Location: Banned for deleting his own posts

View user's profile Send private message

PostPosted: Mon Aug 23, 2010 12:21 pm     Reply with quote

Confused

Last edited by Lee_831 on Tue Sep 14, 2010 12:12 pm; edited 1 time in total
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Aug 23, 2010 12:56 pm     Reply with quote

See this thread for links about invoking 10-bit PWM mode:
http://www.ccsinfo.com/forum/viewtopic.php?t=17729&start=12
Lee_831



Joined: 23 Aug 2010
Posts: 3
Location: Banned for deleting his own posts

View user's profile Send private message

PostPosted: Mon Aug 23, 2010 1:18 pm     Reply with quote

Arrow

Last edited by Lee_831 on Tue Sep 14, 2010 12:12 pm; edited 1 time in total
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Aug 23, 2010 2:38 pm     Reply with quote

The 'L' is for a constant. You're passing a variable, so casting it to a int16
is the correct way. The way that you posted is correct.
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