;------------------------------------------------------------------------------
; User preferences
;------------------------------------------------------------------------------
I want to use the UART1 ...
And I use on my dsPIC Peripheral Pin Select Registers ....
;RPINR18bits.U1RXR = 10; //U1RX RB10/RP10
;RPOR5bits.RP11R = 3; //U1TX RB11 (=3 veut dire fonction TX)
we must use USE_ALTIO?
Hi,
You will need to add code to configure PLL. You can do that in this section in ds30loader.s:
Code:
;------------------------------------------------------------------------------
; User specific entry code go here, see also user exit code section at end of file
;------------------------------------------------------------------------------
You also need to modify the PPS template in ds30loader.s
Finally you need to configure the configuration bits.
If haven't done so already, read the manuals.
From the manual
Quote:USE_ALTIO
Uncomment to use alternative I/O for UART1. This setting is only valid for dsPIC30F devices.
More information about the BRGH settings is available in the device datasheet.
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
;------------------------------------------------------------------------------
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
2011-11-14, 23:15:14 (This post was last modified: 2011-11-14, 23:15:53 by Mikael Gustavsson.)
The ds30 Loader free edition firmware is written in assembler. Your configuration code also need to be written in assembler.
You can read the other code and the Microchip documentation to understand how it is done.
Well received ... Now I understand better now ... I could try again in several weeks ... I repost here if I go into the configuration ... thank you again ...
2012-04-28, 17:25:34 (This post was last modified: 2012-04-29, 18:20:17 by Mgros.)
Well thank you ca still does not work but I continued to search ...
And here's the code ... thank you to soon
edit:
The part below is for she parameterize dsPIC33? or is it just you setting pins by UART / CAN "PPS" configuration
Code:
. USE_TXENABLE equiv, 1; xxx uncomment to use a tx enable pin
. ifdef USE_TXENABLE
. equ TXE_DELAY, 10; xxx us in time to WAIT BEFORE Transmitting After pulling the enable pin high tx
. equiv TRISR_TXE, TRISA; xxx Containing Tris tx enable register
. equiv LATR_TXE, LATA; xxx harbor Containing tx enable register
. equiv TRISB_TXE, TRISA1; xxx bit for tx enable sorting
. equiv LATB_TXE, RA1, xxx Port enable bit for tx
. endif
2012-04-29, 21:50:54 (This post was last modified: 2012-04-29, 23:06:57 by Mgros.)
I tried with firmware ds30_Loader_120325 ...
Now the detection of PIC with the GUI is ...
The transfer seems to be too ...
Code:
Initiating write ...
Searching for bl. . . . . . .
Found dsPIC33FJ128MC802 fw ver. 4.0.3
Waiting for bootloader ... ok To Be Ready
Hex file successfully parsed
Writing flash .... ok
20.2 kB Tx / Rx 121 bytes / s 31.3
Write Successfully Completed
The program I have loaded does not execute correctly ..
I have the "interrupt" of my TIMER1 that does not execute when my TIMER 2 and 3 apparently no problem...
for example I can blink an LED ...
For information I use mikroC compiler ...
2012-05-07, 23:06:46 (This post was last modified: 2012-05-07, 23:12:36 by Mgros.)
Well the timer1 does not work ... but others 2,3,4 and 5 is good ...
So I post my code if it can help someone ...
For information I use a 10Mhz crystal and the bootloader for UART1 on pins RB10 (RX) and RB11 (TX) ...
Thank you again for this really effective bootloader @ +