PIC24F08KA102-E/ML Microchip Technology Inc., PIC24F08KA102-E/ML Datasheet - Page 51

no-image

PIC24F08KA102-E/ML

Manufacturer Part Number
PIC24F08KA102-E/ML
Description
8KB FLASH, 1.5KB RAM, 512B EEPROM, 16 MIPS, 24 I/O, 16-BIT PIC24F FAMILY, NANOWAT
Manufacturer
Microchip Technology Inc.
Datasheet

Specifications of PIC24F08KA102-E/ML

A/d Inputs
9 Channel, 10-bit
Comparators
2
Cpu Speed
16 MIPS
Eeprom Memory
0 Bytes
Input Output
24
Interface
I2C/SPI/UART/USART
Memory Type
Flash
Number Of Bits
16
Package Type
28-pin QFN
Programmable Memory
8K Bytes
Ram Size
1.5K Bytes
Speed
32 MHz
Temperature Range
–40 to 125 °C
Timers
3-16-bit
Voltage, Range
1.8-3.6 V
Lead Free Status / Rohs Status
RoHS Compliant part
EXAMPLE 5-5:
EXAMPLE 5-6:
EXAMPLE 5-7:
© 2009 Microchip Technology Inc.
// C example using MPLAB C30
asm("DISI #5");
__builtin_write_NVM();
; Setup a pointer to data Program Memory
MOV
MOV
MOV
MOV
MOV
TBLWTL W2, [W0]
TBLWTH W3, [W0++]
; Setup NVMCON for programming one word to data Program Memory
MOV
MOV
DISI
MOV
MOV
MOV
MOV
BSET
DISI
MOV
MOV
MOV
MOV
BSET
NOP
NOP
BTSC
BRA
#tblpage(PROG_ADDR), W0
W0, TBLPAG
#tbloffset(PROG_ADDR), W0
#LOW_WORD_N, W2
#HIGH_BYTE_N, W3
#0x4003, W0
W0, NVMCON
#5
#0x55, W0
W0, NVMKEY
#0xAA, W0
W0, NVMKEY
NVMCON, #WR
#5
#0x55, W0
W0, NVMKEY
#0xAA, W1
W1, NVMKEY
NVMCON, #WR
NVMCON, #15
$-2
INITIATING A PROGRAMMING SEQUENCE – ASSEMBLY LANGUAGE CODE
INITIATING A PROGRAMMING SEQUENCE – ‘C’ LANGUAGE CODE
PROGRAMMING A SINGLE WORD OF FLASH PROGRAM MEMORY
// Block all interrupts for next 5 instructions
// Perform unlock sequence and set WR
Preliminary
; Block all interrupts
; Write the 55 key
;
; Write the AA key
; Start the erase sequence
; 2 NOPs required after setting WR
;
; Wait for the sequence to be completed
;
;
;Initialize PM Page Boundary SFR
;Initialize a register with program memory address
;
;
; Write PM low word into program latch
; Write PM high byte into program latch
;
; Set NVMOP bits to 0011
; Disable interrupts while the KEY sequence is written
; Write the key sequence
; Start the write cycle
PIC24F16KA102 FAMILY
for next 5 instructions
DS39927B-page 49

Related parts for PIC24F08KA102-E/ML