stage 1 - compile modified bootloader with mplabx 1.95, program using pickit3 - OK
stage 2 - use 'tinybldlin' to interact with bootloader - OK
stage 3 - use program to check PIC it responds with found - OK
Connected to /dev/ttyUSB0 at 19200
Searching for PIC ...
Found:18F 2620/4620
stage 4 - Write Flash, blue bar scrolls with this responce
Connected to /dev/ttyUSB0 at 19200
HEX:01 min old,INX32M,18Fcode+cfg,total=1318 bytes.
Searching for PIC ...
Found:18F 2620/4620
Write OK at 19:24 time: 1.352 sec
stage 5 - open terminal 'GTKterm' to communicate via uart - bad no response
it appears as though the program does not start
i know i am missing something to allow the program to run but i am not sure what it is can anyone point me in the right direction?
the program works if i restore the config fuses (commented out) and program directly via pickit3
program code
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
radixDEC;changetheselinesaccordinglytoyourapplication#include "p18f4680.inc"IdTypePIC=0x4F;mustexistsin"piccodes.ini"#define max_flash 0x10000 ; in BYTES!!! (= 'max flash memory' from "piccodes.ini")xtalEQU8000000;youmaywanttochange:_XT_OSC_1H_HS_OSC_1H_HSPLL_OSC_1HbaudEQU19200;thedesiredbaudrate;Theabove5linescanbechangedandbuidabootloaderforthedesiredfrequency(andPICtype);********************************************************************;TinyBootloader18FseriesSize=100words;claudiu.chiculita@ugal.ro;http://www.etc.ugal.ro/cchiculita/software/picbootloader.htm;;modifiedbyEdorul:;EEPROMwriteisonlycompatiblewith"Tiny PIC Bootloader+";http://sourceforge.net/projects/tinypicbootload/;********************************************************************#include "../spbrgselect.inc" ; RoundResult and baud_rate#define first_address max_flash-200 ;100 wordsconfigIESO=OFF,FCMEN=OFF,OSC=XTconfigBOREN=BOHW,PWRT=ON,BORV=2;//2.8vBORV=1//4.3VconfigWDTPS=2048,WDT=OFFconfigPBADEN=OFF,LPT1OSC=OFF,MCLRE=ONconfigDEBUG=OFF,XINST=OFF,LVP=OFF,STVREN=ON,BBSIZ=2048configCP0=OFF,CP1=OFF,CP2=OFF,CP3=OFFconfigCPD=OFF,CPB=OFFconfigWRT0=OFF,WRT1=OFF,WRT2=OFF,WRT3=OFFconfigWRTB=OFF,WRTC=OFF,WRTD=OFFconfigEBTR0=OFF,EBTR1=OFF,EBTR2=OFF,EBTR3=OFFconfigEBTRB=OFF;-----------------------------PROGRAM---------------------------------cblock0crcicnt1cnt2cnt3counter_hicounter_loflagendccblock10buffer:64endcSendLmacrocarmovlwcarmovwfTXREGendm;0000000000000000000000000RESET00000000000000000000000000ORG0x0000GOTOIntrareBootloader;viewwithTabSize=4;&&&&&&&&&&&&&&&&&&&&&&&START&&&&&&&&&&&&&&&&&&&&&&;----------------------Bootloader----------------------;PC_flash:C1hUHLx...<64bytes>...crc;PC_eeprom:C1h40hEEADRHEEADR1EEDATAcrc;PC_cfgC1hUOR80hHL1bytecrc;PIC_response:type`K`ORGfirst_address;spacetodepositfirst4instr.ofuserprog.nopnopnopnoporgfirst_address+8IntrareBootloader;initserialportmovlwb'00100100'movwfTXSTAmovlwspbrg_valuemovwfSPBRGmovlwb'10010000'movwfRCSTA;waitforcomputerrcallReceivesublw0xC1;ExpectC1hbnzway_to_exitSendLIdTypePIC;sendPICtypeMainLoopSendL'K';"-Everything OK, ready and waiting."mainlclrfcrcrcallReceive;UppermovwfTBLPTRUmovwfflag;(forEEPROMandCFGcases)rcallReceive;HimovwfTBLPTRHmovwfEEADRH;(forEEPROMcase)rcallReceive;LomovwfTBLPTRLmovwfEEADR;(forEEPROMcase)rcallReceive;countmovwfiincfilfsrFSR0,(buffer-1)rcvoct;read64+1bytesmovwfTABLAT;prepareforcfg;=>storebytebeforecrcrcallReceivemovwfPREINC0btfssi,0;don't know for the moment but in case of EEPROM data presence... movwf EEDATA ;...then store the data byte (and not the CRC!) decfsz i bra rcvoct tstfsz crc ;check crc bra ziieroare btfss flag,6 ;is EEPROM data? bra noeeprom movlw b'00000100' ;Setup eeprom rcall Write bra waitwrenoeeprom;----no CFG write in "Tiny PIC Bootloader+"; btfss flag,7 ;is CFG data?; bra noconfig; tblwt* ;write TABLAT(byte before crc) to TBLPTR***; movlw b'11000100' ;Setup cfg; rcall Write; bra waitwre;noconfig;---- ;writeeraseloop movlw b'10010100' ; Setup erase rcall Write TBLRD*- ; point to adr-1writebigloop movlw 8 ; 8groups movwf counter_hi lfsr FSR0,bufferwritesloop movlw 8 ; 8bytes = 4instr movwf counter_lowritebyte movf POSTINC0,w ; put 1 byte movwf TABLAT tblwt+* decfsz counter_lo bra writebyte movlw b'10000100' ; Setup writes rcall Write decfsz counter_hi bra writesloopwaitwre ;btfsc EECON1,WR ;for eeprom writes (wait to finish write) ;bra waitwre ;no need: round trip time with PC bigger than 4ms bcf EECON1,WREN ;disable writes bra MainLoopziieroare ;CRC failed SendL 'N' bra mainl;******** procedures ******************Write movwf EECON1 movlw 0x55 movwf EECON2 movlw 0xAA movwf EECON2 bsf EECON1,WR ;WRITE nop ;nop returnReceive movlw xtal/2000000+1 ; for 20MHz => 11 => 1second delay movwf cnt1rpt2 clrf cnt2rpt3 clrf cnt3rptc btfss PIR1,RCIF ;test RX bra notrcv movf RCREG,w ;return read data in W addwf crc,f ;compute crc returnnotrcv decfsz cnt3 bra rptc decfsz cnt2 bra rpt3 decfsz cnt1 bra rpt2 ;timeout:way_to_exit bcf RCSTA, SPEN ; deactivate UART bra first_address;*************************************************************; After reset; Do not expect the memory to be zero,; Do not expect registers to be initialised like in catalog. END
having problems getting program to run
stage 1 - compile modified bootloader with mplabx 1.95, program using pickit3 - OK
stage 2 - use 'tinybldlin' to interact with bootloader - OK
stage 3 - use program to check PIC it responds with found - OK
Connected to /dev/ttyUSB0 at 19200
Searching for PIC ...
Found:18F 2620/4620
stage 4 - Write Flash, blue bar scrolls with this responce
Connected to /dev/ttyUSB0 at 19200
HEX:01 min old,INX32M,18Fcode+cfg,total=1318 bytes.
Searching for PIC ...
Found:18F 2620/4620
Write OK at 19:24 time: 1.352 sec
stage 5 - open terminal 'GTKterm' to communicate via uart - bad no response
it appears as though the program does not start
i know i am missing something to allow the program to run but i am not sure what it is can anyone point me in the right direction?
the program works if i restore the config fuses (commented out) and program directly via pickit3
program code
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
bootloader code
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,k p
;*********
; Tiny Bootloader 18F series Size=100words
; claudiu.chiculita@ugal.ro
;
;http://www.etc.ugal.ro/cchiculita/software/picbootloader.htm
;
; modified by Edorul:
; EEPROM write is only compatible with "Tiny PIC Bootloader+"
; http://sourceforge.net/projects/tinypicbootload/
;*********
Not compatible with tinybldlin / tinybldwin this firmware.
Write Format EEPROM has changed.
If you were using the tinybldlin, please use the tinybld18F4620_zigbee.asm that is attached to the tinybld198.
no success. i downloaded modified and programmed the file you suggested but i still had the same result.
even if i used 'Tiny_Avr-Pic_Bootloader+.exe' with the file above it still would not program and the program would freeze.
in the meantime i got ds30loader to work it does have a larger footprint though. i will return one day to figure out tiny pic bootloader.
thank you for your help