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

PIC24F16KA301: Output Compare with Trigger Mode
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
andresteff



Joined: 21 Mar 2020
Posts: 36

View user's profile Send private message

PostPosted: Thu Mar 03, 2022 1:17 pm     Reply with quote

temtronic wrote:
humour me..don't use that PIC, but curios..
.
I don't use MCC so how did...

.................... // OC2 = OFF (config with MCC) WORKS!!! OC2 PIN=low
.................... OC2CON1 = 0x1C08; // OCM Off; OCFLT1 disabled; OCTSEL FOSC/2; TRIGMODE Hardware or Software; and MORE...
023C: MOV #1C08,W4
023E: MOV W4,19A
.................... OC2CON2 = 0x8099; // SYNCSEL CMP2; TRIGSTAT disabled; OCTRIG Trigger; and MORE...
0240: MOV #8099,W4
0242: MOV W4,19C

MCC decide OSCON1=0x1c08 ??

I have a feeling MCC 'defaults' are not the same as CCS 'defaults'.
If they were, the assembler would be identical ??




The ccs compiler is missing an entry.
If you operate the OCx module in trigger mode, you can choose between "Hardware or Software" or "only software" in the trigger source mode. So the deletion of the trigstat bit.

You can select this in the MCC.
In the ccs there is only the command "#define COMPARE_TRIGGER 0x00800000".
temtronic



Joined: 01 Jul 2010
Posts: 8525
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Thu Mar 03, 2022 2:06 pm     Reply with quote

Contact CCS, show them this, 2-3 updates from now, it'll be fixed...
andresteff



Joined: 21 Mar 2020
Posts: 36

View user's profile Send private message

PostPosted: Thu Mar 03, 2022 2:46 pm     Reply with quote

will be the best...
Ttelmah



Joined: 11 Mar 2010
Posts: 18072

View user's profile Send private message

PostPosted: Fri Mar 04, 2022 2:36 am     Reply with quote

This is wrong.
Key is he is using a very old compiler (5.080). The current version has over
twenty different settings for the trigger source. He needs to update, or just
code the functions himself. He has the bit patterns for each register, so
don't use the CCS functions at all, and just write these in.
5.080, is a four year old compiler.
Alternatively just generate your own define for the pattern wanted.
Understand all the CCS defines like this are just the bit patterns to put into
the registers. So (for example), 'COMPARE_SYSTEM_CLOCK' is
just 0x1C00. You OR these together to get the actual pattern you want.
He is manually setting the registers, but then insists on using one CCS
function. Why?. If you are manually coding then just do it all.
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