I attach the firmware and modified version host program.
The host program the previous presentation, reset by the RTS was disabled.
(Reset by the DTR is enabled.)
------------->
I was back to the original specification in a modified version of this.
Because I can cope with PIC device of all the Tiny AVR/PIC Bootloader+,
for data transfer format, I will summarize here.
Action command does not exist in Tiny AVR/PIC Bootloader+.
Rather than a command from the host side, perform firmware is necessary to erase flash memory.
1.The type of data transfer
There are three data to be transferred from Tiny AVR/PIC Bootloader+ host.
①Flash Data
②EEPROM Data
③Config Data (24-bit PIC and PIC18F)
Represents the character of one byte [] below.
2.Data format of 14-bit PIC (PIC10F/12F/16F), "B"-Family
①Flash transfer format: [AddressH][AddressL][2*N][DataL(1)][DataH(1)]....[DataL(N)][DataH(N)][SUM]
[AddressH] Start address of the flash page to override the data. (upper) [AddressL] Start address of the flash page to override the data. (lower) [2*N] Number of transfers of data as described in piccode.ini. (byte notation) [DataL/H(n)] Rewrite data (2*N)bytes. [SUM] Checksum.
②EEPROM transfer format: [EEAddressH][EEAddressL][2][EEData][0][SUM]
[EEAddressH] Address of the EEPROM to override the data | 0x40 (upper) [EEAddressL] Address of the EEPROM to override the data. (lower) EEAddressH:EEAddressL >= 0x4000 [2] Number of data transfers. (Always 2) [EEData] EEPROM 8-bit data to be rewritten. [0] Always 0. [SUM] Checksum.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
①Flash transfer format: [AddressU][AddressH][AddressL][2*N][DataL(1)][DataH(1)]....[DataL(N)][DataH(N)][SUM]
[AddressU] Start address of the flash page to override the data. (upper) [AddressH] Start address of the flash page to override the data. (middle) [AddressL] Start address of the flash page to override the data. (lower) [2*N] Number of transfers of data as described in piccode.ini. (byte notation) [DataL/H(n)] Rewrite data (2*N)bytes. [SUM] Checksum.
②EEPROM transfer format: [EEAddressU][EEAddressH][EEAddressL][1][EEData][SUM]
[EEAddressU] Address of the EEPROM to override the data | 0x40. (upper) [EEAddressH] Address of the EEPROM to override the data. (middle) [EEAddressL] Address of the EEPROM to override the data. (lower)
EEAddressU:EEAddressH:EEAddressL >= 0x400000 [1] Number of data transfers. (Always 1) [EEData] EEPROM 8-bit data to be rewritten. [SUM] Checksum.
③Config transfer format: [CFGAddressU][CFGAddressH][CFGAddressL][14][CFGDataL(1)][CFGDataH(1)].....[CFGDataL(7)][CFGDataH(7)][SUM]
[CFGAddressU] Start address of the Config data to overwrite the data | 0x80. (upper) [CFGAddressH] Start address of the Config data to overwrite the data. (middle) [CFGAddressL] Start address of the Config data to overwrite the data. (lower)
CFGAddressU:CFGAddressH:CFGAddressL >= 0x800000 [14] Number of data transfers. (Always 14) [CFGData(n)] Rewrite data (2*7)bytes. [SUM] Checksum.
4.Data format of 16-bit PIC (PIC18F-J), "J"-Family
①Flash transfer format: [AddressU][AddressH][AddressL][2*N][DataL(1)][DataH(1)]....[DataL(N)][DataH(N)][SUM]
[AddressU] Start address of the flash page to override the data. (upper) [AddressH] Start address of the flash page to override the data. (middle) [AddressL] Start address of the flash page to override the data. (lower) [2*N] Number of transfers of data as described in piccode.ini. (byte notation) [DataL/H(n)] Rewrite data (2*N)bytes. [SUM] Checksum.
②Config transfer format: [CFGAddressU][CFGAddressH][CFGAddressL][8][CFGDataL(1)][CFGDataH(1)].....[CFGDataL(4)][CFGDataH(4)][SUM]
[CFGAddressU] Start address of the Config data to overwrite the data | 0x80. (upper) [CFGAddressH] Start address of the Config data to overwrite the data. (middle) [CFGAddressL] Start address of the Config data to overwrite the data. (lower)
CFGAddressU:CFGAddressH:CFGAddressL >= 0x800000 [8] Number of data transfers. (Always 8) [CFGData(n)] Rewrite data (2*4)bytes. [SUM] Checksum.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
①Flash transfer format: [AddressL][AddressH][AddressU][3*N][DataL(1)][DataH(1)][DataU(1)]....[DataL(N)][DataH(N)][DataU(N)][SUM]
[AddressL] Start address of the flash page to override the data. (lower) [AddressH] Start address of the flash page to override the data. (middle) [AddressU] Start address of the flash page to override the data. (upper) [3*N] Number of transfers of data as described in piccode.ini. (byte notation) [DataL/H/U(n)] Rewrite data (3*N)bytes. [SUM] Checksum.
②EEPROM transfer format: [EEAddressL][EEAddressH][EEAddressU][2][EEDataL][EEDataH][SUM]
[EEAddressL] Address of the EEPROM to override the data (lower). [EEAddressH] Address of the EEPROM to override the data (middle). [EEAddressU] Address of the EEPROM to override the data (upper). [2] Number of data transfers. (Always 2) [EEDataL/H] EEPROM 16-bit data to be rewritten. [SUM] Checksum.
③Config transfer format: [CFGAddressL][CFGAddressH][CFGAddressU][18][CFGDataL(1)][CFGDataH(1)].....[CFGDataL(9)][CFGDataH(9)][SUM]
[CFGAddressL] Start address of the Config data to overwrite the data. (lower) [CFGAddressH] Start address of the Config data to overwrite the data. (middle) [CFGAddressU] Start address of the Config data to overwrite the data. (upper) [18] Number of data transfers. (Always 18) [CFGDataL/H(n)] Rewrite data (2*9)bytes. [SUM] Checksum.
6.Data format of 24-bit PIC, "E"-Family
①Flash transfer format: [AddressL][AddressH][AddressU][3*N][DataL(1)][DataH(1)][DataU(1)]....[DataL(N)][DataH(N)][DataU(N)][SUM]
[AddressL] Start address of the flash page to override the data. (lower) [AddressH] Start address of the flash page to override the data. (middle) [AddressU] Start address of the flash page to override the data. (upper) [3*N] Number of transfers of data as described in piccode.ini. (byte notation) [DataL/H/U(n)] Rewrite data (3*N)bytes. [SUM] Checksum.
②Config transfer format: [CFGAddressL][CFGAddressH][CFGAddressU][30][CFGDataL(1)][CFGDataH(1)][CFGDataU(1)].....[CFGDataL(10)][CFGDataH(10)][CFGDataU(10)][SUM]
[CFGAddressL] Start address of the Config data to overwrite the data. (lower) [CFGAddressH] Start address of the Config data to overwrite the data. (middle) [CFGAddressU] Start address of the Config data to overwrite the data. (upper) [30] Number of data transfers. (Always 30) [CFGDataL/H/U(n)] Rewrite data (3*10)bytes. [SUM] Checksum.
Last edit: Dan 2014-06-24
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks a lot for the new "D" and "E" families support in TinyBootloader+, the new firmwares and all the updates you made! You're great!!! I hope we'll meet one day :-)
So, by now I'm gathering everything from your posts and I'll post a v0.9.0 with all your addons.
Best regards,
Edorul
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I downloaded the code looking for the (partial) support of the dsPIC33E chips, and under the Type D folder, there are no files! Did these get dropped somewhere?
I've been trying to modify MicroChip's dsPIC33E bootloaders, but have had little success--was hoping that Tiny Multi Bootloader+ might be the answer...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Dan, i have been trying for months on increasing the TinyBootloader size from 100words to about 200words for PIC18, what do i need to change in the code and PC Software?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Firmware size can not be freely selected.
If the erase/write unit is 16 words
84, 100, 116, 132 ...
If the erase/write unit is 32 words
100, 132, 164, ....
If the erase/write unit is 64 words
132, 196, .........
Please make it to be N x U + 4 for erase/write unit U. (N = 1, 2, 3, ....)
2.Change piccodes.ini
Even if the corresponding device already exists, assign another number.
The following is an example of PIC10F322
Thank you Dan, That information was very helpful, so i can adjust the firmware size from the piccodes.ini only or do i need to change any other thing in the PC software?
i really appreciate your reply.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello Dan, Thank You for your replies, but when i inserted the example you gave to me and try to write into the MCU, i still get this error messages "Error: hex file too large, writing bootloader firmware!!!
* Error: problem in writing MCU memory!!!"
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,All
I was successful in writing flash of dsPIC30.
I verified the Config and EEPROM current.
Contributions Once I have completed.
I think to become a template for 24/24H/dsPIC33.
Last edit: Dan 2014-06-14
Hi,All
dsPIC30 corresponding version was completed.
I attach the host program.
and ds30F3012's firmware.
and ds33FJ128GP202's firmware.
(If you create the firmware, also corresponds to the writing of the PIC24.)
My Change: //$nn
Details of the changes described in the ReadMe.txt
Last edit: Dan 2014-06-18
Hi,All
I was able to operate also confirmed PIC24HJ12GP202.
Corresponding to the D type is almost complete.
Hi,All
Distinction of the E-type and D-type.
Relationship with the E-type and D-type is similar to the relationship of PIC18J and PIC18.
"Frash Config Words" does not exist in the D-type.
[Device corresponding to the D-type]
dsPIC30F
PIC24F
PIC24FV
PIC24HJ
PIC24E(Partial)
dsPIC33F(Partial)
dsPIC33E(Partial)
[Device corresponding to the E-type]
PIC24FJ
PIC24E(Partial)
dsPIC33F(Partial)
dsPIC33E(Partial)
Last edit: Dan 2014-06-18
Hi,All
Modified the host program, I also support E-Type.
I attach the firmware and modified version host program.
The host program the previous presentation, reset by the RTS was disabled.
(Reset by the DTR is enabled.)
------------->
I was back to the original specification in a modified version of this.
Source Changes:
//$nn ---> //$#nn
Hi,All
Because I can cope with PIC device of all the Tiny AVR/PIC Bootloader+,
for data transfer format, I will summarize here.
Action command does not exist in Tiny AVR/PIC Bootloader+.
Rather than a command from the host side, perform firmware is necessary to erase flash memory.
1.The type of data transfer
There are three data to be transferred from Tiny AVR/PIC Bootloader+ host.
①Flash Data
②EEPROM Data
③Config Data (24-bit PIC and PIC18F)
Represents the character of one byte [] below.
2.Data format of 14-bit PIC (PIC10F/12F/16F), "B"-Family
①Flash transfer format:
[AddressH][AddressL][2*N][DataL(1)][DataH(1)]....[DataL(N)][DataH(N)][SUM]
[AddressH] Start address of the flash page to override the data. (upper)
[AddressL] Start address of the flash page to override the data. (lower)
[2*N] Number of transfers of data as described in piccode.ini. (byte notation)
[DataL/H(n)] Rewrite data (2*N)bytes.
[SUM] Checksum.
②EEPROM transfer format:
[EEAddressH][EEAddressL][2][EEData][0][SUM]
[EEAddressH] Address of the EEPROM to override the data | 0x40 (upper)
[EEAddressL] Address of the EEPROM to override the data. (lower) EEAddressH:EEAddressL >= 0x4000
[2] Number of data transfers. (Always 2)
[EEData] EEPROM 8-bit data to be rewritten.
[0] Always 0.
[SUM] Checksum.
3.Data format of 16-bit PIC (PIC18F), "C"-Family
①Flash transfer format:
[AddressU][AddressH][AddressL][2*N][DataL(1)][DataH(1)]....[DataL(N)][DataH(N)][SUM]
[AddressU] Start address of the flash page to override the data. (upper)
[AddressH] Start address of the flash page to override the data. (middle)
[AddressL] Start address of the flash page to override the data. (lower)
[2*N] Number of transfers of data as described in piccode.ini. (byte notation)
[DataL/H(n)] Rewrite data (2*N)bytes.
[SUM] Checksum.
②EEPROM transfer format:
[EEAddressU][EEAddressH][EEAddressL][1][EEData][SUM]
[EEAddressU] Address of the EEPROM to override the data | 0x40. (upper)
[EEAddressH] Address of the EEPROM to override the data. (middle)
[EEAddressL] Address of the EEPROM to override the data. (lower)
EEAddressU:EEAddressH:EEAddressL >= 0x400000
[1] Number of data transfers. (Always 1)
[EEData] EEPROM 8-bit data to be rewritten.
[SUM] Checksum.
③Config transfer format:
[CFGAddressU][CFGAddressH][CFGAddressL][14][CFGDataL(1)][CFGDataH(1)].....[CFGDataL(7)][CFGDataH(7)][SUM]
[CFGAddressU] Start address of the Config data to overwrite the data | 0x80. (upper)
[CFGAddressH] Start address of the Config data to overwrite the data. (middle)
[CFGAddressL] Start address of the Config data to overwrite the data. (lower)
CFGAddressU:CFGAddressH:CFGAddressL >= 0x800000
[14] Number of data transfers. (Always 14)
[CFGData(n)] Rewrite data (2*7)bytes.
[SUM] Checksum.
4.Data format of 16-bit PIC (PIC18F-J), "J"-Family
①Flash transfer format:
[AddressU][AddressH][AddressL][2*N][DataL(1)][DataH(1)]....[DataL(N)][DataH(N)][SUM]
[AddressU] Start address of the flash page to override the data. (upper)
[AddressH] Start address of the flash page to override the data. (middle)
[AddressL] Start address of the flash page to override the data. (lower)
[2*N] Number of transfers of data as described in piccode.ini. (byte notation)
[DataL/H(n)] Rewrite data (2*N)bytes.
[SUM] Checksum.
②Config transfer format:
[CFGAddressU][CFGAddressH][CFGAddressL][8][CFGDataL(1)][CFGDataH(1)].....[CFGDataL(4)][CFGDataH(4)][SUM]
[CFGAddressU] Start address of the Config data to overwrite the data | 0x80. (upper)
[CFGAddressH] Start address of the Config data to overwrite the data. (middle)
[CFGAddressL] Start address of the Config data to overwrite the data. (lower)
CFGAddressU:CFGAddressH:CFGAddressL >= 0x800000
[8] Number of data transfers. (Always 8)
[CFGData(n)] Rewrite data (2*4)bytes.
[SUM] Checksum.
5.Data format of 24-bit PIC, "D"-Family
①Flash transfer format:
[AddressL][AddressH][AddressU][3*N][DataL(1)][DataH(1)][DataU(1)]....[DataL(N)][DataH(N)][DataU(N)][SUM]
[AddressL] Start address of the flash page to override the data. (lower)
[AddressH] Start address of the flash page to override the data. (middle)
[AddressU] Start address of the flash page to override the data. (upper)
[3*N] Number of transfers of data as described in piccode.ini. (byte notation)
[DataL/H/U(n)] Rewrite data (3*N)bytes.
[SUM] Checksum.
②EEPROM transfer format:
[EEAddressL][EEAddressH][EEAddressU][2][EEDataL][EEDataH][SUM]
[EEAddressL] Address of the EEPROM to override the data (lower).
[EEAddressH] Address of the EEPROM to override the data (middle).
[EEAddressU] Address of the EEPROM to override the data (upper).
[2] Number of data transfers. (Always 2)
[EEDataL/H] EEPROM 16-bit data to be rewritten.
[SUM] Checksum.
③Config transfer format:
[CFGAddressL][CFGAddressH][CFGAddressU][18][CFGDataL(1)][CFGDataH(1)].....[CFGDataL(9)][CFGDataH(9)][SUM]
[CFGAddressL] Start address of the Config data to overwrite the data. (lower)
[CFGAddressH] Start address of the Config data to overwrite the data. (middle)
[CFGAddressU] Start address of the Config data to overwrite the data. (upper)
[18] Number of data transfers. (Always 18)
[CFGDataL/H(n)] Rewrite data (2*9)bytes.
[SUM] Checksum.
6.Data format of 24-bit PIC, "E"-Family
①Flash transfer format:
[AddressL][AddressH][AddressU][3*N][DataL(1)][DataH(1)][DataU(1)]....[DataL(N)][DataH(N)][DataU(N)][SUM]
[AddressL] Start address of the flash page to override the data. (lower)
[AddressH] Start address of the flash page to override the data. (middle)
[AddressU] Start address of the flash page to override the data. (upper)
[3*N] Number of transfers of data as described in piccode.ini. (byte notation)
[DataL/H/U(n)] Rewrite data (3*N)bytes.
[SUM] Checksum.
②Config transfer format:
[CFGAddressL][CFGAddressH][CFGAddressU][30][CFGDataL(1)][CFGDataH(1)][CFGDataU(1)].....[CFGDataL(10)][CFGDataH(10)][CFGDataU(10)][SUM]
[CFGAddressL] Start address of the Config data to overwrite the data. (lower)
[CFGAddressH] Start address of the Config data to overwrite the data. (middle)
[CFGAddressU] Start address of the Config data to overwrite the data. (upper)
[30] Number of data transfers. (Always 30)
[CFGDataL/H/U(n)] Rewrite data (3*10)bytes.
[SUM] Checksum.
Last edit: Dan 2014-06-24
Hello Dan!
Thanks a lot for the new "D" and "E" families support in TinyBootloader+, the new firmwares and all the updates you made! You're great!!! I hope we'll meet one day :-)
So, by now I'm gathering everything from your posts and I'll post a v0.9.0 with all your addons.
Best regards,
Edorul
I downloaded the code looking for the (partial) support of the dsPIC33E chips, and under the Type D folder, there are no files! Did these get dropped somewhere?
I've been trying to modify MicroChip's dsPIC33E bootloaders, but have had little success--was hoping that Tiny Multi Bootloader+ might be the answer...
Hi,Nelson
Please look for the following fofolders.
Tiny_Avr-Pic_Bootloader+ (v0.9.0)
Tiny Multi Bootloader+ (v0.10.0)
Best regards,
Dan
Hi Dan, i have been trying for months on increasing the TinyBootloader size from 100words to about 200words for PIC18, what do i need to change in the code and PC Software?
Why? Same question.
Hi,
If the erase/write unit is 16 words
84, 100, 116, 132 ...
If the erase/write unit is 32 words
100, 132, 164, ....
If the erase/write unit is 64 words
132, 196, .........
Please make it to be N x U + 4 for erase/write unit U. (N = 1, 2, 3, ....)
2.Change piccodes.ini
Even if the corresponding device already exists, assign another number.
The following is an example of PIC10F322
; PIC10 family
; example: PIC10F322 Flash: 512 words = 200h; 200h*2 = 400h
;-----------
$11, B, 10F 322 (100W), $400, $000, default, 32,
$12, B, 10F 322 (84W), $400, $000, 168, 32,
Thank you Dan, That information was very helpful, so i can adjust the firmware size from the piccodes.ini only or do i need to change any other thing in the PC software?
i really appreciate your reply.
Hello Dan, please write an example for PIC16F877 to be firmware size to about 132 words
; PIC16 family
; example: PIC16F877 Flash: 8192 words = 2000h; 2000h*2 = 4000h
;-----------
$31, B, 16F 876/877/876A/877A, $4000, $100, default, default,
exsample
$40, B, 16F 876/877/876A/877A, $4000, $100, 264, default,
$00 < NUMBER =< $FF
Last edit: Dan 2018-05-25
Hello Dan, Thank You for your replies, but when i inserted the example you gave to me and try to write into the MCU, i still get this error messages "Error: hex file too large, writing bootloader firmware!!!
* Error: problem in writing MCU memory!!!"
Hi
Is the upper limit of HEX file 0x1F7B or less?
Does this work?
$40, B, 16F 886/887/876A/877A/876/877(132w), $4000, $100, 264, 32,
ext clock 8MHz
19200 bpr
Last edit: Dan 2018-05-25
Thank you Dan, i will check and give reply soon.
I still get the same error messages, i found out that your code is still running on 20MHz even when the xtal is 8MHz
xtal EQU 8000000 ; you may also want to change: _HS_OSC _XT_OSC
baud EQU 19200 ; standard TinyBld baud rates: 115200 or 19200
Receive:
movlw xtal/2000000+2 ;for 20MHz => 11 => 1second
movwf cnt1
I imported my code to PIC18F452
Here is the Hex File
my ASM code
Is your target 16F, 18F?
Code made with 18f can not flow to 16F.
I already changed the code back on 16F but its still conplaining about the same error,
Initially the PC Software couldn't detect the MCU, then i detected this in the code
MainLoop:
movlw 'B'
MainLoop:
movlw 'K'
i really appreciate your replies