PDA

View Full Version : An other newby, an other blinky probem



Maniac
- 22nd September 2005, 16:56
Hello

I've been reading the posts for quite a while. I hoped that I can figure some stuff out by myself... that didn't happen.
I am trying to program an 18f452, with no luck do far. I have PBP, and a picstart+ programmer. Also, I used a bootloader from Martin Dubuc's site. (http://mdubuc.freeshell.org/) I insert the bootloader's hex file using the picstart+ in MPlab, then using the Colt bootloader to program the chip in the circuit. I can load the sample blink.hex file (Martins) no problem, and it works.
When I try to load the hex file generated by pbp, it doesn't.
I checked my .int files, and changed XT to HS, since I am using a 20MHz crystal. I chaned this at the programmer settings as well. I used the code for the blinking led from a book (PIC robotics), from the PBP manual, and from this site. I added the line: define loader_used 1, so the bootloader code is (or should be) protected.
Anyone would have any ideas what else should I try? I don't have much experience with programming or PICs.


thanks, and sorry for an other blinky problem
Attila

mister_e
- 22nd September 2005, 21:19
mmm, what if you skip the bootloader process and dump the PBP .Hex file directly to your PIC without the DEFINE BOOTLOADER_USED 1 ?

Did you also write at the top DEFINE OSC 20 ???

What about your code???

Maniac
- 23rd September 2005, 15:16
I did what you suggested and it worked! Thanks!
I still would like to figure it out why it didn't work with the bootloader. I would like to program the PIC in circuit without taking it out.

Here is the code I used:

define OSC 20 '20MHz crystal

loop:
high PORTB.1 'turn on LED on RB1
low PORTB.0 'turn off LED on RB0
Pause 1000 'wait 1 sec
low PORTB.1 'turn off LED on RB1
high PORTB.0 'turn on LED on RB0
pause 1000 'wait 1 sec
goto loop


thanks again
Attila