View previous topic :: View next topic |
Author |
Message |
John_Lintern
Joined: 30 Sep 2004 Posts: 14
|
Bootloader or In Circuit Serial Programming (ICSP) ? |
Posted: Thu Aug 25, 2005 2:56 am |
|
|
I am using a PIC16F877A which I need to reprogram whilst the PIC remains in circuit.
Which would be the best method to use, the bootloader method or the ICSP method ?
I want to connect my circuit to the RS232 on a PC, without the need for an external programmer like PICStart Plus.
I've tried using the code in the example EX_LOAD.C which uses loader.c.
But then I run out of RAM and ROM.
If its possible I would rather use a few external components on my circuit so I can use ICSP, but I dont know what circuit I need or what software I need to program using ICSP.
I built the 'PIC-PG2C' serial port programmer which I used with the software ICPROG but I cannot get it to work (see http://www.olimex.com/dev).
Can anyone help ?
Thanks |
|
|
valemike Guest
|
|
Posted: Thu Aug 25, 2005 7:50 am |
|
|
The easiest first step is to use ICSP. You simply write one main() statement and your program executes from there.
Later when you get a feel for things, then you can start tinkering with bootloaders.
Honestly, i've never attempted to get a bootloader to run. One day i'll try it, and hopefully it will be painless. |
|
|
Bart
Joined: 12 Jul 2005 Posts: 49
|
Re: Bootloader or In Circuit Serial Programming (ICSP) ? |
Posted: Thu Aug 25, 2005 3:15 pm |
|
|
John_Lintern wrote: | I built the 'PIC-PG2C' serial port programmer which I used with the software ICPROG but I cannot get it to work (see http://www.olimex.com/dev).
|
Hello John_Lintern,
I didn't make this programmer but it took me also 2 week before I had a working one.
The easyest test (to all readers : correct me if I'm wrong) you can start with is to measure if you receive about 13 Volts on pin 1 during programming in ICPROG.
If this is the case, next thing you can measure is the PIN 40 (B7 = Data) and PIN 39 (B6 = Clock). It need to vary between 0 and 5 or to have some value in between.
Last thing can be the settings in ICPROG : I use "Direct I/O" and "I/O delay = 6" (for a 16F877, but as far as I know the same for the A variant)
Hope this helps you a 'bit'
Best greetings. _________________ I like Skype (www.skype.com), my username is BplotM |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1635 Location: Perth, Australia
|
|
Posted: Thu Aug 25, 2005 5:19 pm |
|
|
There are two different forms of bootloaders. Ones that are coresident with you normal code (these consume ram and potentially other resouces) and those that are ships in the night. Either you application has full access to the resources or the loader does. In the later case the loader typically passes control to the application program within a few seconds of power up unless it has been "captured". Once captured it is in full control until "released". When release the application code is given control.
With ships in the night it does not matter how much ram the loader uses because all of it becomes available to your application. You need rom space for the loader (the tiny bootloder requires 100 words of ROM).
The other apporach is to migrate to the PIC18F452 or variants. They are electrically pin compatible but offer more ram / rom and peripherals for the same price _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
|