amitdandyan
Newbie level 6
Bootloader Problem
I m using PIC18F252....20MHz oscillator....I hv copied the following program from mikroC examples...the hex file is generated successfully(compiled without any error)....bt when i connect PIC using mikroBootloader given in mikroC....following error msg is received....
Error:- Timeout waited for PIC
Disconnected
Port Settings:- Port :- Com 1, Baud Rate-9600, Data bits-8, Stop bits-1, Parity bits-none, flow control- software.
void main() org 32112 {
// 16Mhz --> 103
// 8Mhz --> 51
// 4Mhz --> 25
// |
// |
// | look for asynchronous high speed table
// \ / ------------ ----------
// |
Susart_Init(129); // Init USART at 9600 for 20MHz
if (Susart_Write_Loop('g','r')) { // Send 'g' for ~5 sec, if 'r'
Start_Bootload(); // received start bootload
}
else {
Start_Program() ; // else start program
}
}//~!
Please also explain what is the function of following command:-
if (Susart_Write_Loop('g','r'))
When I checked my output on Hyper terminal or USART terminal of MikroC.... g is displayed continuously.......!!!!!!!!!!!!!!!!!!!!!!
I m using PIC18F252....20MHz oscillator....I hv copied the following program from mikroC examples...the hex file is generated successfully(compiled without any error)....bt when i connect PIC using mikroBootloader given in mikroC....following error msg is received....
Error:- Timeout waited for PIC
Disconnected
Port Settings:- Port :- Com 1, Baud Rate-9600, Data bits-8, Stop bits-1, Parity bits-none, flow control- software.
void main() org 32112 {
// 16Mhz --> 103
// 8Mhz --> 51
// 4Mhz --> 25
// |
// |
// | look for asynchronous high speed table
// \ / ------------ ----------
// |
Susart_Init(129); // Init USART at 9600 for 20MHz
if (Susart_Write_Loop('g','r')) { // Send 'g' for ~5 sec, if 'r'
Start_Bootload(); // received start bootload
}
else {
Start_Program() ; // else start program
}
}//~!
Please also explain what is the function of following command:-
if (Susart_Write_Loop('g','r'))
When I checked my output on Hyper terminal or USART terminal of MikroC.... g is displayed continuously.......!!!!!!!!!!!!!!!!!!!!!!