2011-12-19, 17:32:20
(This post was last modified: 2012-12-22, 14:07:46 by Mikael Gustavsson.)
Hi,
I'm testing with the above pic.
When I try to send the firmware from the GUI, the GUI at a randomly percentage send "time out" and stop working. Sometimes (very rarely) the GUI complete the downloading and the firmware work.
But I cannot reupdate.
The above information I think confim that the boot loader assembly firmware is configured ok but to better clarify I made these modifications:
In the file settings.inc
configurations fuses:
Also I modified the file ds30loader.s :
But the firmware does not work ever.
Also, very very strange, if I change the baudrate to 38400 in settings.inc the firmware does not work never...
I think there is some bug in the uart part or in the flash write part of the firmware for this dspic.
Thanks for any kind of support.
D
I'm testing with the above pic.
When I try to send the firmware from the GUI, the GUI at a randomly percentage send "time out" and stop working. Sometimes (very rarely) the GUI complete the downloading and the firmware work.
But I cannot reupdate.
The above information I think confim that the boot loader assembly firmware is configured ok but to better clarify I made these modifications:
In the file settings.inc
Code:
.equ __33FJ128GP804, 1
.equiv FCY, 10015000
.equiv USE_UART1, 1
.equiv BAUDRATE, 115200
.equiv USE_BRGH, 1
configurations fuses:
Code:
config __FOSCSEL, FNOSC_FRCPLL
config __FOSC, FCKSM_CSDCMD & OSCIOFNC_ON & POSCMD_NONE & IOL1WAY_OFF
config __FWDT, FWDTEN_OFF & WINDIS_OFF
config __FPOR, ALTI2C_OFF & FPWRT_PWR128
config __FICD, ICS_PGD2 & JTAGEN_OFF
Also I modified the file ds30loader.s :
Code:
;------------------------------------------------------------------------------
; User specific entry code go here, see also user exit code section at end of file
;------------------------------------------------------------------------------
mov W0, WTEMP1 ;xxx
mov W1, WTEMP2 ;xxx
;PLLFBDbits.PLLDIV = 85; //M=87
mov #85,w1
mov w1,PLLFBD
;CLKDIVbits.PLLPRE = 2; //N1=4
;CLKDIVbits.PLLPOST = 3; //N2=8 - FCK=7.37M* (87/8*4) = 20.03Mhz
mov #0b11000011000010,w1
mov w1,CLKDIV
;----------------------------------------------------------------------
; Make uart pins digital
;----------------------------------------------------------------------
.ifdecl ADPCFGL
;DG .error "Do you need to configura uart/can pins to be digital? If not, remove this line"
;configure pins TX1->PINB13(RP13), RX1->PINB12(RP12)
;Serial pins must not be analogic pins
bset AD1PCFGL,#PCFG11 ;AD1PCFGLbits.PCFG11=1;
bset AD1PCFGL,#PCFG12 ;AD1PCFGLbits.PCFG12=1;
bclr TRISB,#TRISB13 ;TRISBbits.TRISB13=0; //B13 è un output
bset TRISB,#TRISB12 ;TRISBbits.TRISB12=1; //B12 è un input
;RPINR18bits.U1RXR=0b01100; //PIN U1RX mapped on RP12
mov #0b1111111100000000,w0 ;
mov RPINR18,w1
and w1,w0,w1 ;w1=w1 && w0
mov #0b0000000000001100,w0 ;U1RXR -> LSB
ior w1,w0,w1 ;w1=w1 || w0
mov w1,RPINR18
;RPOR6bits.RP13R=0b00011; //PIN RP13 mapped on U1TX
mov #0b0000000011111111,w0
mov RPOR6,w1
and w1,w0,w1 ;w1=w1 && w0
mov #0b0000001100000000,w0 ;RP13R -> MSB
ior w1,w0,w1 ;w1=w1 || w0
mov w1,RPOR6
;U1ModeBits.RTSMD=1
bset U1MODE,#RTSMD
.endif
; restore W0 e W1
mov WTEMP1,W0 ;xxx
mov WTEMP2,W1 ;xxx
But the firmware does not work ever.
Also, very very strange, if I change the baudrate to 38400 in settings.inc the firmware does not work never...
I think there is some bug in the uart part or in the flash write part of the firmware for this dspic.
Thanks for any kind of support.
D