|
|
View previous topic :: View next topic |
Author |
Message |
rikotech8
Joined: 10 Dec 2011 Posts: 376 Location: Sofiq,Bulgariq
|
Bootloader doesn't work *Solved* |
Posted: Tue Mar 12, 2013 1:33 pm |
|
|
I used the example code: ex_bootloader and modified it to a desired chip and application settings. Here is the code:
Code: |
#include <16F873A.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=16M)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7,ERRORS)
#define _bootloader
#include <bootloader.h>
#include <loader.c>
#org LOADER_END+1,LOADER_END+10
void application(void) {
while(TRUE);
}
#org 0x20,0x3F
void main(void) {
if(!input(PIN_B5))
{
load_program();
}
application();
}
#ORG default
#int_global
void isr(void) {
jump_to_isr(LOADER_END+5*(getenv("BITS_PER_INSTRUCTION")/8));
} |
1. Is there something wrong with the bootloader code?
In the example code is written: Use an RS232 link and the SIOW.EXE program to load a new HEX file into the target chip.
2. How to load the hex file into SIOW.EXE? There is no browse or load hex file or something like that.
Here is the code I want to send via SIOW.EXE:
Code: |
#include <16F873A.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=16M)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7,ERRORS)
#include <bootloader.h>
void main(void)
{
char c;
delay_ms(100);
while (true)
{
c = getc();
putc(c);
}
} |
3. Are these two codes correct and am I at the right direction with creating of a Bootloader project?
I know there is a lot of information about PICs and bootloaders in the Google searches but I am using CCS compiler and CCS firmware thats why I am inquiring you guys.
If you still think I am lazy, just don't answer me plz!
Thank you! _________________ A person who never made a mistake never tried anything new.
Last edited by rikotech8 on Tue Mar 12, 2013 10:43 pm; edited 1 time in total |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9226 Location: Greensville,Ontario
|
|
Posted: Tue Mar 12, 2013 1:41 pm |
|
|
re: #1, #3...
Have you got the CCS supplied examples working yet ???
re: 2)
SIOW will download the program_name.HEX file, NOT the program_name.C file. You MUST download the HEX file (the compiled code) as a PIC only 'understands' machine code.
Within SIOW, go to 'file' menu, select 'download', choose the file you want to send to PIC......
Kinda simple, really even for a 6decade, preDOS guy like me. |
|
|
rikotech8
Joined: 10 Dec 2011 Posts: 376 Location: Sofiq,Bulgariq
|
|
Posted: Tue Mar 12, 2013 1:57 pm |
|
|
temtronic I don't know so good English to thank you!
Man you are Genius.
Everything has been so simple. Both of my codes works perfectly well. I haven't change anything to my codes.
Thank you again temtronic! _________________ A person who never made a mistake never tried anything new. |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|