2011-11-08, 23:46:15
Code:
So to configure the PLL I tried to write just after
;------------------------------------------------------------------------------
; User specific entry code go here, see also user exit code section at end of file
;------------------------------------------------------------------------------
CLKDIVbits.PLLPRE = 0;
PLLFBDbits.PLLDIV = 30;
CLKDIVbits.PLLPOST = 0;
and also
CLKDIV.PLLPRE = 0;
PLLFBD.PLLDIV = 30;
CLKDIV.PLLPOST = 0;
and also
CLKDIV = 0;
PLLFBD = 0x001E;
and also just after .ifdef HAS_PPS same as above
What is good writing?
for PPS I had configured like this:
U1RX -> RPINR18 -> RP10 = 10
RPINR18bits.U1RXR = 10; //U1RX RB10/RP10
RP11 on RPOR5 -> U1TX = 3
RPOR5bits.RP11R = 3; //U1TX RB11/RP11
For information ... This configuration will work for my current program
Code:
;----------------------------------------------------------------------
; UART/CAN pps config
;----------------------------------------------------------------------
.ifdef HAS_PPS
;.error "UART/CAN pps is not configured. Read datasheet and configure pps." ;xxx remove this line
; ** IMPORTANT **
;
; THIS CODE IS JUST A TEMPLATE AND WILL MOST LIKELY NOT WORK FOR YOU,
; READ THE DATASHEET AND ALTER LINES MARKED WITH XXX
;
; ** IMPORTANT **
; Backup, these are restored in exit code at end of file
; Changes needs to be done in exit, search for xxx
mov RPINR18, WPPSTEMP1 ;xxx
mov RPOR5, WPPSTEMP2 ;xxx
; Receive, map pin (14 = 1110) to uart
; 10 = 1010
bclr RPINR18, #U1RXR0 ;xxx 0
bset RPINR18, #U1RXR1 ;xxx 1
bclr RPINR18, #U1RXR2 ;xxx 0
bset RPINR18, #U1RXR3 ;xxx 1
bclr RPINR18, #U1RXR4 ;xxx 0
; Transmit, map uart to pin
; fonction U1TX = 3
bset RPOR5, #RP11R0 ;xxx 1
bset RPOR5, #RP11R1 ;xxx 1
bclr RPOR5, #RP11R2 ;xxx 0
bclr RPOR5, #RP11R3 ;xxx 0
bclr RPOR5, #RP11R4 ;xxx 0
.endif
…
exit:
.ifdef HAS_PPS
;.error "PPS restoration is not configured." ;xxx remove this line
mov WPPSTEMP1, RPINR18 ;xxx restore
mov WPPSTEMP2, RPOR5 ;xxx pps settings
.endif
Really thank you for the help @+