Searching \ for '[PIC]:16F628 EEPROM write routine' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/microchip/memory.htm?key=eeprom
Search entire site for: '16F628 EEPROM write routine'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]:16F628 EEPROM write routine'
2002\02\04@231601 by Jinx

face picon face
> >What has me head-scratching is the address of 1C compiled
> >for EECON1 with WREN
>
> EECON1 is in bank 1 (9Ch)

Yes, I know. So what do you make of these two lines, compiled
with MPLAB 5.30.00, using its 16F628.inc file

005D  151C                  bsf    0x1C,0x2     ;eecon1,wren
........
0062  149C                   bsf    0x1C,0x1    ;eecon1,wr

Why does the eecon1 in line 5D end up $80 different from
the eecon1 in line 62 ? If anyone has a minute to cut/paste
my code from the original post and compile it I'd like to know
if they get a different result

> The datasheet is just plain wrong from memory!

Then so is their "improved" web shite. If, sorry, when I get
this going I shall drop them a(nother) line about corrections,
much good that it does

> Taken from a recent 'F628 project

Ta ever so

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spam_OUTlistservTakeThisOuTspammitvma.mit.edu with SET PICList DIGEST in the body


2002\02\04@235044 by Tony Nixon

flavicon
picon face
Jinx wrote:
>
> 005D  151C                  bsf    0x1C,0x2     ;eecon1,wren
> ........
> 0062  149C                   bsf    0x1C,0x1    ;eecon1,wr
>
> Why does the eecon1 in line 5D end up $80 different from
> the eecon1 in line 62 ? If anyone has a minute to cut/paste
> my code from the original post and compile it I'd like to know
> if they get a different result

bsf 0x1C,0x2

01 0101 0001 1100

0101  010  0011100  = 0x151C
BSF   0x2  0x1C


bsf 0x1Cm0x2

01 0100 1001 1100

0101  001  0011100  = 0x149C
BSF   0x1  0x1C

--
Best regards

Tony

mICros
http://www.bubblesoftonline.com
.....salesKILLspamspam@spam@bubblesoftonline.com

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservspamKILLspammitvma.mit.edu with SET PICList DIGEST in the body


2002\02\05@010742 by Jinx

face picon face
Thanks Sherlock, I got that ;-)

01  0101  0001  1100  = 0x151C

01  0100  1001  1100  = 0x149C

It's the way 14 bits are spread over 2 bytes and how MPLAB
extracts the 4-digit hex. It just so happens that the effect makes
it look as though the op-code is in the wrong bank

--
http://www.piclist.com hint: To leave the PICList
.....piclist-unsubscribe-requestKILLspamspam.....mitvma.mit.edu


2002\02\07@151801 by Jinx

face picon face
> If you are trying to load values from ram locations defined in
> bank0 you need to do something like this
>
> BCF     STATUS,RP0        ;bank 0
> MOVF    BANK0ADDRESS,W    ;address from bank 0 into w
>........
> BSF     EECON1,WREN       etc...
>
> You could save some bank switching by using the FSR register
> to access one of the bank0 values

You'll see from a post yesterday that's exactly what I'd done. I
stand by my claim that Microchip's documentation is incomplete
and/or misleading. In my view the manufacturer's manual+errata
is not a starting point - it is THE definitive paperwork for that
product, and I begrudge both my own time and the list's time
sorting this out. I have a million things to do and sorting things
like this shouldn't be one of them. There is plenty of empty space
in the manual (and we are the ones that have to print the damn
thing out these days anyway) for user- or factory-submitted
revisions

Mr Grumpy

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


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