Searching \ for '[PIC:] Tiny PIC Bootloader and 18f2620' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=18F
Search entire site for: 'Tiny PIC Bootloader and 18f2620'.

Exact match. Not showing close matches.
PICList Thread
'[PIC:] Tiny PIC Bootloader and 18f2620'
2006\02\15@110901 by Barry Callahan

flavicon
face
I've been working with PICs for a while, with the CCS compiler. It's
been ~8 years since the last time I did any serious work in assembler,
and that was for school.

I'd like to use a bootloader on my target board, so firmware updates can
be done without relying on an ICSP programmer. The board I predominantly
work with has  PIC18F2620 and a 3.686MHz clock, although I'd also like
to eliminate the external clock and go with the internal on-chip oscillator.

I would prefer a bootloader that does not require modification of the
target application code.

I tried CodeLoader, but I couldn't get it to actually let  me write a
program into the 2620.

After a while of trying, I gave up, and went looking again, and came
across the Tiny Bootloader.

One of the pre-assembled images provided with Tiny is a target for the
2620 and a 20 MHz clock. If I use my CCS Mach-X programmer to flash a
2620, I get the following verification error complaining about the
configuration data:

00 02 19 00 00 84 80 00 0F C0 0F E0 0F 00 - Actual Data
FF 32 F9 E0 FF FC FA FF FF FF FF FF FF 00  - Expected Data

BUT - If I stick the chip on a proto board with a 20 MHz clock, it seems
to work correctly.

I tried changing the xtal value to 3686400 and using MPASM to build it,
but it errors out building the configuration data, saying that
_XINST_OFF_4L is undefined.  If I comment that value out of the config
data, the firmware builds just fine. If I use the Mach-X to load the
bootloader, this is the message I get:

00 02 19 00 00 84 C0 00 0F C0 0F E0 0F 00 - Actual Data
FF 32 F9 E0 FF FC BA FF FF FF FF FF FF 00  - Expected Data

Stick the chip on the proto board with a 3.6864 MHz clock, and the
client can talk to the bootloader. I can even use the bootloader to
install a test program.  But the program doesn't work.

The test program I'm using displays a "hello" message and then counts on
the serial port (using printf() and an int8) and blinks an LED on B1.  
The test program works as expected on the 2620 with the pre-assembled
bootloader and a 20MHz clock. Using the modified bootloader that I
assembled myself, it just spits garbage. ( either a never-ending string
of null bytes, or a couple random characters repeating endlessly)

Does anyone have suggestions on things I could do to get Tiny to work
correctly? Or an alternate bootloader to try?

Also, is it mandatory that the config word for the bootloader be
identical to that of the application program?

2006\02\15@112832 by Alan B. Pearce

face picon face
>One of the pre-assembled images provided with Tiny
>is a target for the 2620 and a 20 MHz clock. If I
>use my CCS Mach-X programmer to flash a 2620, I get
>the following verification error complaining about
>the configuration data:
>
>00 02 19 00 00 84 80 00 0F C0 0F E0 0F 00 - Actual Data
>FF 32 F9 E0 FF FC FA FF FF FF FF FF FF 00  - Expected Data

This looks like the difference between the __CONFIG directive and the CONFIG
directive problem that has been talked about here recently.

2006\02\15@150425 by Sergey Dryga

face picon face
Barry Callahan <barryc <at> rjlsystems.com> writes:
> I would prefer a bootloader that does not require modification of the
> target application code.

CCS has a bootloader demo program that works fine.  Look in PICC/examples
folder, I believe the file is ex_bootloader.c
AFAIK, all bottlodaers will require modification of the target application
code, since vectors have to be relocated.  
In CCS modification is limited to 1-2 lines of code.

Sergey


2006\02\16@092105 by Barry Callahan

flavicon
face
subject=Re:[PIC:] Tiny PIC Bootloader and 18f2620
source= http://www.piclist.com/piclist/2006/02/15/150425a.txt?

"AFAIK, all bottlodaers will require modification of the target
application code, since vectors have to be relocated."

Actually, that's not true. CodeLoader and Tiny both overwrite the
interrupt vector(s) with those of the application code. (neither of them
relies on interrupts themselves) The reset vector doesn't get relocated
because you always want the bootloader code to execute first on reset.



---

http://www.piclist.com/member/69.215.194.210
PIC/PICList FAQ: http://www.piclist.com

2006\02\16@095049 by Sergey Dryga

face picon face
Barry Callahan <barryc <at> rjlsystems.com> writes:

>
> subject=Re:[PIC:] Tiny PIC Bootloader and 18f2620
> source= www.piclist.com/piclist/2006/02/15/150425a.txt?
>
> "AFAIK, all bottlodaers will require modification of the target
> application code, since vectors have to be relocated."
>
> Actually, that's not true. CodeLoader and Tiny both overwrite the
> interrupt vector(s) with those of the application code. (neither of them
> relies on interrupts themselves) The reset vector doesn't get relocated
> because you always want the bootloader code to execute first on reset.

Barry, You are right. I should have expressed myself better.  From the
application point of view, it (application) has to relocate reset vector to
allow bootloader to execute on reset.
Sergey


2006\02\16@101526 by Wouter van Ooijen

face picon face
> Barry, You are right. I should have expressed myself better.  
> From the application point of view, it (application) has to
> relocate reset vector to allow bootloader to execute on reset.

Or the bootloader has to be clever (= cheat) and do the relocation for
you.

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products
docent Hogeschool van Utrecht: http://www.voti.nl/hvu


More... (looser matching)
- Last day of these posts
- In 2006 , 2007 only
- Today
- New search...