18F452 code protect
Móczik Gábor
pm at progzmaster.hu
Sun Nov 6 22:00:58 CET 2005
Sáfár Miklós wrote:
> Ez engem is érdekelne !
> Én is elkészítettem a rutint, és arra szerettem volna használni, hogy
> néha frissítem a programot a PIC-ben, de :
> - ha kódvédelem be van kapcsolva minden területre akkor a programozás
> után hogyan olvasom vissza (ellenőrzésképpen) a beírt adatokat ?
Szerintem tblrd-vel vissza tudod olvasni, bar en nem hasznalok
visszaellenorzest.
> - ha letiltom a tblread, és write sávokon átnyúló használatát, akkor én
> sem tudom írni/olvasni csak a legfelső memóriarészt !?
Szvsz, szerintem nem a tblrd es wr tiltasa az erdekes, azt ugyis csak a
programod hasznalja. Inkabb a kulso iras/olvasas ami problemas. Ezt kene
tiltani ugy, hogy belulrol irhato/olvashato maradjon.
Kozben ezt talaltam, ez pont azt tudja ami nekunk kell (ha jol ertelmezem):
19.4.1 PROGRAM MEMORY
CODE PROTECTION
The user memory may be read to or written from any
location using the Table Read and Table Write instructions.
The device ID may be read with Table Reads.
The configuration registers may be read and written
with the Table Read and Table Write instructions.
In User mode, the CPn bits have no direct effect. CPn
bits inhibit external reads and writes. A block of user
memory may be protected from Table Writes if the
WRTn configuration bit is ‘0’. The EBTRn bits control
Table Reads. For a block of user memory with the
EBTRn bit set to ‘0’, a Table Read instruction that
executes from within that block is allowed to read. A
Table Read instruction that executes from a location
outside of that block is not allowed to read, and will
result in reading ‘0’s. Figures 19-4 through 19-6
illustrate Table Write and Table Read protection.
Note: Code protection bits may only be written to
a ‘0’ from a ‘1’ state. It is not possible to
write a ‘1’ to a bit in the ‘0’ state. Code protection
bits are only set to ‘1’ by a full chip
erase or block erase function. The full chip
erase and block erase functions can only
be initiated via ICSP or an external
programmer.
Tehat a CP biteket kell beegetni.
--
((( Móczik Gábor )))--((( hu <- DOT <- progzmaster <- AT <- pm )))
((( Skype: moczik )))--((( Website: http://www.progzmaster.hu )))
More information about the Elektro
mailing list