PIC18C242 MICROCHIP [Microchip Technology], PIC18C242 Datasheet - Page 57

no-image

PIC18C242

Manufacturer Part Number
PIC18C242
Description
High-Performance Microcontrollers with 10-Bit A/D
Manufacturer
MICROCHIP [Microchip Technology]
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC18C242-I/SO
Manufacturer:
MICROCHIP
Quantity:
2 000
Part Number:
PIC18C242/JW
Manufacturer:
NS
Quantity:
10
5.2.2.1
The long write is what actually programs words of data
into the internal memory. When a TBLWT to the MSB of
the write block occurs, instruction execution is halted.
During this time, programming voltage and the data
stored in internal latches is applied to program memory.
For a long write to occur:
1.
2.
3.
If the LWRT bit is clear, a short write will occur and pro-
gram memory will not be changed. If the TBLWT is not
to the MSB of the write block, then the programming
phase is not initiated.
Setting the LWRT bit enables long writes when the
MCLR pin is taken to V
is set, it can be cleared only by performing a POR or
MCLR reset.
To ensure that the memory location has been well pro-
grammed, a minimum programming time is required.
The long write can be terminated after the program-
ming time has expired by a reset or an interrupt. Having
only one interrupt source enabled to terminate the long
write ensures that no unintended interrupts will prema-
turely terminate the long write.
7/99 Microchip Technology Inc.
MCLR/V
age
LWRT bit must be set
TBLWT to the address of the MSB of the write
block
OPERATION
PP
pin must be at the programming volt-
PP
voltage. Once the LWRT bit
Preliminary
5.2.2.2
The sequence of events for programming an internal
program memory location should be:
1.
2.
3.
4.
5.
6.
7.
8.
9.
10. If GIE was set, service the interrupt request.
11. Lower MCLR/V
12. Verify the memory location (table read).
Enable the interrupt that terminates the long
write. Disable all other interrupts.
Clear the source interrupt flag.
If Interrupt Service Routine execution is desired
when the device wakes, enable global inter-
rupts.
Set LWRT bit in the RCON register.
Raise MCLR/V
age, V
Clear the WDT (if enabled).
Set the interrupt source to interrupt at the
required time.
Execute the table write for the lower (even) byte.
This will be a short write.
Execute the table write for the upper (odd) byte.
This will be a long write. The controller will go to
sleep while programming. The interrupt wakes
the controller.
PP
SEQUENCE OF EVENTS
.
PP
PP
pin to V
pin to the programming volt-
PIC18CXX2
DD
.
DS39026B-page 57

Related parts for PIC18C242