Diego Herranz | 10 Apr 2012 00:48

[PIC16] Another way to read/write EEPROM?

Hi!


I had always used a library with the following functions to read/write eeprom memory:

uint8_t eeprom_read(uint8_t address);
void eeprom_write(uint8_t address, uint8_t value);
uint8_t eeprom_write_and_verify(uint8_t address, uint8_t value);

Reading the SDCC manual again, I started thinking that it may also be done using pointers without needing this functions. Can it be done? If yes, how?

Thank you very much
------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
Sdcc-user mailing list
Sdcc-user@...
https://lists.sourceforge.net/lists/listinfo/sdcc-user
forrester | 10 Apr 2012 14:41
Picon
Favicon

BUG REPORTING Bug into SD­CC MSC-51 codegenerator

SDCC revision 7520

;--------------------------------------------------------
; File Created by SDCC : free open source ANSI-C Compiler
; Version 3.1.4 #7520 (Mar 31 2012) (MINGW32)
; This file was generated Fri Apr 06 04:20:22 2012
;--------------------------------------------------------
	.module I2C_DBGN
	.optsdcc -mmcs51 --model-small

Source code:

void Compl8b (__idata U8 *p8) //__reentrant
{
*p8 = ~(*p8);
p8++;
*p8 = ~(*p8);
p8++;
*p8 = ~(*p8);
p8++;
*p8 = ~(*p8);
p8++;
(*(p8)) = ~(*(p8));
p8++;
(*(p8)) = ~(*(p8));
p8++;
(*(p8)) = ~(*(p8));
p8++;
(*(p8)) = ~(*(p8));
p8++;
}

Asm output:
NO variable load after pointer changes!!
See below:

;------------------------------------------------------------
;Allocation info for local variables in function 'Compl8b'
;------------------------------------------------------------
;p8                        Allocated to registers r1 
;------------------------------------------------------------
	G$Compl8b$0$0 ==.
	C$I2C_DBGN.c$4746$1$439 ==.
;	C:\\PC104_T1\\I2C_DBGN.c:4746: void Compl8b (__idata U8 *p8) //__reentrant
;	-----------------------------------------
;	 function Compl8b
;	-----------------------------------------
_Compl8b:
	push	ar7
	push	ar1
	mov	r1,dpl
	C$I2C_DBGN.c$4748$1$446 ==.
;	C:\\PC104_T1\\I2C_DBGN.c:4748: *p8 = ~(*p8);
	mov	a, <at> r1
	cpl	a
	mov	r7,a
	mov	 <at> r1,a
	inc	r1
	C$I2C_DBGN.c$4749$1$446 ==.
;	C:\\PC104_T1\\I2C_DBGN.c:4749: p8++;
	C$I2C_DBGN.c$4750$1$446 ==.
;	C:\\PC104_T1\\I2C_DBGN.c:4750: *p8 = ~(*p8);
	mov	a,r7
	cpl	a
	mov	r7,a
	mov	 <at> r1,a
	inc	r1
	C$I2C_DBGN.c$4751$1$446 ==.
;	C:\\PC104_T1\\I2C_DBGN.c:4751: p8++;
	C$I2C_DBGN.c$4752$1$446 ==.
;	C:\\PC104_T1\\I2C_DBGN.c:4752: *p8 = ~(*p8);
	mov	a,r7
	cpl	a
	mov	r7,a
	mov	 <at> r1,a
	inc	r1
	C$I2C_DBGN.c$4753$1$446 ==.
;	C:\\PC104_T1\\I2C_DBGN.c:4753: p8++;
	C$I2C_DBGN.c$4754$1$446 ==.
;	C:\\PC104_T1\\I2C_DBGN.c:4754: *p8 = ~(*p8);
	mov	a,r7
	cpl	a
	mov	r7,a
	mov	 <at> r1,a
	inc	r1
	C$I2C_DBGN.c$4755$1$446 ==.
;	C:\\PC104_T1\\I2C_DBGN.c:4755: p8++;
	C$I2C_DBGN.c$4756$1$446 ==.
;	C:\\PC104_T1\\I2C_DBGN.c:4756: (*(p8)) = ~(*(p8));
	mov	a,r7
	cpl	a
	mov	r7,a
	mov	 <at> r1,a
	inc	r1
	C$I2C_DBGN.c$4757$1$446 ==.
;	C:\\PC104_T1\\I2C_DBGN.c:4757: p8++;
	C$I2C_DBGN.c$4758$1$446 ==.
;	C:\\PC104_T1\\I2C_DBGN.c:4758: (*(p8)) = ~(*(p8));
	mov	a,r7
	cpl	a
	mov	r7,a
	mov	 <at> r1,a
	inc	r1
	C$I2C_DBGN.c$4759$1$446 ==.
;	C:\\PC104_T1\\I2C_DBGN.c:4759: p8++;
	C$I2C_DBGN.c$4760$1$446 ==.
;	C:\\PC104_T1\\I2C_DBGN.c:4760: (*(p8)) = ~(*(p8));
	mov	a,r7
	cpl	a
	mov	r7,a
	mov	 <at> r1,a
	inc	r1
	C$I2C_DBGN.c$4761$1$446 ==.
;	C:\\PC104_T1\\I2C_DBGN.c:4761: p8++;
	C$I2C_DBGN.c$4762$1$446 ==.
;	C:\\PC104_T1\\I2C_DBGN.c:4762: (*(p8)) = ~(*(p8));
	mov	a,r7
	cpl	a
	mov	 <at> r1,a
	C$I2C_DBGN.c$4763$1$446 ==.
;	C:\\PC104_T1\\I2C_DBGN.c:4763: p8++;
	pop	ar1
	pop	ar7
	C$I2C_DBGN.c$4764$1$446 ==.
	XG$Compl8b$0$0 ==.
	ret
;	eliminated unneeded push/pop ar0

------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
Maarten Brock | 10 Apr 2012 15:31
Picon

Re: BUG REPORTING Bug into SD­CC MSC-51 codegenerator

Please send this bug report to the SDCC bug tracker instead of informing
the users of it. The users can/will not fix it and the developers, if they
happen to see it, will forget it.

http://sourceforge.net/tracker/?group_id=599&atid=100599

Maarten

> SDCC revision 7520
>
> ;--------------------------------------------------------
> ; File Created by SDCC : free open source ANSI-C Compiler
> ; Version 3.1.4 #7520 (Mar 31 2012) (MINGW32)
> ; This file was generated Fri Apr 06 04:20:22 2012
> ;--------------------------------------------------------
> 	.module I2C_DBGN
> 	.optsdcc -mmcs51 --model-small
>
> Source code:
>
> void Compl8b (__idata U8 *p8) //__reentrant
> {
> *p8 = ~(*p8);
> p8++;
> *p8 = ~(*p8);
> p8++;
> *p8 = ~(*p8);
> p8++;
> *p8 = ~(*p8);
> p8++;
> (*(p8)) = ~(*(p8));
> p8++;
> (*(p8)) = ~(*(p8));
> p8++;
> (*(p8)) = ~(*(p8));
> p8++;
> (*(p8)) = ~(*(p8));
> p8++;
> }
>
> Asm output:
> NO variable load after pointer changes!!
> See below:
>
> ;------------------------------------------------------------
> ;Allocation info for local variables in function 'Compl8b'
> ;------------------------------------------------------------
> ;p8                        Allocated to registers r1
> ;------------------------------------------------------------
> 	G$Compl8b$0$0 ==.
> 	C$I2C_DBGN.c$4746$1$439 ==.
> ;	C:\\PC104_T1\\I2C_DBGN.c:4746: void Compl8b (__idata U8 *p8)
> //__reentrant
> ;	-----------------------------------------
> ;	 function Compl8b
> ;	-----------------------------------------
> _Compl8b:
> 	push	ar7
> 	push	ar1
> 	mov	r1,dpl
> 	C$I2C_DBGN.c$4748$1$446 ==.
> ;	C:\\PC104_T1\\I2C_DBGN.c:4748: *p8 = ~(*p8);
> 	mov	a, <at> r1
> 	cpl	a
> 	mov	r7,a
> 	mov	 <at> r1,a
> 	inc	r1
> 	C$I2C_DBGN.c$4749$1$446 ==.
> ;	C:\\PC104_T1\\I2C_DBGN.c:4749: p8++;
> 	C$I2C_DBGN.c$4750$1$446 ==.
> ;	C:\\PC104_T1\\I2C_DBGN.c:4750: *p8 = ~(*p8);
> 	mov	a,r7
> 	cpl	a
> 	mov	r7,a
> 	mov	 <at> r1,a
> 	inc	r1
> 	C$I2C_DBGN.c$4751$1$446 ==.
> ;	C:\\PC104_T1\\I2C_DBGN.c:4751: p8++;
> 	C$I2C_DBGN.c$4752$1$446 ==.
> ;	C:\\PC104_T1\\I2C_DBGN.c:4752: *p8 = ~(*p8);
> 	mov	a,r7
> 	cpl	a
> 	mov	r7,a
> 	mov	 <at> r1,a
> 	inc	r1
> 	C$I2C_DBGN.c$4753$1$446 ==.
> ;	C:\\PC104_T1\\I2C_DBGN.c:4753: p8++;
> 	C$I2C_DBGN.c$4754$1$446 ==.
> ;	C:\\PC104_T1\\I2C_DBGN.c:4754: *p8 = ~(*p8);
> 	mov	a,r7
> 	cpl	a
> 	mov	r7,a
> 	mov	 <at> r1,a
> 	inc	r1
> 	C$I2C_DBGN.c$4755$1$446 ==.
> ;	C:\\PC104_T1\\I2C_DBGN.c:4755: p8++;
> 	C$I2C_DBGN.c$4756$1$446 ==.
> ;	C:\\PC104_T1\\I2C_DBGN.c:4756: (*(p8)) = ~(*(p8));
> 	mov	a,r7
> 	cpl	a
> 	mov	r7,a
> 	mov	 <at> r1,a
> 	inc	r1
> 	C$I2C_DBGN.c$4757$1$446 ==.
> ;	C:\\PC104_T1\\I2C_DBGN.c:4757: p8++;
> 	C$I2C_DBGN.c$4758$1$446 ==.
> ;	C:\\PC104_T1\\I2C_DBGN.c:4758: (*(p8)) = ~(*(p8));
> 	mov	a,r7
> 	cpl	a
> 	mov	r7,a
> 	mov	 <at> r1,a
> 	inc	r1
> 	C$I2C_DBGN.c$4759$1$446 ==.
> ;	C:\\PC104_T1\\I2C_DBGN.c:4759: p8++;
> 	C$I2C_DBGN.c$4760$1$446 ==.
> ;	C:\\PC104_T1\\I2C_DBGN.c:4760: (*(p8)) = ~(*(p8));
> 	mov	a,r7
> 	cpl	a
> 	mov	r7,a
> 	mov	 <at> r1,a
> 	inc	r1
> 	C$I2C_DBGN.c$4761$1$446 ==.
> ;	C:\\PC104_T1\\I2C_DBGN.c:4761: p8++;
> 	C$I2C_DBGN.c$4762$1$446 ==.
> ;	C:\\PC104_T1\\I2C_DBGN.c:4762: (*(p8)) = ~(*(p8));
> 	mov	a,r7
> 	cpl	a
> 	mov	 <at> r1,a
> 	C$I2C_DBGN.c$4763$1$446 ==.
> ;	C:\\PC104_T1\\I2C_DBGN.c:4763: p8++;
> 	pop	ar1
> 	pop	ar7
> 	C$I2C_DBGN.c$4764$1$446 ==.
> 	XG$Compl8b$0$0 ==.
> 	ret
> ;	eliminated unneeded push/pop ar0
>
> ------------------------------------------------------------------------------
> Better than sec? Nothing is better than sec when it comes to
> monitoring Big Data applications. Try Boundary one-second
> resolution app monitoring today. Free.
> http://p.sf.net/sfu/Boundary-dev2dev
> _______________________________________________
> Sdcc-user mailing list
> Sdcc-user@...
> https://lists.sourceforge.net/lists/listinfo/sdcc-user
>
>

------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
Raphael Neider | 14 Apr 2012 23:59
Picon

Re: [PIC16] Another way to read/write EEPROM?

Hi,

> I had always used a library with the following functions to read/write
> eeprom memory:
>
> uint8_t eeprom_read(uint8_t address);
> void eeprom_write(uint8_t address, uint8_t value);
> uint8_t eeprom_write_and_verify(uint8_t address, uint8_t value);
>
> Reading the SDCC manual again, I started thinking that it may also be done
> using pointers without needing this functions. Can it be done? If yes, how?

It is planned (but obviously not yet implemented) to allow access to
EEPROM via the generic pointer mechanism. EEPROM would be mapped into
the generic address space at 0x40.0000..0x7F.FFFF; 0x00.0000-0x3F.FFFF
is code/program memory, 0x40.0000-0x7F.FFFF is supposed to be EEPROM,
and 0x80.0000-0xFF.FFFF is data memory. Once this feature is
implemented, access to EEPROM is as simple as

uint8_t __at(0x400000) eeprom_start;
uint8_t * const eeprom = &eeprom_start;

uint8_t eeprom_read(uint8_t address) {
  return eeprom[address];
}

void eeprom_write(uint8_t address, uint8_t value) {
  eeprom[address] = value;
}

uint8_t eeprom_write_and_verify(uint8_t address, uint8_t value) {
  volatile uint8_t *ee = (volatile uint8_t *)eeprom;
  ee[value] = value;
  return (ee[value] ^ value); /* or whatever is desired for verification */
}

If desired, I can try to implement this. Basically, adjustments need
to be done in two places: device/lib/pic16/libsdcc/gptr/*.c must
certainly be adjusted to actually implement EEPROM access, and
src/pic16/gen.c must probably be adjusted to generate EEPROM access on
certain pointer dereferences. One might want to introduce/enable some
keyword (__eeprom?) to allocate objects in EEPROM space like
__eeprom uint8_t in_eeprom; /* initialisers will be more difficult */
but that may not be too urgent.

Best regards
Raphael

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
Diego Herranz | 16 Apr 2012 11:43

Re: [PIC16] Another way to read/write EEPROM?

Hi Raphael!


Accesing via generic pointers would be amazing. If you had time, I would love to see it implemeted.
The __eeprom keyword can wait, hehe!

Maybe I could help you with implementation of eeprom reads and writes. I could start with device/lib/pic16/libsdcc/gptr/*.c which I think that I understand, and send the patch to you so you can check if it's ok. I don't know what to do in src/pic16/gen.c, though.

After reading the code in the repository, I think that code memory reads via pointers are implemented but code memory writes are not, right?

Thank you very much.

On Sat, Apr 14, 2012 at 11:59 PM, Raphael Neider <rneider-S0/GAf8tV78@public.gmane.org> wrote:
Hi,

> I had always used a library with the following functions to read/write
> eeprom memory:
>
> uint8_t eeprom_read(uint8_t address);
> void eeprom_write(uint8_t address, uint8_t value);
> uint8_t eeprom_write_and_verify(uint8_t address, uint8_t value);
>
> Reading the SDCC manual again, I started thinking that it may also be done
> using pointers without needing this functions. Can it be done? If yes, how?

It is planned (but obviously not yet implemented) to allow access to
EEPROM via the generic pointer mechanism. EEPROM would be mapped into
the generic address space at 0x40.0000..0x7F.FFFF; 0x00.0000-0x3F.FFFF
is code/program memory, 0x40.0000-0x7F.FFFF is supposed to be EEPROM,
and 0x80.0000-0xFF.FFFF is data memory. Once this feature is
implemented, access to EEPROM is as simple as

uint8_t __at(0x400000) eeprom_start;
uint8_t * const eeprom = &eeprom_start;

uint8_t eeprom_read(uint8_t address) {
 return eeprom[address];
}

void eeprom_write(uint8_t address, uint8_t value) {
 eeprom[address] = value;
}

uint8_t eeprom_write_and_verify(uint8_t address, uint8_t value) {
 volatile uint8_t *ee = (volatile uint8_t *)eeprom;
 ee[value] = value;
 return (ee[value] ^ value); /* or whatever is desired for verification */
}

If desired, I can try to implement this. Basically, adjustments need
to be done in two places: device/lib/pic16/libsdcc/gptr/*.c must
certainly be adjusted to actually implement EEPROM access, and
src/pic16/gen.c must probably be adjusted to generate EEPROM access on
certain pointer dereferences. One might want to introduce/enable some
keyword (__eeprom?) to allocate objects in EEPROM space like
__eeprom uint8_t in_eeprom; /* initialisers will be more difficult */
but that may not be too urgent.

Best regards
Raphael

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
Sdcc-user mailing list
Sdcc-user-5NWGOfrQmnetEtDZOKyKiw@public.gmane.orgrge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
Sdcc-user mailing list
Sdcc-user@...
https://lists.sourceforge.net/lists/listinfo/sdcc-user
Raphael Neider | 16 Apr 2012 19:41
Picon

Re: [PIC16] Another way to read/write EEPROM?

Hi,

> Maybe I could help you with implementation of eeprom reads and writes. I
> could start with device/lib/pic16/libsdcc/gptr/*.c which I think that I
> understand, and send the patch to you so you can check if it's ok. I don't
> know what to do in src/pic16/gen.c, though.

Don't bother -- I already hacked gptrget[1234].c to support EEPROM
reads; EEPROM writes are similar.
I just need to cheat a bit so that either all devices have a (fake)
EEADRH register or I need to provide two sets of gptr*.c (one without
EEADRH and one with EEADRH) and select the correct one by magic.

> After reading the code in the repository, I think that code memory reads via
> pointers are implemented but code memory writes are not, right?

That's right. EEPROM, however, will see full read/write support.
Wouldn't make much sense without write support, would it ;-).

I'll report back once something EEPROM-related might actually work.

Raphael

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
Diego Herranz | 17 Apr 2012 10:59

Re: [PIC16] Another way to read/write EEPROM?

Great!


I started the implementation of gptr/*.c and I had the same doubt: what to do with EEADRH.
Let us know how you do it eventually.

Thanks for all your help.

Diego

On Mon, Apr 16, 2012 at 7:41 PM, Raphael Neider <rneider-S0/GAf8tV78@public.gmane.org> wrote:
Hi,

> Maybe I could help you with implementation of eeprom reads and writes. I
> could start with device/lib/pic16/libsdcc/gptr/*.c which I think that I
> understand, and send the patch to you so you can check if it's ok. I don't
> know what to do in src/pic16/gen.c, though.

Don't bother -- I already hacked gptrget[1234].c to support EEPROM
reads; EEPROM writes are similar.
I just need to cheat a bit so that either all devices have a (fake)
EEADRH register or I need to provide two sets of gptr*.c (one without
EEADRH and one with EEADRH) and select the correct one by magic.

> After reading the code in the repository, I think that code memory reads via
> pointers are implemented but code memory writes are not, right?

That's right. EEPROM, however, will see full read/write support.
Wouldn't make much sense without write support, would it ;-).

I'll report back once something EEPROM-related might actually work.

Raphael

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
Sdcc-user mailing list
Sdcc-user-5NWGOfrQmnetEtDZOKyKiw@public.gmane.orgrge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
Sdcc-user mailing list
Sdcc-user@...
https://lists.sourceforge.net/lists/listinfo/sdcc-user
Raphael Neider | 20 Apr 2012 01:05
Picon

Re: [PIC16] Another way to read/write EEPROM?

Hi,

starting with svn 7610, sdcc/pic16 allows read/write access EEPROM via
generic pointers in the range of 0x40_0000 to 0x7F_FFFF (though only
the one or two least significant byte(s) are actually used to index
into the EEPROM). Devices that do not have any EEPROM will silently
ignore EEPROM accesses, reads will return random values. Also note
that interrupts are disabled during EEPROM accesses and that writes
wait for the end of the EEPROM write by polling EECON1.WR after each
byte while interrupts are still disabled. This seems to be the safest
and simplest approach; safe improvements are welcome.

!!! THE CODE IS COMPLETELY UNTESTED. IT COMPILES FOR ME, BUT THERE ARE
NO GUARANTEES WHATSOEVER BEYOND THAT !!!

In order to accomodate the different device types (no EEPROM, 8-bit
EEPROM range, 16-bit EEPROM range (via EEADRH)), generic pointer
access to EEPROM is a bit involved:
device/lib/pic16/libsdcc/gptr/gptr{get,put}[1234].c branches off to
device-specific EEPROM dispatcher routine defined in either
(a) device/non-free/lib/pic16/libdev/gptr/dispatch.S (returns immediately)
(b) device/non-free/lib/pic16/libdev/gptr/eeprom8_*_dispatch.S (jumps
on to __eeprom8_* to access 8-bit EEPROMs using EEADR only)
(c) device/non-free/lib/pic16/libdev/gptr/eeprom16_*_dispatch.S (jumps
on to __eeprom16_* to access 16-bit EEPROMs using EEADRH:EEADR)
The __eeprom{8,16}_gptr{get,put}[1234] routines are again defined in
device/lib/pic16/libsdcc/gptr/eeprom{8,16}_gptr{get,put}[1234].c and
included in libsdcc, but are linked into the final executable only
when referenced, and each device library references only one set of
these (either eeprom8 or eeprom16).

Writing to EEPROM is rather longish, so I factored the relevant code
out into device/lib/pic16/libsdcc/gptr/eeprom{8,16}_write.c and call
it from eeprom{8,16}_gptrput[1234].c

The indirection via dispatchers requires two GOTOs (4 cycles) where
one BRA (1 cycle) could suffice iff I provided 3 complete sets of
gptr{get,put}[1234] and linked the proper one into each device lib,
but that would require compiling them for each device separately and
would add more free code to the non-free tree, both of which I wanted
to avoid.

To use, you MUST use an updated sdcc + an updated library (libsdcc,
libdev) and you SHOULD try something like

uint8_t *eeprom = (void *)0x400000;

uint8_t read_eeprom(uint16_t offset)
{
  return eeprom[offset];
}

void write_eeprom(uint16_t offset, uint8_t val)
{
  eeprom[offset] = val;
}

Pitfalls:
* TYPE __at(0x400000) ID = INIT; does not work yet and probably never will
* TYPE __at(0x400000) ID; does not work (yet)
* accessing bitfields in EEPROM does probably not work
* accessing structs in EEPROM via
  (*((struct TAG *)0x400000)).FIELD
  should work (except for bitfields, see above), but is untested
* *((TYPE*)&eeprom[offset]) should work for any primitive TYPE with
sizeof(TYPE) <= 4, including generic pointers (3 byte)

I would like to hear any code review and/or test results.

Raphael

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
Frieder Ferlemann | 20 Apr 2012 08:37
Picon

Re: [PIC16] Another way to read/write EEPROM?

Hi Raphael,

Am 20.04.2012 01:05, schrieb Raphael Neider:
> starting with svn 7610, sdcc/pic16 allows read/write access EEPROM via
> generic pointers in the range of 0x40_0000 to 0x7F_FFFF (though only

Please add a compiler warning for write access (where possible).

It is _very_ easy to get the writes wrong (by concept and
(to a lesser extent) by accident within the application program).

Greetings,
Frieder

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
Diego Herranz | 20 Apr 2012 12:52

Re: [PIC16] Another way to read/write EEPROM?

Thanks Raphael!


I'll try to test it this weekend and I'll let you all know.

Thanks a lot!


On Fri, Apr 20, 2012 at 8:37 AM, Frieder Ferlemann <frieder.ferlemann-S0/GAf8tV78@public.gmane.org> wrote:
Hi Raphael,

Am 20.04.2012 01:05, schrieb Raphael Neider:
> starting with svn 7610, sdcc/pic16 allows read/write access EEPROM via
> generic pointers in the range of 0x40_0000 to 0x7F_FFFF (though only

Please add a compiler warning for write access (where possible).

It is _very_ easy to get the writes wrong (by concept and
(to a lesser extent) by accident within the application program).

Greetings,
Frieder

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
Sdcc-user mailing list
Sdcc-user-5NWGOfrQmnetEtDZOKyKiw@public.gmane.orgrge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
Sdcc-user mailing list
Sdcc-user@...
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Gmane