|
|
View previous topic :: View next topic |
Author |
Message |
andresteff
Joined: 21 Mar 2020 Posts: 44
|
|
Posted: Thu Mar 03, 2022 1:17 pm |
|
|
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: 9377 Location: Greensville,Ontario
|
|
Posted: Thu Mar 03, 2022 2:06 pm |
|
|
Contact CCS, show them this, 2-3 updates from now, it'll be fixed... |
|
|
andresteff
Joined: 21 Mar 2020 Posts: 44
|
|
Posted: Thu Mar 03, 2022 2:46 pm |
|
|
will be the best... |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19655
|
|
Posted: Fri Mar 04, 2022 2:36 am |
|
|
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. |
|
|
|
|
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
|