CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Bootloader doesn't work *Solved*

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
rikotech8



Joined: 10 Dec 2011
Posts: 376
Location: Sofiq,Bulgariq

View user's profile Send private message

Bootloader doesn't work *Solved*
PostPosted: Tue Mar 12, 2013 1:33 pm     Reply with quote

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: 9165
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue Mar 12, 2013 1:41 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Mar 12, 2013 1:57 pm     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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