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

Help: CCP2 Problem

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



Joined: 08 Jul 2018
Posts: 3

View user's profile Send private message

Help: CCP2 Problem
PostPosted: Sun Jul 08, 2018 10:13 pm     Reply with quote

HI, i am new member. Sorry but my English is not good.
Now i am controlling driver motor with 2 status:
1. CW: Pin C1: H; Pin B3: PWM
2. CCW: Pin C1: PWM, Pin B3: H
ps: ccp1 i used to another motor,
I read datasheet, CCP2 can output as C1 or B3 if change bit CCP2MX (0c300005), but in CCS, i cant change it.
I used "#Fuse CCP2C1" or "#Fuse CCP2B3". But i cant change it again in main program.
So, What should i do now?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Jul 08, 2018 10:15 pm     Reply with quote

1. What is your PIC ?

2. Are you using a bootloader ?
Totice4



Joined: 08 Jul 2018
Posts: 3

View user's profile Send private message

PostPosted: Sun Jul 08, 2018 10:18 pm     Reply with quote

PCM programmer wrote:
1. What is your PIC ?

2. Are you using a bootloader ?

Sorry, my pic is 18F46k20,
i did not use bootloader
Ttelmah



Joined: 11 Mar 2010
Posts: 19515

View user's profile Send private message

PostPosted: Mon Jul 09, 2018 12:17 am     Reply with quote

Unfortunately, you are misunderstanding the data sheet.

Not a CCS limitation, but a limitation of the chip. CCP2 can be moved to C1 or B3, but only as a chip configuration change (fuse), not as a 'program' (runtime) change.

The ECCP (CCP1), can be software configured to give outputs on the P1A, B, C or D pins in software. Use these pins instead if you want a steerable PWM.

You can't go changing fuses at runtime. First the processor has to stop while a fuse is written, and second they have a limited life for changes. You'll kill the chip if this is done every time you change the motor direction..... Sad
Totice4



Joined: 08 Jul 2018
Posts: 3

View user's profile Send private message

PostPosted: Mon Jul 09, 2018 2:53 am     Reply with quote

Ttelmah wrote:
Unfortunately, you are misunderstanding the data sheet.

Not a CCS limitation, but a limitation of the chip. CCP2 can be moved to C1 or B3, but only as a chip configuration change (fuse), not as a 'program' (runtime) change.

The ECCP (CCP1), can be software configured to give outputs on the P1A, B, C or D pins in software. Use these pins instead if you want a steerable PWM.

You can't go changing fuses at runtime. First the processor has to stop while a fuse is written, and second they have a limited life for changes. You'll kill the chip if this is done every time you change the motor direction..... Sad

thanks for reply. It is the best answer for me.
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