I've been beating my head against this problem, trying to get the
bootloader to install working code -- ANY working code -- onto a
PIC18F87K90. I finally figured out the problem, after spending gods only
know how long trying to figure it out.
I started with the file
"Dan_tinybld18F65K90-85K90-66K90-86K90-67K90-87K90_int16MHz_19200_v2.asm"
I modified it for my board's oscillator configuration and baud rate.
I noticed pretty quick that the comment about max_flash needing to be
defined in WORDS instead of bytes is incorrect. To get the bootloader
code to live near the top of the flash, I had to set this to 0x20000 (128K)
The table of info for the various pic types is also incorrect, in the
write_page, erase_page, and max_flash columns
The absolute show-stopper, though, was this line in piccodes.ini:
$6F, C, 18F w/128KB flash & 1024B EEPROM, $20000, $400, 264, default,
changing it to:
$6F, C, 18F w/128KB flash & 1024B EEPROM, $20000, $400, 264, 128,
fixed my problem.
Quoting the header comments for "transfer block size" --
; if 'default' for "transfert block size", then it equals:
; - 64 for "C" and "J" families (datasheet: the blocks have to be
written using a 32 words (64 bytes) boundary)
Quoting the datasheet ( DS39957D.pdf ):
For execution of a write to, or erasure of, program memory:
• Memory of 32 Kbytes and 64 Kbytes (PIC18FX5K90 and PIC18FX6K90
devices) – Blocks of 64 bytes
• Memory of 128 Kbytes (PIC18FX7K90 devices) – Blocks of 128 bytes
--
#/*****\
* Barry Callahan
* Technologist
* RJL Systems
* phone: 1 586 790 - 0200 x112
* 1 800 528 - 4513 x112
* fax: 1 586 790 - 0205
*****/
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've been beating my head against this problem, trying to get the
bootloader to install working code -- ANY working code -- onto a
PIC18F87K90. I finally figured out the problem, after spending gods only
know how long trying to figure it out.
I started with the file
"Dan_tinybld18F65K90-85K90-66K90-86K90-67K90-87K90_int16MHz_19200_v2.asm"
I modified it for my board's oscillator configuration and baud rate.
I noticed pretty quick that the comment about max_flash needing to be
defined in WORDS instead of bytes is incorrect. To get the bootloader
code to live near the top of the flash, I had to set this to 0x20000 (128K)
The table of info for the various pic types is also incorrect, in the
write_page, erase_page, and max_flash columns
The absolute show-stopper, though, was this line in piccodes.ini:
$6F, C, 18F w/128KB flash & 1024B EEPROM, $20000, $400, 264, default,
changing it to:
$6F, C, 18F w/128KB flash & 1024B EEPROM, $20000, $400, 264, 128,
fixed my problem.
Quoting the header comments for "transfer block size" --
; if 'default' for "transfert block size", then it equals:
; - 64 for "C" and "J" families (datasheet: the blocks have to be
written using a 32 words (64 bytes) boundary)
Quoting the datasheet ( DS39957D.pdf ):
For execution of a write to, or erasure of, program memory:
• Memory of 32 Kbytes and 64 Kbytes (PIC18FX5K90 and PIC18FX6K90
devices) – Blocks of 64 bytes
• Memory of 128 Kbytes (PIC18FX7K90 devices) – Blocks of 128 bytes
--
#/*****\
* Barry Callahan
* Technologist
* RJL Systems
* phone: 1 586 790 - 0200 x112
* 1 800 528 - 4513 x112
* fax: 1 586 790 - 0205
*****/
Hello Barry,
Thank you very much for your bug reports !!!
New firmwares are attached.
Dan_tinybld18F23K22-43K22-24K22-44K22-25K22-45K22-26K22-46K22_int16MHz_19200_r3.asm
Dan_tinybld18F65K22-85K22-66K22-86K22-67K22-87K22_int16MHz_19200_r3.asm
Dan_tinybld18F65K90-85K90-66K90-86K90-67K90-87K90_int16MHz_19200_r3.asm
<piccodes.ini changes="">
"$30,C" and "$31,C" are not used.</piccodes.ini>
$6D, C, 18F w/32KB flash & 1024B EEPROM, $8000, $400, 264, default,
$6E, C, 18F w/64KB flash & 1024B EEPROM, $10000, $400, 264, default,
$6F, C, 18F w/128KB flash & 1024B EEPROM, $20000, $400, 264, default,
$30, C, 18F w/16KB flash & 0B EEPROM, $4000, 0, 264, default,
$31, C, 18F w/32KB flash & 0B EEPROM, $8000, 0, 264, default,
------------->
$6D, C, 18F w/32KB flash & 1024B EEPROM, $8000, $400, 264, 128,
$6E, C, 18F w/64KB flash & 1024B EEPROM, $10000, $400, 264, 128,
$6F, C, 18F w/128KB flash & 1024B EEPROM, $20000, $400, 264, 128,
$30, C, 18F w/128KB flash & 1024B EEPROM, $20000, $400, 264, 256,
I hope when you get to try if you have these devices.
I do not have these devices.
Best regards,
Dan
Last edit: Dan 2015-01-31