PDA

View Full Version : bootloader questions



mischl
- 18th August 2006, 11:36
hello all

i use a bootloader in a project out in the field.
it is a read in from some buttons and send the value out over serial command. now, sometimes it sends obviously always the same code on each button instead a specific one. it seems that it is after a new power up and stays as long as power is supplied...

beside this, some questions for validation. i have tested all before shipping, but just in case :

- this bootloader (16F876a_04.hex) works also on a 16LF876A, or?
- the bootloader waits after power up for some serial stuff. the pic doesn't send out anything by himself if he hasn't received something first, right?
- in the application program, the code below is at begin. the fuse config and the define osc didn't affect the bootloader, or?

thansk a lot for your answers, mischl




Include "modedefs.bas" ' Include serial modes

'-- FUSE CONFIGURATIONS -----------------------------------------

@ device pic16F876a, hs_osc ' oscillator selection
@ device pic16F876a, wdt_off ' watchdog timer
@ device pic16F876a, pwrt_on ' power-up timer
@ device pic16F876a, bod_on ' brown-out reset
@ device pic16F876a, lvp_off ' low-voltage programming
@ device pic16F876a, cpd_off ' data eeprom protection _on
@ device pic16F876a, wrt_off ' flash program memory write
@ device pic16F876a, protect_on ' program code protection _on

'-- DEFINITIONS -------------------------------------------------

Define LOADER_USED 1 ' for bootloader
DEFINE OSC 4

mister_e
- 18th August 2006, 18:11
Config fuses don't affect anything in your code. They must be set manually only when loading the Loader.HEX file the first time.


@ device pic16F876a, hs_osc ' oscillator selection
@ 4MHZ it should be XT... but the default one should already be XT


@ device pic16F876a, bod_on ' brown-out reset
If the application run @3V... it may cause some problem... if it's the application i feel it is... ;)


- this bootloader (16F876a_04.hex) works also on a 16LF876A, or?
Should

- the bootloader waits after power up for some serial stuff. the pic doesn't send out anything by himself if he hasn't received something first, right?
Yup!

mischl
- 20th August 2006, 18:37
hi steve

thans a lot for your answers.

the circuit is at 5volt so no problems with brown out.

a question to the oscillator selection : i burned the 4mhz bootloader with HS set as config fuse. as i read in the datasheet, there is a table with testing at 4mhz of both, hs and xt. is this correct to use hs at 4mhz?

thanks again

mister_e
- 20th August 2006, 20:01
Usually XT is for 4MHZ. I heard some lazy crystal (not resonator) may work better with HS but... there's certainely something better to do prior using HS fuse... well... as now i never have any problem with any 4MHZ crystal i use, and always set XT fuse for that. So is this because of the HS fuse? Maybe yes maybe no. It's sounds to me a bad crytsal or PIC start-up for sure but why? Bad capacitor, bad crystal, HS fuse. The only thing i can suggest is to set to XT and test it. Same problem? Could also be caused by a slow start-up power supply... Power-up timer fuse 'may' help.