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

Pic18F46K22 PWM
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
NivNavick



Joined: 01 Nov 2010
Posts: 47

View user's profile Send private message

PostPosted: Sun Jan 30, 2011 1:01 pm     Reply with quote

When I programmed on the 18F4520 I had two methods,
I that return value from Ultra Sonic Ranger(SRF05) and the second return angle from CMPS03

from when I added the PWM bug fix those two methods aren't working any more, I think the pins are not changed to input and they are only outputs even I write SET_TRISA(0b000001);

What could be the problem?

Thanks!!
NivNavick



Joined: 01 Nov 2010
Posts: 47

View user's profile Send private message

PostPosted: Mon Jan 31, 2011 9:10 am     Reply with quote

Does anybody knows?
NivNavick



Joined: 01 Nov 2010
Posts: 47

View user's profile Send private message

PostPosted: Tue Feb 01, 2011 9:59 am     Reply with quote

hi

I have a month until my final project which I am working in it right now,
please answer
Smile
NivNavick



Joined: 01 Nov 2010
Posts: 47

View user's profile Send private message

PostPosted: Wed Feb 02, 2011 12:04 am     Reply with quote

I talked to CCS support and they told ne that
CCP3 registers aren't correct,
Is there anybody that know how to setup the
CCP3 registers and fix them?

Thanks
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Feb 02, 2011 12:55 am     Reply with quote

I showed you how to make a work-around routine for CCP2 in this post:
http://www.ccsinfo.com/forum/viewtopic.php?t=44564&start=8
Just do it the same way for CCP3.
Copy the #byte statements and change the register names so they
refer to CCP3 instead of CCP2. Look up the addresses of the CCP3
register in the PIC data sheet. Enter them into the new #byte
statements.

Make a copy of the "my_setup_ccp2()" routine and rename it for ccp3.
Edit the register names in the new function so they are the ones
associated with CCP3. Look up the default pin for CCP3 PWM output
in the PIC data sheet and edit the output_low() statement to use that pin.

Then in main(), call my_setup_ccp3(CCP_PWM) and set_pwm3_duty(128).
CCP3 also uses Timer2 by default, so the setup_timer_2() function will
work and can be left unchanged. The set_pwm3_duty() function
should also work without any changes.

It's really quite easy to make these changes, and they will probably work
if you're careful.
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