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

Tiny bootloader how to?

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








Tiny bootloader how to?
PostPosted: Sun Mar 16, 2008 4:29 am     Reply with quote

Tiny bootloader how to?


Is there any special command there must be in the CCS c file?

I can see that a lot of person have used a lot of special commands, but will it be expected?

My problem is that the pic 2455 the first time load my program and it is running. But after that I can’t get the boot loader work any more.
walterma



Joined: 16 Mar 2008
Posts: 6

View user's profile Send private message

PostPosted: Sun Mar 16, 2008 4:55 pm     Reply with quote

Thats probably because your program is too big. Check the assembler code: if you have some code at the last 1k of program memory so the bootloader will be overwrite.
F
Guest







PostPosted: Mon Mar 17, 2008 9:10 am     Reply with quote

1) There are one major thing’s with the loader that is the size, if the size exceed 200 byte there are problem to load it. I will call it an error in the loader software. But if you can fit your change in the 200 byte there will be no problems.

2) Another thing, the fuses is major, for the 2455 I use:

Code:
CONFIG BOR = OFF
CONFIG FOSC = INTOSC_HS
CONFIG WDT = OFF
CONFIG MCLRE = ON
CONFIG XINST = OFF
CONFIG DEBUG = OFF
CONFIG LVP = OFF


3) If you are using the internal clk in the chip you can do it like that:

This code must be placed first in the loader, just after

Code:
IntrareBootloader

;OSC config 4mhz internal clk!
movlw 0x62  ; bit 7=0|6=1|5=1|4=0|3=0|2=0|1=1|0=0
movwf OSCCON
;OSC config


4)
Some feature in the loader is it can send a command to the pic.

I use this feature to reset the pic just before programming the new code.

This function is called from my timer0 int ewery 200ms, if it pickup 0d82 or 0x52 or ‘R’ it will reset the pic….

Code:
void reset(){
char c;
 if (kbhit()) {
  c=getc();
  if (c == 'R') reset_cpu(); //82 decimal
 }
}


5) good luck.
Guest-Z
Guest







tinybootloader help
PostPosted: Fri Mar 21, 2008 6:55 am     Reply with quote

Can anyone help me setup tiny bootloader for a 16F877A? Exactly what changes are required. I am new at this PIC programming. I don't understand what changes must be made to the .asm code.

Thank you for your kind cooperation
niebla33



Joined: 12 Apr 2008
Posts: 1

View user's profile Send private message

PostPosted: Sat Apr 12, 2008 1:44 pm     Reply with quote

I have had the same problem, and the problem is the load sequence, so => first click "Write flash" on tinybldWin.exe and after switch on the PIC; otherwise the bootlader ONLY works first time.

Here are the steps from zero:

1.- Load the Tiny bootloader to the PIC.
2.- Switch off the PIC.
3.- Start the application "tinybldWin.exe"
4.- click on Check PIC and inmediately switch on your microcontroller => application detects the PIC.

>>>>> The bootloader has been correctly loaded.

5.- As explained here http://www.ccsinfo.com/forum/viewtopic.php?p=64907&sid=b614b44666e35bdfcdabc50e8c176ecd

you MUST add to your CCS program (in main.h for instance) :

#define MAX_FLASH getenv("PROGRAM_MEMORY") //for PICs with 32KB of mem
#define LOADER_SIZE 0xff //tinybld size + a bit more (200 bytes is enough)
#org MAX_FLASH-LOADER_SIZE , MAX_FLASH-1 void boot_loader(void) {}

6.- compile your program normally.
7.- Switch OFF the PIC
8.- start (if it is not) the tinybldWin.exe application and load your PIC firmware file.
9.- click on write flash and inmediately switch on the PIC.

I hope that this will help you...

A.Poveda
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