Has anyone got a firmware for the Tiny Bootloader+ for the PIC18F26K40 or PIC27K40 please? And teh PC app to work with them.
I altered the firmware for them, but the PC application does not support them and I tried to use the PIC18F26K42 bits and pieces on the PC application, but it keeps coming back with the error that it will overwrite the bootloader. It has something to do with the on-board eeprom address being different on the PIC18FxxK40 and PIC18FxxK42 devices to standard 18F devices, but I can't see where it is looking for the eeprom address to load it and check it etc...
Maybe the developer hasn't realised that the on-board eeprom address is differrent, and much higher, on these devices. I'm at my wits end trying to solve this problem, so many thanks if it can be solved.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I don't own either PIC18F26K40 or PIC27K40, so I will only give advice.
So I haven't done any testing.
If you absolutely need it, please create it referring to the page below and upload it for someone.
I think this act will also contribute to your skill improvement.
thanks - looking at the data sheets i know the structure of the 18f25_26k40 differs to that of the 18f27_47k40 , and the 18f67K40 is a little differnt again - not just cos of the flash space on each ,
i am working with the 18f47k40 series , other pics are 18f46k80,18f87k22 , which i think would be supported currently
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry for the late reply. Many thanks for the responses, but I re-wrote the Bootlaoder firmware for the PIC18F26K40 device. I converted the firmware to Proton BASIC, so it is easier to understand and simpler to manipulate and alter. The Proton compiler produces extremely compact Asm code and also accepts Asm mnemonics in the BASIC listings.
I used an already functional device type (0x6E) and changed the parameters in the ini file for it because I couldn't quite see an empty spot in the over crowded ini file.
Here is the code for the Proton BASIC compiler, if it helps anyone. It operates exactly the same as the code written in raw assembler. I'm now in the process of trying to create a bootloader for the dsPIC33CK devices based upon the original dsPIC33E types in the excellent Tiny+ bootloader, but having some difficulties for now. It will be written in Proton24, which is the same BASIC compiler, but for PIC24 and dsPIC33 devices.
'' Serial Bootloader for a PIC18F26K40 device.' Operates with a 16MHz external oscillator and a Baud of 19200' The code is based upon the Tiny+ Bootloader'' Written for the Proton BASIC Compiler version 3.7.3.8 onwards'Device=18F26K40DeclareXtal=16DeclareLibrary_Core=Off' Disable the compiler'sLibrarycoreandanyextraitemsthecompileraddstoauser's program$definecIdTypePIC0x6E' The microcntroller type for the PC application$definecMax_Flash_code' The amount of flash memory on th edevice (in bytes)$definecWriteBlockSize_block' The size of the block write to flash memory$definecEepromSize_eeprom' Size of EEPROM (256 or 1024)$definecBootloader_Address$eval(cMax_Flash-264)' 264 bytes long reserved at the top of flash for the bootloader'' Bit names of the NVMCONx SFRs'$definecRD0$definecWR1$definecWREN2$definecWRERR3$definecFREE4$definecNVMREG06$definecNVMREG17'' Create variables for the bootloader'DimbWriteBuffer[64]AsByte' Buffer used for holding dataDimbCRCAsByte' Holds the CRC valueDimbByteCountAsByte' Holds the amount of bytes for a block flash writeDimbFlagsAsByte' Holds the requirement of which memory area to writeDimtEepromWriteAsbFlags.6' Set if eeprom memory is to be writtenDimtConfigWriteAsbFlags.7' Set if config memory is to be writtenDimbTimeoutCounter1AsByte' \ Dim bTimeoutCounter2 As Byte '|TimeoutcounterforreceivingabyteDimbTimeoutCounter3AsByte' /DimwFSR0AsFSR0L.Word' Convert 8-bit SFRs FSR0L\H into a 16-bit SFR$ifndefFalse$defineFalse0$endif$ifndefTrue$defineTrue1$endif'-----------------------------------------------------------------------' Reset'GoToBootloaderStart' Jump to the start of the bootloader'' Set the high flash memory address where the bootloader sits'OrgcBootloader_AddressNop' \ Nop '|Spacetostorethefirst4mnemonicsfromtheuserprogramNop' |Nop' /BootloaderStart:ClearANSELC' Set PORTC to digital'' UART1 Actual Baud = 19230.8' UART1 Baud Error = 0.15625'SP1BRG=51' \ SP1BRGH = 0 '|SetupUSART1for19200BaudTX1STA=36' |RC1STA=144' /'' Configure USART1 PPS'PPS_Unlock()' Unlock PPSTX1PPS=Pin_C6' Set PORTC.6 as TXRX1PPS=Pin_C7' Set PORTC.7 as RXRC6PPS=PPS_Fn_TX1' Set PORTC.6 as TXRC7PPS=PPS_Fn_RX1' Set PORTC.7 as RX'' Wait for computer response'GoSubReceiveByteInto_WREG' Receive a byte from USART1 into WREGIfWREG<>$C1ThenGoToBootloader_Exit' Expect $C1TXREG1=cIdTypePIC' Send the microcontroller type to the PC applicationDo' Create a loopClrwdt' Clear the watchdog timer within the loopWREG="C"' Everything OK so send the character "C" to the PC applicationContinueLoop:TXREG1=WREG' Transmit the contents of WREGClearbCRCGoSubReceiveByteInto_WREG' Receive the Upper addressTBLPTRU=WREGbFlags=WREG' For EEPROM and ConfigGoSubReceiveByteInto_WREG' Receive the High addressTBLPTRH=WREG$if(cEepromSize=1024)NVMADRH=WREG' High address of EEPROM$endifGoSubReceiveByteInto_WREG' Receive the Low addressTBLPTRL=WREGNVMADR=WREG' Low address of EEPROMGoSubReceiveByteInto_WREG' Receive the byte count required for writingbByteCount=WREG' Place it into variable bByteCountwFSR0=AddressOf(bWriteBuffer)' FSR0L\H now hold Buffer Beginning addressTblrd*-' Read from flash memory with auto decrement of address in TBLPTRRcvOct:GoSubReceiveByteInto_WREG' Receive the type of writePOSTINC0=WREG' For Config memoryNVMDAT=WREG' For EEPROMTABLAT=WREG' For Flash memoryTblwt+*' Write to flash memory with auto increment of addressDjnzbByteCount,RcvOct' Loop for the amount of bytes to receiveGoSubReceiveByteInto_WREG' Get CRCCRC_Failed:' CRC failedWREG="N"' Get ready to send the character "N"IfSTATUSbits_Z=0ThenGoToContinueLoopIftConfigWrite=TrueThen' Skip if not writing to ConfigGoToWrite_Config' Write ConfigEndIfWREG=(1<<cWREN)' Setup for EEPROM writeIftEepromWrite=FalseThen' Is it an EEPROM write?GoSubSetupEraseBlock' No. So setup to erase the block of flash memoryEndIfGoSubSetupWriteByteContinue'' Write the configuration fuses (if required)'Write_Config:DecFSR0L' FSR0 = FSR0 - 1Clrwdt' Clear the watchdog timerTABLAT=INDF0' Load TABLATWREG=((1<<cNVMREG1)|(1<<cNVMREG0)|(1<<cWREN))' Setup for Config memoryGoSubSetupWriteByteTblrd*-' Write to memory and auto decrement address in TBLPTRL\HTstfszFSR0L' FSR0L = 0?GoToWrite_Config' \ Loop until FSR0L = 0Loop' /'' Subroutines'SetupEraseBlock:WREG=$94' Setup Erase; EEPGD, FREE, WREN = 1, CFGS = 0SetupWriteByte:NVMCON1=WREGNVMCON2=$55' \ Unlock memory writesNVMCON2=$AA' /SetNVMCON1bits_WRRetlw((1<<cNVMREG1)|(1<<cWREN))' Setup for writes in WREG when returnedReceiveByteInto_WREG:Clrwdt' Clear the watchdog timerbTimeoutCounter1=((_xtal/2)+1)' For 20MHz => 11 => 1 second delayRepeat1:ClearbTimeoutCounter2Repeat2:ClearbTimeoutCounter3Repeat3:IfPIR3bits_RC1IF=0ThenNotReceivedYet' Receive a byte from USART1WREG=RC1REG' Place the read data into WREGbCRC=bCRC+WREG' Calculate CRCReturnNotReceivedYet:Clrwdt' Clear the watchdog timer within the inner loopDjnzbTimeoutCounter3,Repeat3DjnzbTimeoutCounter2,Repeat2DjnzbTimeoutCounter1,Repeat1'' Timeout'Bootloader_Exit:ClearNVMCON1' Deactivate EECONClearRCSTA1bits_SPEN' Deactivate USART1GoTo(cBootloader_Address)' Jump to the start of the user program'-----------------------------------------------------------------------------------------------' Set config fuses for an external oscillator on a PIC18F26K40 device'Config_StartRSTOSC=EXTOSC' EXTOSC operating per FEXTOSC BitsFEXTOSC=HS' HS (crystal oscillator) above 8 MHz. PFM set to high powerCLKOUTEN=Off' CLKOUT function is disabledWDTE=On' Watchdog enabledCSWEN=On' Writing to NOSC and NDIV is allowedFCMEN=Off' Fail-Safe Clock Monitor disabledMCLRE=EXTMCLR' MCLR pin is MCLRPWRTE=On' Power up timer enabledLPBOREN=Off' LPBOREN disabledBOREN=Off' Brown-out turned offBORV=VBOR_245' Brown-out Reset Voltage (VBOR) set to 2.45VZCD=Off' ZCD Zero Detect disabled.PPS1WAY=Off' PPSLOCK bit can be set and cleared repeatedly (subject to the unlock sequence)STVREN=Off' Stack full/underflow will not cause ResetDebug=Off' Background debugger disabledXINST=Off' Extended Instruction Set and Indexed Addressing Mode disabledWDTCPS=WDTCPS_15' Watchdog Divider ratio 1:1048576 (32 seconds)WDTCWS=WDTCWS_7' Window always open (100%). Software control. Keyed access not requiredWDTCCS=LFINTOSC' WDT input clock selector->WDT reference clock is the 31.2kHz HFINTOSC outputSCANE=Off' Scanner module is Not available for use. SCANMD bit is ignoredLVP=Off' HV On MCLR/VPP must be used for programmingWRT0=Off' Block 0 (000800-001FFFh) not SetupWriteByte-protectedWRT1=Off' Block 1 (002000-003FFFh) not SetupWriteByte-protectedWRTC=Off' Configuration registers (300000-30000Bh) not SetupWriteByte-protectedWRTB=Off' Boot Block (000000-0007FFh) not SetupWriteByte-protectedWRTD=Off' Data EEPROM not SetupWriteByte-protectedCp=Off' UserNVM code protection disabledCPD=Off' DataNVM code protection disabledEBTR0=Off' Block 0 (000800-001FFFh) not protected from table reads executed in other blocksEBTR1=Off' Block 1 (002000-003FFFh) not protected from table reads executed in other blocksEBTRB=Off' Boot Block (000000-0007FFh) not protected from table reads executed in other blocksConfig_End
Last edit: Johna Johnson 2020-05-23
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank very much
btw as you probably know microchip in there “wisdom” had dropped support for MPASM from 5.40 version of MPLABX
so 5.35 was the last version of MPASM ver 5.87 – so don’t get caught when updating and droped support for 64bit machines for MPASM as well
I think proton basic still uses MPASM , like wise PBP does as well to get its hex file
Ill need to support a bootloader for other chips as the 18f87k22, 18f46k80 , so I assuming the code you have here I can easly change things about to suit , but will check registers use
I have build the asm from the site for the 18f87k22 , but are not able to get a response from the usart1 either as reset or “ABC” ,
the usb to ttl -ch340 has not dtr / rts pin
is the ABC response built into the bootloader code ????
chip It uses a 16.368 tcxo , as exteral osc , using a setting of PPL4 on config ,
what value should I show for the XTAL value
in my orginal code in PBP and look like you do it here , in calculate the correct values for the USART port to communicate
still trying to make the orginal asm work on the 18f87k22 – if I can get to talk to the pic via serial in any way would be a bonus atm
All email contents are confidential communications and not released to third parties without written authorisation from author of this email
Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10
Sorry for the late reply. Many thanks for the responses, but I re-wrote the Bootlaoder firmware for the PIC18F26K40 device. I converted the firmware to Proton BASIC, so it is easier to understand and simpler to manipulate and alter. The Proton compiler produces extremely compact Asm code and accepts mnemonics in the BASIC listings.
I used an already functional device type (0x6E) and changed the parameters in the ini file for it, because I couldn't quite see an empty spot in the over crowded ini file.
Here is the code for the Proton BASIC compiler, if it helps anyone. It operates exactly the same as the code written in raw assembler. I'm now in the process of trying to create a bootloader for the dsPIC33CK devices based upon the original dsPIC33E types in the excellent Tiny+ bootloader, but having some difficulties for now. It will be written the Proton24, which is the same BASIC compiler, but for PIC24 and dsPIC33 devices.
'
' Serial Bootloader for a PIC18F26K40 device.
' Operates with a 16MHz external oscillator and a Baud of 19200
' The code is based upon the Tiny+ Bootloader
'
' Written by Les Johnson for the Proton BASIC Compiler version 3.7.3.0 onwards
'
Device = 18F26K40
Declare Xtal = 16
Declare Library_Core = Off ' Disable the compiler's LIbrary core and any extra itmes the compiler adds to a user's program
$define cIdTypePIC 0x6E ' The microcntroller type for the PC application
$define cMax_Flash _code ' The amount of flash memory on th edevice (in bytes)
$define cWriteBlockSize _block ' The size of the block write to flash memory
$define cEepromSize _eeprom ' Size of EEPROM (256 or 1024)
$define cBootloader_Address $eval (cMax_Flash - 264) ' 264 bytes long reserved at the top of flash for the bootloader
'
' Bit names of the NVMCONx SFRs
'
$define cRD 0
$define cWR 1
$define cWREN 2
$define cWRERR 3
$define cFREE 4
$define cNVMREG0 6
$define cNVMREG1 7
'
' Create variables for the bootloader
'
DimbWriteBuffer[64]AsByte' Buffer used for holding dataDimbCRCAsByte' Holds the CRC valueDimbByteCountAsByte' Holds the amount of bytes for a block flash writeDimbFlagsAsByte' Holds the requirement of which memory area to writeDimtEepromWriteAsbFlags.6' Set if eeprom memory is to be writtenDimtConfigWriteAsbFlags.7' Set if config memory is to be writtenDimbTimeoutCounter1AsByte' \DimbTimeoutCounter2AsByte' | Timeout counter for receiving a byteDimbTimeoutCounter3AsByte' /DimwFSR0AsFSR0L.Word' Convert 8-bit SFRs FSR0L\H into a 16-bit SFR
GoToBootloaderStart' Jump to the start of the bootloader
'
' Set the high flash memory address where the bootloader sits
'
OrgcBootloader_AddressNop' \Nop' | Space to store the first 4 mnemonics from the user programNop' |Nop' /
BootloaderStart:
Clear ANSELC ' Set PORTC to digital
'
' UART1 Actual Baud = 19230.8
' UART1 Baud Error = 0.15625
'
SP1BRG=51' \SP1BRGH=0' | Setup USART1 for 19200 BaudTX1STA=36' |RC1STA=144' /
'
' Configure USART1 PPS
'
PPS_Unlock() ' Unlock PPS
TX1PPS = Pin_C6 ' Set PORTC.6 as TX
RX1PPS = Pin_C7 ' Set PORTC.7 as RX
RC6PPS = PPS_Fn_TX1 ' Set PORTC.6 as TX
RC7PPS = PPS_Fn_RX1 ' Set PORTC.7 as RX
'
' Wait for computer response
'
GoSubReceiveByteInto_WREG' Receive a byte from USART1 into WREGIfWREG<>$C1ThenGoToBootloader_Exit' Expect $C1TXREG1=cIdTypePIC' Send the microcontroller type to the PC applicationDo' Create a loopClrwdt' Clear the watchdog timer within the loopWREG="C"' Everything OK so send the character "C" to the PC application
ContinueLoop:
TXREG1=WREG' Transmit the contents of WREGClearbCRCGoSubReceiveByteInto_WREG' Receive the Upper addressTBLPTRU=WREGbFlags=WREG' For EEPROM and ConfigGoSubReceiveByteInto_WREG' Receive the High addressTBLPTRH=WREG$if(cEepromSize=1024)NVMADRH=WREG' High address of EEPROM$endifGoSubReceiveByteInto_WREG' Receive the Low addressTBLPTRL=WREGNVMADR=WREG' Low address of EEPROMGoSubReceiveByteInto_WREG' Receive the byte count required for writingbByteCount=WREG' Place it into variable bByteCountwFSR0=AddressOf(bWriteBuffer)' FSR0L\H now hold Buffer Beginning addressTblrd*-' Read from flash memory with auto decrement of address in TBLPTR
WREG = "N" ' Get ready to send the character "N"
If STATUSbits_Z = 0 Then GoTo ContinueLoop
If tConfigWrite = True Then ' Skip if not writing to Config
GoTo Write_Config ' Write Config
EndIf
WREG = (1 << cWREN) ' Setup for EEPROM write
If tEepromWrite = False Then ' Is it an EEPROM write?
GoSub SetupEraseBlock ' No. So setup to erase the block of flash memory
EndIf
GoSub SetupWriteByte
Continue
'
' Write the configuration fuses (if required)
'
NVMCON1 = WREG
NVMCON2 = $55 ' \ Unlock memory writes
NVMCON2 = $AA ' /
Set NVMCON1bits_WR
Retlw ((1 << cNVMREG1) | (1 << cWREN)) ' Setup for writes in WREG when returned
ReceiveByteInto_WREG:
Clrwdt ' Clear the watchdog timer
bTimeoutCounter1 = ((_xtal / 2) + 1) ' For 20MHz => 11 => 1 second delay
Repeat1:
Clear bTimeoutCounter2
Repeat2:
Clear bTimeoutCounter3
Repeat3:
If PIR3bits_RC1IF = 0 Then NotReceivedYet ' Receive a byte from USART1
WREG = RC1REG ' Place the read data into WREG
bCRC = bCRC + WREG ' Calculate CRC
Return
NotReceivedYet:
Clrwdt' Clear the watchdog timer within the inner loopDjnz bTimeoutCounter3, Repeat3Djnz bTimeoutCounter2, Repeat2Djnz bTimeoutCounter1, Repeat1
'
' Timeout
'
Bootloader_Exit:
ClearNVMCON1' Deactivate EECONClearRCSTA1bits_SPEN' Deactivate USART1GoTo(cBootloader_Address)' Jump to the start of the user program
Hello.
Has anyone got a firmware for the Tiny Bootloader+ for the PIC18F26K40 or PIC27K40 please? And teh PC app to work with them.
I altered the firmware for them, but the PC application does not support them and I tried to use the PIC18F26K42 bits and pieces on the PC application, but it keeps coming back with the error that it will overwrite the bootloader. It has something to do with the on-board eeprom address being different on the PIC18FxxK40 and PIC18FxxK42 devices to standard 18F devices, but I can't see where it is looking for the eeprom address to load it and check it etc...
Maybe the developer hasn't realised that the on-board eeprom address is differrent, and much higher, on these devices. I'm at my wits end trying to solve this problem, so many thanks if it can be solved.
Hi Johnson.
I don't own either PIC18F26K40 or PIC27K40, so I will only give advice.
I think that it is better to rework the Firmware of PIC18F24k42 and PIC18F26k42 equipped with NVM memory.
https://sourceforge.net/p/tinypicbootload/discussion/devices/thread/0457fc98/
http://www.picbasic.co.uk/forum/showthread.php?t=24182
Dan.
Last edit: Dan 2019-11-04
did a working file for the PIC18FxxK40 series devices was done and tested ?
Is this bootloader actively being updated still ?
Hi sheldom.
I don't own either PIC18F26K40 or PIC27K40, so I will only give advice.
So I haven't done any testing.
If you absolutely need it, please create it referring to the page below and upload it for someone.
I think this act will also contribute to your skill improvement.
Reference pages
https://sourceforge.net/p/tinypicbootload/discussion/devices/thread/0457fc98/
http://www.picbasic.co.uk/forum/showthread.php?t=24182
I think that it is better to rework the Firmware of PIC18F24k42 and PIC18F26k42 equipped with NVM memory.
DAN.
thanks dan ,
i am working my way though getting this to work on several pics
btw link to picbasic site is no longer working
cheers
I just checked. I dont have a K40 solution.
But, I know a man that has it!! I will ask him today.
thanks - looking at the data sheets i know the structure of the 18f25_26k40 differs to that of the 18f27_47k40 , and the 18f67K40 is a little differnt again - not just cos of the flash space on each ,
i am working with the 18f47k40 series , other pics are 18f46k80,18f87k22 , which i think would be supported currently
I find this one.
http://midtowns4.rssing.com/chan-3738423/all_p185.html
.
Last edit: Dan 2020-05-06
Sorry for the late reply. Many thanks for the responses, but I re-wrote the Bootlaoder firmware for the PIC18F26K40 device. I converted the firmware to Proton BASIC, so it is easier to understand and simpler to manipulate and alter. The Proton compiler produces extremely compact Asm code and also accepts Asm mnemonics in the BASIC listings.
I used an already functional device type (0x6E) and changed the parameters in the ini file for it because I couldn't quite see an empty spot in the over crowded ini file.
Here is the code for the Proton BASIC compiler, if it helps anyone. It operates exactly the same as the code written in raw assembler. I'm now in the process of trying to create a bootloader for the dsPIC33CK devices based upon the original dsPIC33E types in the excellent Tiny+ bootloader, but having some difficulties for now. It will be written in Proton24, which is the same BASIC compiler, but for PIC24 and dsPIC33 devices.
Last edit: Johna Johnson 2020-05-23
HI Johna ,
Thank very much
btw as you probably know microchip in there “wisdom” had dropped support for MPASM from 5.40 version of MPLABX
so 5.35 was the last version of MPASM ver 5.87 – so don’t get caught when updating and droped support for 64bit machines for MPASM as well
I think proton basic still uses MPASM , like wise PBP does as well to get its hex file
Ill need to support a bootloader for other chips as the 18f87k22, 18f46k80 , so I assuming the code you have here I can easly change things about to suit , but will check registers use
I have build the asm from the site for the 18f87k22 , but are not able to get a response from the usart1 either as reset or “ABC” ,
the usb to ttl -ch340 has not dtr / rts pin
is the ABC response built into the bootloader code ????
chip It uses a 16.368 tcxo , as exteral osc , using a setting of PPL4 on config ,
what value should I show for the XTAL value
in my orginal code in PBP and look like you do it here , in calculate the correct values for the USART port to communicate
still trying to make the orginal asm work on the 18f87k22 – if I can get to talk to the pic via serial in any way would be a bonus atm
All email contents are confidential communications and not released to third parties without written authorisation from author of this email
Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10
From: Johna Johnsontop204@users.sourceforge.net
Sent: Saturday, 23 May 2020 19:43
To: [tinypicbootload:discussion] requests@discussion.tinypicbootload.p.re.sourceforge.net
Subject: [tinypicbootload:discussion] Tiny+ Bootloader for PIC18F26K40 or PIC27K40
Sorry for the late reply. Many thanks for the responses, but I re-wrote the Bootlaoder firmware for the PIC18F26K40 device. I converted the firmware to Proton BASIC, so it is easier to understand and simpler to manipulate and alter. The Proton compiler produces extremely compact Asm code and accepts mnemonics in the BASIC listings.
I used an already functional device type (0x6E) and changed the parameters in the ini file for it, because I couldn't quite see an empty spot in the over crowded ini file.
Here is the code for the Proton BASIC compiler, if it helps anyone. It operates exactly the same as the code written in raw assembler. I'm now in the process of trying to create a bootloader for the dsPIC33CK devices based upon the original dsPIC33E types in the excellent Tiny+ bootloader, but having some difficulties for now. It will be written the Proton24, which is the same BASIC compiler, but for PIC24 and dsPIC33 devices.
'
' Serial Bootloader for a PIC18F26K40 device.
' Operates with a 16MHz external oscillator and a Baud of 19200
' The code is based upon the Tiny+ Bootloader
'
' Written by Les Johnson for the Proton BASIC Compiler version 3.7.3.0 onwards
'
$define cIdTypePIC 0x6E ' The microcntroller type for the PC application
$define cMax_Flash _code ' The amount of flash memory on th edevice (in bytes)
$define cWriteBlockSize _block ' The size of the block write to flash memory
$define cEepromSize _eeprom ' Size of EEPROM (256 or 1024)
$define cBootloader_Address $eval (cMax_Flash - 264) ' 264 bytes long reserved at the top of flash for the bootloader
'
' Bit names of the NVMCONx SFRs
'
$define cRD 0
$define cWR 1
$define cWREN 2
$define cWRERR 3
$define cFREE 4
$define cNVMREG0 6
$define cNVMREG1 7
'
' Create variables for the bootloader
'
$ifndef False
$endif
$ifndef True
$endif
'-----------------------------------------------------------------------
' Reset
'
'
' Set the high flash memory address where the bootloader sits
'
BootloaderStart:
'
' UART1 Actual Baud = 19230.8
' UART1 Baud Error = 0.15625
'
'
' Configure USART1 PPS
'
'
' Wait for computer response
'
ContinueLoop:
RcvOct:
CRC_Failed: ' CRC failed
Write_Config:
'
' Subroutines
'
SetupEraseBlock:
SetupWriteByte:
ReceiveByteInto_WREG:
Repeat1:
Repeat2:
Repeat3:
NotReceivedYet:
'
' Timeout
'
Bootloader_Exit:
'-----------------------------------------------------------------------------------------------
' Set config fuses for an external oscillator on a PIC18F26K40 device
'
Config_Start
Config_End
Tiny+ Bootloader for PIC18F26K40 or PIC27K40https://sourceforge.net/p/tinypicbootload/discussion/requests/thread/b9730dde34/?limit=25#04ff
Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/tinypicbootload/discussion/requests/
To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/