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 CCS Technical Support

Tiny Pic bootloader + Pic16F886

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



Joined: 29 Dec 2013
Posts: 3

View user's profile Send private message

Tiny Pic bootloader + Pic16F886
PostPosted: Sun Feb 15, 2015 9:06 am     Reply with quote

Hi everybody.
I want to develop a small dev. board using PIC 16F886. Because I will use serial port a lot I was thinking to load into the PIC a bootloader to be able to program it using the same protocol. Since I have never used a bootloader I want you guys to help me.

I read a lot about bootloaders and I decided to use Tiny pic bootloader because is small and it seems to be very popular among pic developers.
But there are some things that I dont understand:

1. When I opened an bootloader asm file I saw that are some configuration bits settings. That settings are used only by bootloader? After the bootloader loads the program the CONFIG regs. will be rewritten by my program settings?

2.Can anyone give an example of CCS code that was loaded into pic using that bootloader? I dont know how to set the reset vector and the org.

3.Since my computer does not have a serial port can I use a CP2012 serial to ttl adapter?

Thank you in advance.
Ttelmah



Joined: 11 Mar 2010
Posts: 19477

View user's profile Send private message

PostPosted: Sun Feb 15, 2015 1:03 pm     Reply with quote

Look at the example bootloader supplied with the compiler.
This shows how to do the settings. You can use the bootloader.h supplied with this, with any bootloader. Just change the size settings to match the booloader you are using, and have your application setup like 'bootload.c' which shows how to compile a program to be used with a bootloader.

The CONFIG fuses used by the bootloader must match that used by your main code. If the bootloader changed the fuses, then it'd no longer run, and would just be wasted space in the chip. Most bootloaders do not reprogram the CONFIG, to avoid this happening.

Yes, a serial adapter is commonly used.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Feb 15, 2015 1:17 pm     Reply with quote

Do a forum search for: tinybootloader
Examples:
http://www.ccsinfo.com/forum/viewtopic.php?t=27214
http://www.ccsinfo.com/forum/viewtopic.php?t=44485
Scolioza



Joined: 29 Dec 2013
Posts: 3

View user's profile Send private message

PostPosted: Mon Feb 16, 2015 7:29 am     Reply with quote

It works !!!! without any modification in CCS... But I must take into account the size of the code for not overwriting the bootloader.


Thank you all.

PS. If someone is interested, in the asm file provided for the PIC16F886, the MCLRE bit in CONFIG1 reg is set off. If you want to use the bootloader with manual reset you have to set it on.

Again thank you all
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