Electronic Components Datasheet Search
  New Zealand  ▼
ALLDATASHEET.CO.NZ

X  

PIC18F010T-I/P Datasheet(PDF) 94 Page - Microchip Technology

Part # PIC18F010T-I/P
Description  High Performance Microcontrollers
PDF  176 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  MICROCHIP [Microchip Technology]
Direct Link  http://www.microchip.com
Logo MICROCHIP - Microchip Technology

PIC18F010T-I/P Datasheet(HTML) 94 Page - Microchip Technology

Back Button PIC18F010T-I/P Datasheet HTML 90Page - Microchip Technology PIC18F010T-I/P Datasheet HTML 91Page - Microchip Technology PIC18F010T-I/P Datasheet HTML 92Page - Microchip Technology PIC18F010T-I/P Datasheet HTML 93Page - Microchip Technology PIC18F010T-I/P Datasheet HTML 94Page - Microchip Technology PIC18F010T-I/P Datasheet HTML 95Page - Microchip Technology PIC18F010T-I/P Datasheet HTML 96Page - Microchip Technology PIC18F010T-I/P Datasheet HTML 97Page - Microchip Technology PIC18F010T-I/P Datasheet HTML 98Page - Microchip Technology Next Button
Zoom Inzoom in Zoom Outzoom out
 94 / 176 page
background image
PIC18F010/020
DS41142A-page 92
Preliminary
 2001 Microchip Technology Inc.
12.4
Secured Access Registers
This device contains programming options for safety
critical peripherals. Because these safety critical
peripherals can be programmed in software, the regis-
ters used to control these peripherals should be given
limited access by the user’s code. This way, errant
code won’t accidentally change settings in peripherals
that could cause catastrophic results.
The registers that are considered safety critical are the
Watchdog Timer Control register (WDTCON), the Low
Voltage Detect register (LVDTCON), and the Oscillator
Control register (OSCCON).
12.4.1
COMBINATION LOCK MODULE
Access is limited
to using the
Combination Lock
module.
Two bits called Combination Lock (CMLK) bits are
located in the lower two bits of the PSPCON register.
These two bits, and only these two bits, must be set in
sequence by the user’s code.
The Combination Lock bits must be set sequentially,
meaning that as soon as Combination Lock bit 1 is set,
the second Combination Lock bit must be set on the
following instruction cycle. If the user waits more than
one machine cycle to set the second bit after setting the
first, both bits will automatically be cleared in hardware,
and the lock will remain closed.
Each instruction must only modify one combination
lock bit at a time. This means that the first write to the
register will write the CMLK1 to a ’1’, but CMLK0 will
equal ’0’. The second write will only modify CMLK0.
This means that the data written to the PSPCON regis-
ter will have CMLK1 set to a ’1’ and CMLK0 set to a ’1’.
This leaves CMLK1 unmodified. This will restrict at
least one of the instructions used to modify this register
to a BSF of the PSPCON register. This will restrict the
combination of instructions that will allow the lock to be
opened, so that random code execution in the event of
a software fault, will not cause the lock to be acciden-
tally opened. The BSF instruction limitation will also
prevent random code from setting both bits at the same
time via a MOVWF instruction, since they are located in
the same register.
When each bit is set and the combination lock is
opened, the user will have three instruction cycles to
modify the safety critical register of his choice. After
three cycles have expired, the CMLK bits are cleared,
the lock will close, and the user will have to set the
CMLK bits in sequence again, in order to open the lock.
Thus, for each attempt to modify a safety critical regis-
ter, the combination lock must be opened before the
register can be written to. The reason that three instruc-
tion cycles were chosen for the unlock time was to
allow the user to put the "unlock" code in a subroutine
call. This way, the user’s code will only have one
instance of the code that is used to unlock the module.
The user would first set up the WREG register with the
desired data to load into a secured register, then call a
subroutine that contains the two BSF instructions, return
from the routine, and modify the secured register.
Note:
The Combination lock bits are write only
bits. These bits will always return ‘0’ when
read.
;Setup WREG with data to be stored
; in a safety critical register
MAIN
MOVLW
0x5A
CALL
UNLOCK
;Write must take place on next
;instruction cycle
MOVWF
OSCCON, 0
.
.
.
UNLOCK
BSF
PSPCON, CMLK1, 0
BSF
PSPCON, CMLK0, 0
RETURN



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100  ...More


Datasheet Download

Go To PDF Page


Link URL



Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Contact us   |   Privacy Policy   |   Link to Datasheet    |   Link Exchange   |   Manufacturer List
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com