View previous topic :: View next topic |
Author |
Message |
Scolioza
Joined: 29 Dec 2013 Posts: 3
|
Tiny Pic bootloader + Pic16F886 |
Posted: Sun Feb 15, 2015 9:06 am |
|
|
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
|
|
Posted: Sun Feb 15, 2015 1:03 pm |
|
|
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
|
|
|
Scolioza
Joined: 29 Dec 2013 Posts: 3
|
|
Posted: Mon Feb 16, 2015 7:29 am |
|
|
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 |
|
|
|