2011-04-11, 21:31:23
(This post was last modified: 2012-12-22, 13:45:52 by Mikael Gustavsson.)
Issue with ds30loader PIC24HJ128GP502:
Had to change FCY by 30% to get right baud rate.
Details:
loader version 1.10. Pic24H versions of ds30loader.s, settings.inc, and .mcp files.
7.375 MHz crystal,
config __FOSCSEL, FNOSC_PRIPLL & IESO_OFF
config __FOSC, FCKSM_CSDCMD & OSCIOFNC_OFF & POSCMD_HS & IOL1WAY_OFF
HS with PLL so FOSC= 29.50 MHz. FCY=29.5/2=14.75MHz.
.equ FCY, 14750000 ;xxx speed of internal cycle clock[Hz], used to calculate uart brg and delay
.equ BAUDRATE, 9600 ;xxx baudrate
With FCY, 14750000 GUI loader could not connect.
Added several "SendL OK" statements after init of UART, and looked with scope.
Showed ~ 68 usec per bit, baud rate of 14925.
changed to FCY 22932000 (1450000*14925/9600)
.equ FCY, 22932000
Now it connects and bootloads program successfully.
My application developed with CCS C, specifies osc at 29.48 with crystal of 7.37 and PLL.
I use input capture, output compare, and uarts at 115200 and it works fine. With my app it is running at 29.5 MHZ. This is true even after bootloading it.
Is the config setup wrong in ds30loader??
The 22.932 is 3.1 times crystal frequency, maybe within tolearnce of UART for 3 times crystal frequency. This says it is running 45.8 MHZ or 6
times the crystal frequency.
I looked at MPLab and it is using config from the code.
Had to change FCY by 30% to get right baud rate.
Details:
loader version 1.10. Pic24H versions of ds30loader.s, settings.inc, and .mcp files.
7.375 MHz crystal,
config __FOSCSEL, FNOSC_PRIPLL & IESO_OFF
config __FOSC, FCKSM_CSDCMD & OSCIOFNC_OFF & POSCMD_HS & IOL1WAY_OFF
HS with PLL so FOSC= 29.50 MHz. FCY=29.5/2=14.75MHz.
.equ FCY, 14750000 ;xxx speed of internal cycle clock[Hz], used to calculate uart brg and delay
.equ BAUDRATE, 9600 ;xxx baudrate
With FCY, 14750000 GUI loader could not connect.
Added several "SendL OK" statements after init of UART, and looked with scope.
Showed ~ 68 usec per bit, baud rate of 14925.
changed to FCY 22932000 (1450000*14925/9600)
.equ FCY, 22932000
Now it connects and bootloads program successfully.
My application developed with CCS C, specifies osc at 29.48 with crystal of 7.37 and PLL.
I use input capture, output compare, and uarts at 115200 and it works fine. With my app it is running at 29.5 MHZ. This is true even after bootloading it.
Is the config setup wrong in ds30loader??
The 22.932 is 3.1 times crystal frequency, maybe within tolearnce of UART for 3 times crystal frequency. This says it is running 45.8 MHZ or 6
times the crystal frequency.
I looked at MPLab and it is using config from the code.