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
//#*******************************//#//# use MPLABX 1.95//# use xc8 compiler 1.21//# PIC18F4680//# rom 0-0xff00 for program (XC8 linker -> Memory model -> ROM ranges)//#//# iss 13 - uses TinyBootloader//#//#*******************************#include<xc.h>#include<stdlib.h>#include<stdio.h>#include"defines.h"#include"rs232.h"// fuses/*#pragma config IESO = OFF, FCMEN = OFF, OSC = XT#pragma config BOREN = BOHW, PWRT = ON, BORV = 2 // 2.8v BORV = 1 // 4.3V#pragma config WDTPS = 2048, WDT = ON#pragma config PBADEN = OFF, LPT1OSC = OFF, MCLRE = ON#pragma config DEBUG = OFF, XINST = OFF, LVP = OFF, STVREN = ON, BBSIZ = 4096#pragma config CP0 = OFF, CP1 = OFF, CP2 = OFF, CP3 = OFF#pragma config CPD = OFF, CPB = OFF#pragma config WRT0 = OFF, WRT1 = OFF, WRT2 = OFF, WRT3 = OFF#pragma config WRTB = OFF, WRTC = OFF, WRTD = OFF#pragma config EBTR0 = OFF, EBTR1 = OFF, EBTR2 = OFF, EBTR3 = OFF#pragma config EBTRB = OFF*///__EEPROM_DATA(0, 1, 2, 3, 4, 5, 6, 7);//__EEPROM_DATA(0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07);//__EEPROM_DATA(0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F);// global variablesstaticunsignedcharrs232temp;voidinterruptisr(void){if(INT0IE&&INT0IF)// used to calc RPM interval{INT0IE=0;INT0IF=0;return;}if(TMR1IE&&TMR1IF)// 0.25second interval{TMR1IE=0;TMR1IF=0;return;}if(RCIF&&RCIE)// rs232{clear_usart_errors_inline;rs232temp=getch();if(rs232temp=='r')// 0x1B = 'escape' character{putst("rebooting...\n");RESET();}else{putst(" ? \n");}RCIF=0;/* finished */return;}if(TXIF&&TXIE)// switch OFF TXIE{clear_usart_errors_inline;TXIF=0;/* finished */TXIE=0;/* finished */return;}if(TMR2IF&&TMR2IE){TMR2IE=0;TMR2IF=0;return;}if(TMR3IF&&TMR3IE){TMR3IE=0;TMR3IF=0;return;}}//=================================================================================//******************* Main Function *********************voidmain(void){init();Reset_reason();SWDTEN=1;CLRWDT();putst("uses TinyBootloader\n");do{CLRWDT();}while(true);}voidReset_reason(void){putst("\n");if((RCON&0b00000001)==0)putst("Brown out reset\n");if((RCON&0b00000010)==0)putst("Power on reset\n");if((RCON&0b00000100)==0)putst("Power down or sleep\n");if((RCON&0b00001000)==0)putst("Watchdog timeout\n");if((RCON&0b00010000)==0)putst("Reset\n");if((STKPTR&0x40)==0x40)putst("stack underflow\n");if((STKPTR&0x80)==0x80)putst("stack overflow\n");}//*******************************************************************************************//--- initialisationvoidinit(void){//;------------------------------------------------------------------------------//; Set the state of the configuration bits //;------------------------------------------------------------------------------// OSCCON = 0b01111100; //internal oscillator 8MHz// OSCCONOSCCON=0b00000000;//bit 6-4 8MHz, bit3 device running int source, bit2 frequency is stable, bit1-0 Freq set by // OSCTUNEOSCTUNE=0b00000000;// Centred frequency tuned to calibrated freq// PORTA = 0b00000000;// PORTB = 0b00000001;// PORTC = 0b00000111;LATA=0x00;LATB=0x00;LATC=0x00;LATD=0x00;LATE=0x00;TRISA=0b11101011;TRISB=0b11001111;TRISC=0b11011000;TRISD=0b10001111;TRISE=0b00001111;//RS232 - BRGH BRG16TXSTA=0b00100110;//8bit, Async, BRGH = hiRCSTA=0b10010000;//SPEN = pins, CREN = enable receiveBAUDCON=0b00001010;// Wakeup on receive, BRG16//SPBRG = 16; // 115200baudSPBRG=34;// 57600baud//SPBRG = 103; // 19200baud//SPBRG = 207; // 9600baud//ADCADCON0=0b00000000;ADCON1=0b00011110;// Vref = AN3 to Vss, AN0 onlyADCON2=0b10111110;// right justified, 20Tad, Fosc/64// I2CSSPSTAT=0b10000000;// Disabled//SSPCON1 = 0b00000000; // reset before startSSPADD=0x04;// 400kHzSSPCON1=0b00101000;// Enabled, Master mode clock = Fosc/(4*SSPADD+1)SSPCON2=0b00000000;// // Timer1 - set to 0.25sec// TMR1IE = 1; // enable timer 1 interruptT1CON=0b00110001;// 1:8 prescaleTMR1L=0xDB;TMR1H=0x0B;// (((osc /4) /4) /prescaler) = 62500 (FFFF - 62500 = BDB)// Timer2// TMR1IE = 1; // enable timer 1 interruptT2CON=0b01111011;// 1:16 PostScale 1:16 prescale ( = 32.768ms) per tickPR2=0xFF;//// Timer3 - configured as a 16bit counter// TMR1IE = 1; // enable timer 1 interruptT3CON=0b00110000;// 1:8 prescaleTMR3L=0x0000;TMR3H=0x0000;//PIE1=0b00100001;//enabled RCIE, TMR1PIE2=0b00000010;//enabled TMR3PIE3=0b00000000;//enabled INTCON=0b11010000;// enables gie, peie, INT0INTCON2=0b10000000;// INTCON3=0b00000000;// }
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