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

16F876A + bootloader

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



Joined: 28 Feb 2006
Posts: 151

View user's profile Send private message

16F876A + bootloader
PostPosted: Tue Sep 11, 2012 1:29 pm     Reply with quote

Hi! I'm trying to use the bootloader provided by ccs on a 16F876A.

I have used it with no problem on a 18F252, 18F258, 18F2680, 18F2685 and 18F2682.

But i cant make it work on a 16F876A.

At first i got the "out of rom" message, so i just change the values on the org and loader_end and loader_size...

Then compile OK, and the bootloader worked and load the program into flash using siow, but the program never started...

What are the values that i have to change in ORG, loader_end and loader size to get the bootloader to work?


thanks!
championx



Joined: 28 Feb 2006
Posts: 151

View user's profile Send private message

PostPosted: Thu Sep 13, 2012 6:19 am     Reply with quote

Someone? please, I really need help... I have tried everything but I can't make it work.

thanks!
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Sep 13, 2012 12:53 pm     Reply with quote

Quote:
At first i got the "out of rom" message, so i just change the values on the
org and loader_end and loader_size...


1. Post a list of the changes that you made. Post the changed lines.
Don't post the whole files, such as bootloader.h, loader.c, ex_bootloader.c.
We already have them. Just post the changes that you made.

2. Post your CCS compiler version.

3. Post if you are testing this in real hardware, or is this Proteus ?
championx



Joined: 28 Feb 2006
Posts: 151

View user's profile Send private message

PostPosted: Thu Sep 13, 2012 1:10 pm     Reply with quote

Thanks for the answer PCM programmer

1-
Code:
#if defined(__PCM__)
#include <16F876A.h>
#fuses XT,NOWDT,NOPROTECT,NOLVP
#use delay(clock=4000000)


Just the PIC, XTal fuse and the delay definition.

2- I have tested it with the 4.057 and the 4.120, same results.

3- Im testing in real hardware. Working hardware.

If i burn the firmware (not the bootloader) directly into the pic, the program work ok. But if i load it with the bootloader (first include the bootloader.h file) then, it load the firmware but doesnt work.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Sep 13, 2012 1:18 pm     Reply with quote

Are you using Ex_bootloader.c for your testing ? Is that the file you are
compiling ?
championx



Joined: 28 Feb 2006
Posts: 151

View user's profile Send private message

PostPosted: Thu Sep 13, 2012 1:19 pm     Reply with quote

yes, sorry i didnt told you that.

Im using ex_bootloader.c
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Sep 14, 2012 1:14 pm     Reply with quote

I don't have a 16F876A, so I tested it with a 16F877A. It worked.
I used your compiler vs. 4.120, which is your version.

The only changes I made to Ex_bootloader.c and Ex_bootload.c were
to change 16F877.h to 16F877A.h (in both files). My PicStart-Plus board
has a 20 MHz crystal on it, so I left the #use delay() and HS fuse unchanged.

I compiled both programs, and then I programmed the HEX file for
Ex_bootloader.c into the 16F877A.

Then I un-plugged my ICD3 programmer from the board.

Then I carefully followed the instructions in this post:
http://www.ccsinfo.com/forum/viewtopic.php?t=40920&start=1

After TeraTerm finished sending Ex_bootload.hex to the board, then
it immediately started to display the output of that program, which
proves that it's running on the PIC:
Quote:

Application program version 1.00
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
105 106 107 108 etc.
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