2011-06-09, 13:52:10
(This post was last modified: 2012-12-23, 19:59:27 by Mikael Gustavsson.)
Hi all
I have successfully built versions of the bootloader for both the 18F25K22 and 18F14K22 which are the chips used for the Picaxe 28X2 and 20X2. These have been set up with 64Mhz internal clock and inverted comms to use the standard 22k resistor picaxe download circuit but of course the bootloader uses the hardware UART whereas the picaxe uses different pins (in the case of the 28X2 it uses RA4 for RX and RA5 for TX).
It would be nice to use the bootloader in the standard picaxe development boards so I have coded a software uart at 38400 baud which uses the correct picaxe pins.
This is working to the extent that I get the following messages in the DS30 GUI:
Found PIC18F25K22fw ver. 3.0.0
Waiting for bootloader to be ready...ok
It then says:
Writing flash...bl protection tripped
Write failed
Tx 236 bytes/Rx 10 bytes /4s
The program I'm loading is a simple LED flash coded in Swordfish which works perfectly with the standard UART-based bootloader
When using the standard bootloader the GUI reports 231 bytes but with the SW UART it says 229. However, it seems to pass the checksum test OK as if I patch out the checksum test I get the expected checksum error
I had to increase BLPLP and BLSIZEP to 9 to fit the additional code into the bootloader (I've also tried 10) and have added 4 bytes at the bottom of the variable cblock.
This is my first foray into PIC assembler (my last real use of assembler was on the DEC PDP11 and Motorola 6809!). I would appreciate any insights into where to look for the problem.
I will of course be happy to share the output once this is all working
best regards
Peter
I have successfully built versions of the bootloader for both the 18F25K22 and 18F14K22 which are the chips used for the Picaxe 28X2 and 20X2. These have been set up with 64Mhz internal clock and inverted comms to use the standard 22k resistor picaxe download circuit but of course the bootloader uses the hardware UART whereas the picaxe uses different pins (in the case of the 28X2 it uses RA4 for RX and RA5 for TX).
It would be nice to use the bootloader in the standard picaxe development boards so I have coded a software uart at 38400 baud which uses the correct picaxe pins.
This is working to the extent that I get the following messages in the DS30 GUI:
Found PIC18F25K22fw ver. 3.0.0
Waiting for bootloader to be ready...ok
It then says:
Writing flash...bl protection tripped
Write failed
Tx 236 bytes/Rx 10 bytes /4s
The program I'm loading is a simple LED flash coded in Swordfish which works perfectly with the standard UART-based bootloader
When using the standard bootloader the GUI reports 231 bytes but with the SW UART it says 229. However, it seems to pass the checksum test OK as if I patch out the checksum test I get the expected checksum error
I had to increase BLPLP and BLSIZEP to 9 to fit the additional code into the bootloader (I've also tried 10) and have added 4 bytes at the bottom of the variable cblock.
This is my first foray into PIC assembler (my last real use of assembler was on the DEC PDP11 and Motorola 6809!). I would appreciate any insights into where to look for the problem.
I will of course be happy to share the output once this is all working
best regards
Peter