Does anyone have a Flowcode example to share that would help us use the “Reference Clock Generation” block in the dsPIC33? Simply looking to direct the primary oscillator clock (labeled POSCCLK in the Oscillator System Diagram), to any RPn pin on the PIC33. Any help is appreciated!! We are using the BL00032 board for this test.
Thank you,
Karl Gross
Reference Clock Generation Example
-
- Posts: 11
- http://meble-kuchenne.info.pl
- Joined: Sat Dec 19, 2020 11:53 pm
- Been thanked: 1 time
-
- Matrix Staff
- Posts: 1912
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 496 times
- Been thanked: 674 times
Re: Reference Clock Generation Example
Hello Karl,
The following C code should hopefully configure the reference clock to be an output.
The following C code should hopefully configure the reference clock to be an output.
Code: Select all
TRISDbits.TRISD0 = 0; //Assign D0 to be an output
RPOR0bits.RP64R = 0x31; //Assign Reference clock (0x31) to RP64 - pin D0
REFOCONbits.ROON = 0; //Ensure Reference Clock is disabled.
REFOCON = 0x0700; //Setup Reference Clock - use system clock divided by 128.
REFOCONbits.ROON = 1; //Enable Reference Clock.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Re: Reference Clock Generation Example
Hi Ben,
Thank you for the code. It worked the first time out of the box. I want to Thank you for sharing your knowledge.
Thank you for the code. It worked the first time out of the box. I want to Thank you for sharing your knowledge.