A Ha!,
I think that did the trick... btw, any idea about that LATH comment I made?
Thanks Steve.
J
A Ha!,
I think that did the trick... btw, any idea about that LATH comment I made?
Thanks Steve.
J
PCLATH = (program counter latch high) = the latch register you write to that
holds the value to be loaded into PCH.
PCH is the high 5-bits of the 13-bit program counter for the 14-bit core. PCL
is the lower 8-bits.
You can't write directly to PCH, so you write to PCLATH. The value you place
in PCLATH gets latched into the program counter high (PCH) when PCL is
written.
All 13-bits of the program counter have to be written simultaneously. That's
the purpose of the PCLATH latch register.
The error you're getting is because you haven't reserved enough space in the
beginning or program memory for the Tiny loader to automatically insert the
CLRF PCLATH instruction.
On return from the loader sub routine PCH needs to be cleared to point to the
program memory in bank 0 where your code is located.
If CLRF PCLATH can't be inserted before GOTO Main, then it would jump back
to program memory in bank 1 instead of bank 0 causing major problems.
As Steve mentioned, inserting DEFINE LOADER_USED 1 takes care of this since
it tells PBP to reserve the first 4 locations for loader use.
I'm having a similar problem using the tinybootloader, but when I use microcode studio's bootloader I don't have any issues.
When using the tiny loader the first time I bootload my program to the chip it works, but I get the following error in the Tinybootloader window:
----------------------
HEX: 9 hours old, INHX32,16Fcode+cfg+eeprom , total=14546 bytes.
Searching for PIC ...
Found:16F 876A/877A
WARNING: PCLATH not initialised before GOTO! ... sucessfully repaired.,
WRITE OK. time:9.203 sec
----------------------
The problem I am having is I can't bootload a new hex file to the chip after this, everytime I try I get the following error:
----------------------
Searching for PIC ...
pic sending unknown data: "K" <> E0h=à
Check baudrate & Start Write while PIC is not sending serial data (e.g. in reset)
ERROR!
---------------------
I would appreciate any advice you may have.
Thanks
I figured out my problem....it always helps to read directions
My problem is that I am using a chip that is constantly sending serial commands so I needed to hold down the chip reset button and release it immeadiatly after I hit "write flash"
This seemed to solve my issue.
Yeah that would do it.
Btw, I still get the PCLATH not initialised before GOTO! ... sucessfully repaired.,
message come up. Not sure what thats about but HEY, it works!
Squib
Bookmarks