Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PIC24FV32KA304 bootloader timeout. Incorrect settings? [SOLVED]
#1
SOLUTION FOUND:
The UART pins were coming up as analogs not as digital I/O.
I noticed that in the code there were statements for the compiler to throw an error in this case but for some reason it wasn't throwing it when I compiled.
I went ahead and put a
clr ANSELB
statement in the user init macro and I'm now connecting and downloading.
Very exciting, this looks far more robust and usable than that dreadful AN1157 from Microchip we had been using.

Hi all,
I'm having an issue detecting the bootloader (all I ever get is a timeout). I have attached a zip file containing the MPLAB workspace I am using (including the linker file, should be the default from the microchip directory)

EDIT: I have tried both 4608000 (18432000/4) as well as 9216000 (18432000/2) as I could not immediately recall if FCY is defined OSC/2 or OSC/4. Both numbers yield the same result.
I am using a crystal oscillator running at 18.432 MHz connected to OSCI (FCY = 9216000?). My UART is UART2.

I commented out the configuration bits settings in the code and did them through MPLAB Configure -> Configuration Bits.
My settings are as follows (apologies for the ugly formatting):
EDIT: Found some issues with my configuration. Had XT selected instead of HS for my primary oscillator config. Still exhibiting the same problem.

BSS Boot segment Protect No boot program flash segment
GWRP General Segment Write Protect General segment may be written
GSS0 General Segment Code Protect No Protection
FNOSC Oscillator Select Primary Oscillator (XT, HS, EC)
SOSCSRC SOSC Source Type Analog Mode for use with crystal
LPRCSEL LPRC Oscillator Power and Accuracy High Power, High Accuracy Mode
IESO Internal External Switch Over bit Internal External Switchover mode enabled (Two-speed Start-up enabled)
POSCMOD Primary Oscillator Configuration bits HS oscillator mode selected
OSCIOFNCCLKO Enable Configuration bit CLKO output disabled
POSCFREQ Primary Oscillator Frequency Range Configuration bits Primary oscillator/external clock input frequency greater than 8MHz
SOSCSEL SOSC Power Selection Configuration bits Secondary Oscillator configured for low-power operation
FCKSM Clock Switching and Monitor Selection Clock Switching is enabled, Fail-safe Clock Monitor is disabled
WDTPS Watchdog Timer Postscale Select bits 1:32768
FWPSA WDT Prescaler bit WDT prescaler ratio of 1:128
FWDTEN Watchdog Timer Enable bits WDT enabled in hardware
WINDIS Windowed Watchdog Timer Disable bit Standard WDT selected(windowed WDT disabled)
BOREN Brown-out Reset Enable bits Brown-out Reset enabled in hardware, SBOREN bit disabled
LVRCFG Low Voltage regulator is not available
PWRTEN Power-up Timer Enable bit PWRT enabled
I2C1SEL Alternate I2C1 Pin Mapping bit Use Default SCL1/SDA1 Pins For I2C1
BORV Brown-out Reset Voltage bits Brown-out Reset set to lowest voltage (2.0V)
MCLRE MCLR Pin Enable bit RA5 input pin disabled,MCLR pin enabled
ICS ICD Pin Placement Select bits EMUC/EMUD share PGC1/PGD1
DSWDTPS Deep Sleep Watchdog Timer Postscale Select bits 1:2,147,483,648 (25.7 Days)
DSWDTOSCDSWDT Reference Clock Select bit DSWDT uses Secondary Oscillator (SOSC)
DSBOREN Deep Sleep Zero-Power BOR Enable bit Deep Sleep BOR enabled in Deep Sleep
DSWDTEN Deep Sleep Watchdog Timer Enable bit DSWDT enabled


As far as procedure for connecting to the bootloader, I want to ensure I am doing it correctly.
Starting with the target board powered down, I am starting the bootloader GUI, loading the hex file, and confirming by baud rate (9600).
I then use the "check for bl" option and power up the system. After several seconds I receive:

'Searching for bl . . . . . . . . response timed out
Found PIC24FJ128DA206
Firmware version timed out'

First thing I notice is that it claims to find a PIC24FJ128DA206 although my chip is a PIC24FV32KA304 (although I'm unsure how it's determining this since it times out).

Any suggestions would be greatly appreciated.

Thanks!


Attached Files
.zip   ds30 FW.zip (Size: 72.16 KB / Downloads: 25)
Reply
#2
Hi,
Thank you very much for sharing the solution!

Best regards
Mikael Gustavsson
MG Digital Solutions
www.ds30loader.com
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)