I spent a lot of time reading PIC documents today. I am full of disjointed
facts, no cross referencing, and a subtle lack of coherency.
The On Chip Debugger Specification document, 51249a.pdf, mentions the
In-Circuit Serial Programming (ICSP) Guide (DS30277). At the Microchip
site this morning, the search engine was down and I could not find
it. Does anyone have a good URL to a copy of DS30277?
I read in 39025.pdf, EEPROM Memory Programming Specification, that the
EEPROM memory is at word address 2100-21FF, and that this can be put into
the HEX files. With some search, I may have produced an .asm file that
makes this happen. Can anyone give a URL for a .hex file which has EEPROM
data in it, or confirm that their programmer will write EEPROM from my .hex
file, URL below?
There is occasionally a reference to "Test Memory". This is mentioned in
paragraph 184.108.40.206 of 39025.pdf. The file "MPLAB IDE\Device\pic16f874.dev"
mentions 2000-20FF as the address for "test memory"
I happen to have a 16F874 part in my project right now. The same part Olin
questioned the need of last summer. This is a limited memory part. The On
Chip Debugger documentation says, in part, that the OCD uses the last 100H
words of memory, but other documents say that it uses the addresses at
1F00-1FFF. Guess what? I programmed code at 1F00-1FFF, read back code
from 0000-1FFF, and I get that code back, without aliasing. I interpret
this to mean that the 16F874 does have 100H words at 1F00-1FFF.
Does anyone know a way to write RAM locations with the In Circuit Serial
With a homebrew OCD, after setting the ICKBUG and BIGBUG registers, BKBUG
in the config word, and have the goto vector at word address 2004 set
correctly, how can I possibly handle PCLATH?
Has anyone made a homebrew OCD to go with their in circuit programmer?
The files in this directory are exploratory. They may not ever make
sense. They may change.
Other files in this directory may be better suited to this discussion.
> The On Chip Debugger Specification document, 51249a.pdf, mentions the
> In-Circuit Serial Programming (ICSP) Guide (DS30277). At the
> site this morning, the search engine was down and I could not find
> it. Does anyone have a good URL to a copy of DS30277?
IIRC these documented used to be on the page fro the chip, but they seem
to have vanished. email me privately for a copy. I assume you want the
one for the 16F874?
> I read in 39025.pdf, EEPROM Memory Programming Specification, that the
> EEPROM memory is at word address 2100-21FF, and that this can
> be put into the HEX files.
This is convention, ot has little to do with the hardware.
> Does anyone know a way to write RAM locations with the In
> Circuit Serial Programmer?
Jan-Erik Soderholm says:
>Hi. Besides of the fact that this isn't possible (as Wouter also pointed
>out), why would one need to do this at all ?
With good enough software, the In Circuit Serial Programmer Host becomes
the On Chip Debugger Host. There only has to be a little more intelligence
on, for example, dropping PGM_Clock, and coordinating data coming from the
One of the first tasks is to write the two RAM locations, ICKBUG and
BIGBUG. If it were possible to do this with simple bit banging on the
PGM_Clock and PGM_Data lines, I would do it that way.
At this point, I have recovered an .asm file that will re-create the .hex
file mentioned earlier. Now, I guess I'll have to put the comments into
it, and see how it does things.
> last 100H words of memory, but other documents say that it uses the
> addresses at 1F00-1FFF. Guess what? I programmed code at 1F00-1FFF,
> read back code from 0000-1FFF, and I get that code back, without
> aliasing. I interpret this to mean that the 16F874 does have 100H words
> at 1F00-1FFF.
Now that is interesting. So program memory is not sacrificed when using
ICD on the smaller parts.
I'll stay tuned to this thread.
-- http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads
part 1 2431 bytes content-type:text/plain; (decoded 7bit)
I think Aubrey may have been confused by the doubling of addresses in the
The DE874.HEX file for use with the ICD that I have loads at 0xF00 through
0xFFF when imported into MPLAB.
I'm not sure how she got non-aliased values from 1F00-1FFF, though.
I am just about completely finished disassembling the entire DE874.HEX file.
I have attached my work so far. The code uses a few neat tricks, but there
are a couple basic things that could be greatly improved.
Bob Blick says:
>Now that is interesting. So program memory is not sacrificed when using
>ICD on the smaller parts.
>I'll stay tuned to this thread.
Another question that I thought of is whether this is "memory" or a
"register," i.e. does it persist after power down. I haven't tested.
At a cost on only 26 or so hours, I have edited the .hex file so that it is
more readable by people. For example, I replaced the phrase "0800" with
the phrase " return," and so forth.
I am certain that I understand how it works, have control over it, and can
use it to do other things.
I decided to email a permission to publish request letter to .....tech.supportKILLspam@firstname.lastname@example.org, just to be clean, and I haven't uploaded this
file. When my ISP is back up :-( I will reconcile my web site and
Has anyone pursued "permission" from Microchip, and are there contacts you
might mail me privately?
It turns out that the code is almost exclusively dedicated to read / write
single bytes which are accessible via FSR and INDF. No program or EEPROM
memory is touched. This, of course, answers my earlier question about
modifying data RAM. The dispatch table has 26 entries, but most of them
jump to "Send_NAK"
The most curious thing that I found was that they use 16H bytes of code to
save an image of the STATUS register. One thing they do is to copy STATUS
(arbitrary bank) to STATUS (bank 3). Although this seems odd, the on chip
debugger document does say that the high and low PORTB registers act
differently. Seen against the tight code space, this effort seems significant.
They also have a macro to "call" a routine and "return" without affecting
the hardware stack, and only consuming 1 RAM location (all in same code page).