PIC16F1938-I/ML Microchip Technology, PIC16F1938-I/ML Datasheet - Page 330

IC MCU 8BIT FLASH 28QFN

PIC16F1938-I/ML

Manufacturer Part Number
PIC16F1938-I/ML
Description
IC MCU 8BIT FLASH 28QFN
Manufacturer
Microchip Technology
Series
PIC® XLP™ 16Fr

Specifications of PIC16F1938-I/ML

Core Size
8-Bit
Program Memory Size
28KB (16K x 14)
Oscillator Type
Internal
Core Processor
PIC
Speed
32MHz
Connectivity
I²C, LIN, SPI, UART/USART
Peripherals
Brown-out Detect/Reset, LCD, POR, PWM, WDT
Number Of I /o
25
Program Memory Type
FLASH
Eeprom Size
256 x 8
Ram Size
1K x 8
Voltage - Supply (vcc/vdd)
1.8 V ~ 5.5 V
Data Converters
A/D 11x10b
Operating Temperature
-40°C ~ 85°C
Package / Case
28-VQFN Exposed Pad, 28-HVQFN, 28-SQFN, 28-DHVQFN
Controller Family/series
PIC16F
No. Of I/o's
25
Eeprom Memory Size
256Byte
Ram Memory Size
1024Byte
Cpu Speed
32MHz
Package
28QFN EP
Device Core
PIC
Family Name
PIC16
Maximum Speed
32 MHz
Operating Supply Voltage
2.5|3.3|5 V
Data Bus Width
8 Bit
Number Of Programmable I/os
25
Interface Type
I2C/SPI/USART
On-chip Adc
11-chx10-bit
Number Of Timers
5
Lead Free Status / RoHS Status
Lead free / RoHS Compliant

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC16F1938-I/ML
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
PIC16F193X/LF193X
23.2
While executing code, program memory can only be
erased by rows. A row consists of 32 words where the
EEADRL<4:0> = 00000. To erase a row:
1.
2.
3.
4.
5.
6.
23.3
Before writing, program memory should be erased
using the Erase Program Memory command.
No automatic erase occurs upon the initiation of the
write; if the program Flash needs to be erased before
writing, the row (32 words) must be erased previously.
Flash program memory may only be written to if the
destination address is in a segment of memory that is
not write-protected, as defined in bits WRT<1:0> of the
Configuration Word Register 2. Flash program memory
must be written in eight-word blocks. See Figure 23-2
for more details. A block consists of eight words with
sequential addresses, with a lower boundary defined
by an address, where EEADRL<2:0> = 000. All block
writes to program memory are done as 32-word erase
by eight-word write operations. The write operation is
edge-aligned and cannot occur across boundaries.
When the LWLO bit is ‘1’, the write sequence will only
load the buffer register and will not actually initiate the
write to program Flash:
1.
2.
3.
To write program data, it must first be loaded into the
buffer registers (see Figure 23-1). This is accomplished
by first writing the destination address to EEADRL and
EEADRH and then writing the data to EEDATA and
EEDATH. After the address and data have been set up,
then the following sequence of events must be executed:
1.
2.
3.
4.
DS41364C-page 330
Load the EEADRH and EEADRL registers with
the address of new row to be erased.
Clear the CFGS bit of the EECON1 register.
Set the EEPGD bit of the EECON1 register.
Set the FREE bit of the EECON1 register.
Write 55h, then AAh, to EECON2 (Flash
programming unlock sequence).
Set control bit WR of the EECON1 register to
begin the write operation.
Set the EEPGD, WREN and LWLO bits of the
EECON1 register.
Write 55h, then AAh, to EECON2 (Flash
programming unlock sequence).
Set control bit WR of the EECON1 register to
begin the write operation.
Set the EEPGD control bit of the EECON1
register.
Set the LWLO bit of the EECON1 register.
Write 55h, then AAh, to EECON2 (Flash
programming sequence).
Set the WR control bit of the EECON1 register.
Erasing Program Memory
Writing to Flash Program Memory
Preliminary
Up to eight buffer register locations can be written to
with correct data. If less than eight words are being writ-
ten to in the block of eight words, then the data for the
unprogrammed words should be set to all ones.
After the “BSF EECON1,WR” instruction, the processor
requires two cycles to set up the erase/write operation.
The user must place two NOP instructions after the WR
bit is set. Since data is being written to buffer registers,
the writing of the first seven words of the block appears
to occur immediately. The processor will halt internal
operations for the typical 2 ms, only during the cycle in
which the erase takes place (i.e., the last word of the
sixteen-word block erase). This is not Sleep mode as
the clocks and peripherals will continue to run. After the
eight-word write cycle, the processor will resume oper-
ation with the third instruction after the EECON1 write
instruction.
An example of the complete eight-word write sequence
is shown in Example 23-5. The initial address is loaded
into the EEADRH and EEADRL register pair; the eight
words of data are loaded using indirect addressing.
© 2009 Microchip Technology Inc.

Related parts for PIC16F1938-I/ML