PIC12C509
PIC12C509
PIC12C509
VDD VSS
PIC12C509
PIC12C508
1 8
GP5/OSC1/CLKIN 2 7 GP0
GP4/OSC2 3 6 GP1
GP3/MCLR/VPP 4 5 GP2/T0CKI
VDD 1 8 VSS
PIC12C509A
PIC12CE519
PIC12CE518
PIC12C508A
GP5/OSC1/CLKIN 2 7 GP0
GP4/OSC2 3 6 GP1
GP3/MCLR/VPP 4 5 GP2/T0CKI
1 8
GP5/OSC1/CLKIN 2 7 GP0
GP4/OSC2 3 6 GP1
GP3/MCLR/VPP 4 5 GP2/T0CKI
Device Differences
Oscillator Process
Voltage
Device
Range
Oscillator Calibration2 Technology
(Bits) (Microns)
All PIC12CXXX & PIC12CEXXX devices have Power-on Reset, selectable Watchdog Timer, selectable code protect and high I/O
current capability.
All PIC12CXXX & PIC12CEXXX devices use serial programming with data pin GP0 and clock pin GP1.
12 8 GPIO
Data Bus
ROM/EPROM Program Counter
512 x 12 or GP0
1024 x 12 GP1
RAM GP2/T0CKI
Program STACK1 25 x 8 or
Memory GP3/MCLR/VPP
41 x 8 GP4/OSC2
STACK2 File
Registers GP5/OSC1/CLKIN
Program 12
Bus RAM Addr 9
SDA
SCL
Addr MUX
Instruction reg
Direct Addr 5 Indirect 16 X 8
5-7 Addr EEPROM
Data
FSR reg
Memory
PIC12CE5XX
STATUS reg Only
8
3 MUX
Device Reset
Timer
Instruction
Decode & ALU
Control Power-on
Reset
8
OSC1/CLKIN Timing Watchdog
Generation Timer W reg
OSC2
Internal RC
OSC Timer0
MCLR
VDD, VSS
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
OSC1
Q1
Q2 Internal
phase
Q3 clock
Q4
PC PC PC+1 PC+2
All instructions are single cycle, except for any program branches. These take two cycles since the fetch
instruction is “flushed” from the pipeline while the new instruction is being fetched and then executed.
User Memory
Counter (PC) capable of addressing a 2K x 12
program memory space.
Space
512 Word 01FFh
Only the first 512 x 12 (0000h-01FFh) for the
0200h
PIC12C508, PIC12C508A and PIC12CE518 and 1K x
12 (0000h-03FFh) for the PIC12C509, PIC12C509A, On-chip Program
PIC12CR509A, and PIC12CE519 are physically Memory
implemented. Refer to Figure 4-1. Accessing a
location above these boundaries will cause a wrap-
around within the first 512 x 12 space (PIC12C508, 1024 Word 03FFh
PIC12C508A and PIC12CE518) or 1K x 12 space 0400h
(PIC12C509, PIC12C509A, PIC12CR509A and
PIC12CE519). The effective reset vector is at 000h,
(see Figure 4-1). Location 01FFh (PIC12C508,
PIC12C508A and PIC12CE518) or location 03FFh
7FFh
(PIC12C509, PIC12C509A, PIC12CR509A and
PIC12CE519) contains the internal clock oscillator
calibration value. This value should never be Note 1: Address 0000h becomes the
overwritten. effective reset vector. Location
01FFh (PIC12C508, PIC12C508A,
PIC12CE518) or location 03FFh
(PIC12C509, PIC12C509A,
PIC12CR509A, PIC12CE519) con-
tains the MOVLW XX INTERNAL RC
oscillator calibration value.
FIGURE 4-3: PIC12C509, PIC12C509A, PIC12CR509A AND PIC12CE519 REGISTER FILE MAP
FSR<6:5> 00 01
File Address
00h INDF(1) 20h
01h TMR0
02h PCL
STATUS Addresses map
03h
back to
04h FSR addresses
05h OSCCAL in Bank 0.
06h GPIO
07h
General
Purpose
Registers
0Fh 2Fh
10h 30h
General General
Purpose Purpose
Registers Registers
1Fh 3Fh
Bank 0 Bank 1
Value on Value on
Power-On All Other
Address Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Reset Resets(2)
00h INDF Uses contents of FSR to address data memory (not a physical register) xxxx xxxx uuuu uuuu
01h TMR0 8-bit real-time clock/counter xxxx xxxx uuuu uuuu
GPIO
(PIC12CE518/
06h PIC12CE519) SCL SDA GP5 GP4 GP3 GP2 GP1 GP0 11xx xxxx 11uu uuuu
Legend: Shaded boxes = unimplemented or unused, — = unimplemented, read as ’0’ (if applicable)
x = unknown, u = unchanged, q = see the tables in Section 8.7 for possible values.
Note 1: The upper byte of the Program Counter is not directly accessible. See Section 4.6
for an explanation of how to access these bits.
2: Other (non power-up) resets include external reset through MCLR, watchdog timer and wake-up on pin change reset.
3: If reset was due to wake-up on pin change then bit 7 = 1. All other resets will cause bit 7 = 0.
By executing the OPTION instruction, the contents of Note: If the T0CS bit is set to ‘1’, GP2 is forced to
the W register will be transferred to the OPTION be an input even if TRIS GP2 = ‘0’.
register. A RESET sets the OPTION<7:0> bits.
FIGURE 4-6: OSCCAL REGISTER (ADDRESS 05h) FOR PIC12C508 AND PIC12C509
As a program instruction is executed, the Program The Program Counter is set upon a RESET, which
Counter (PC) will contain the address of the next means that the PC addresses the last location in the
program instruction to be executed. The PC value is last page i.e., the oscillator calibration instruction. After
increased by one every instruction cycle, unless an executing MOVLW XX, the PC will roll over to location
instruction changes the PC. 00h, and begin executing user code.
For a GOTO instruction, bits 8:0 of the PC are provided The STATUS register page preselect bits are cleared
by the GOTO instruction word. The PC Latch (PCL) is upon a RESET, which means that page 0 is pre-
mapped to PC<7:0>. Bit 5 of the STATUS register selected.
provides page information to bit 9 of the PC (Figure 4- Therefore, upon a RESET, a GOTO instruction will
8). automatically cause the program to jump to page 0
For a CALL instruction, or any instruction where the until the value of the page bits is altered.
PCL is the destination, bits 7:0 of the PC again are
provided by the instruction word. However, PC<8> 4.7 Stack
does not come from the instruction word, but is always
PIC12C5XX devices have a 12-bit wide L.I.F.O.
cleared (Figure 4-8).
hardware push/pop stack.
Instructions where the PCL is the destination, or
A CALL instruction will push the current value of stack
Modify PCL instructions, include MOVWF PC, ADDWF
1 into stack 2 and then push the current program
PC, and BSF PC,5.
counter value, incremented by one, into stack level 1. If
Note: Because PC<8> is cleared in the CALL more than two sequential CALL’s are executed, only
instruction, or any Modify PCL instruction, the most recent two return addresses are stored.
all subroutine calls or computed jumps are A RETLW instruction will pop the contents of stack level
limited to the first 256 locations of any pro- 1 into the program counter and then copy stack level 2
gram memory page (512 words long). contents into level 1. If more than two sequential
FIGURE 4-8: LOADING OF PC RETLW’s are executed, the stack will be filled with the
address previously stored in level 2. Note that the
BRANCH INSTRUCTIONS -
W register will be loaded with the literal value specified
PIC12C5XX
in the instruction. This is particularly useful for the
GOTO Instruction implementation of data look-up tables within the
program memory.
11 10 9 8 7 0
PC PCL Upon any reset, the contents of the stack remain
unchanged, however the program counter (PCL) will
also be reset to 0.
Instruction Word
Note 1: There are no STATUS bits to indicate
PA0
7 0
stack overflows or stack underflow condi-
tions.
STATUS
Note 2: There are no instructions mnemonics
called PUSH or POP. These are actions
that occur from the execution of the CALL
CALL or Modify PCL Instruction and RETLW instructions.
11 10 9 8 7 0
PC PCL
Instruction Word
Reset to ‘0’
PA0
7 0
STATUS
1Fh 3Fh
Bank 0 Bank 1(2)
N/A OPTION GPWU GPPU T0CS T0SE PSA PS2 PS1 PS0 1111 1111 1111 1111
GPIO
(PIC12C508/
PIC12C509/
PIC12C508A/
PIC12C509A/
06h PIC12CR509A) — — GP5 GP4 GP3 GP2 GP1 GP0 --xx xxxx --uu uuuu
GPIO
(PIC12CE518/
06h PIC12CE519) SCL SDA GP5 GP4 GP3 GP2 GP1 GP0 11xx xxxx 11uu uuuu
Legend: Shaded cells not used by Port Registers, read as ‘0’, — = unimplemented, read as '0', x = unknown, u = unchanged,
q = see tables in Section 8.7 for possible values.
Note 1: If reset was due to wake-up on change, then bit 7 = 1. All other resets will cause bit 7 = 0.
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
Data bus
GP2/T0CKI FOSC/4 0
Pin PSout 8
1
Sync with
1 Internal TMR0 reg
Clocks
Programmable 0 PSout
Prescaler(2)
T0SE (2 TCY delay) Sync
3
PS2, PS1, PS0(1) PSA(1)
T0CS(1)
Note 1: Bits T0CS, T0SE, PSA, PS2, PS1 and PS0 are located in the OPTION register.
2: The prescaler is shared with the Watchdog Timer (Figure 6-5).
PC Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
(Program
Counter) PC-1 PC PC+1 PC+2 PC+3 PC+4 PC+5 PC+6
Instruction MOVWF TMR0 MOVF TMR0,W MOVF TMR0,W MOVF TMR0,W MOVF TMR0,W MOVF TMR0,W
Fetch
Instruction
Executed
Write TMR0 Read TMR0 Read TMR0 Read TMR0 Read TMR0 Read TMR0
executed reads NT0 reads NT0 reads NT0 reads NT0 + 1 reads NT0 + 2
PC Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
(Program
Counter) PC-1 PC PC+1 PC+2 PC+3 PC+4 PC+5 PC+6
Instruction MOVWF TMR0 MOVF TMR0,W MOVF TMR0,W MOVF TMR0,W MOVF TMR0,W MOVF TMR0,W
Fetch
Instruction
Execute Write TMR0 Read TMR0 Read TMR0 Read TMR0 Read TMR0 Read TMR0
executed reads NT0 reads NT0 reads NT0 reads NT0 reads NT0 + 1
Value on Value on
Power-On All Other
Address Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Reset Resets
01h TMR0 Timer0 - 8-bit real-time clock/counter xxxx xxxx uuuu uuuu
N/A OPTION GPWU GPPU T0CS T0SE PSA PS2 PS1 PS0 1111 1111 1111 1111
N/A TRIS — — GP5 GP4 GP3 GP2 GP1 GP0 --11 1111 --11 1111
Legend: Shaded cells not used by Timer0, - = unimplemented, x = unknown, u = unchanged,
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
External Clock Input or Small pulse
Prescaler Output (2) misses sampling
(1)
External Clock/Prescaler (3)
Output After Sampling
Timer0 T0 T0 + 1 T0 + 2
Note 1: Delay from clock input change to Timer0 increment is 3Tosc to 7Tosc. (Duration of Q = Tosc).
Therefore, the error in measuring the interval between two edges on Timer0 input = ± 4Tosc max.
2: External clock if no prescaler selected, Prescaler output otherwise.
3: The arrows indicate the points in time where sampling occurs.
T0SE T0CS
PSA
0
8-bit Prescaler
M
U
1 X
Watchdog 8
Timer
8 - to - 1MUX PS2:PS0
PSA
0 1
WDT Enable bit
MUX PSA
WDT
Time-Out
Note: T0CS, T0SE, PSA, PS2:PS0 are bits in the OPTION register.
reset
To 24L00 SDA
Pad
D
EN
write ck Q
databus GPIO
Output Latch
Q D
EN
ck
Schmitt Trigger
Input Latch
Read ltchpin
GPIO
VDD
D
To 24LC00 SCL
Pad
EN
write ck Q
databus GPIO
Q D
EN
ck Schmitt Trigger
Read ltchpin
GPIO
This SCL input is used to synchronize the data transfer The state of the data line represents valid data when,
from and to the device. after a START condition, the data line is stable for the
duration of the HIGH period of the clock signal.
7.1 BUS CHARACTERISTICS
The data on the line must be changed during the LOW
The following bus protocol is to be used with the period of the clock signal. There is one bit of data per
EEPROM data memory. clock pulse.
• Data transfer may be initiated only when the bus Each data transfer is initiated with a START condition
is not busy. and terminated with a STOP condition. The number of
the data bytes transferred between the START and
During data transfer, the data line must remain stable
STOP conditions is determined by the master device
whenever the clock line is HIGH. Changes in the data
and is theoretically unlimited.
line while the clock line is HIGH will be interpreted as a
START or STOP condition. 7.1.5 ACKNOWLEDGE
Accordingly, the following bus conditions have been
Each receiving device, when addressed, is obliged to
defined (Figure 7-3).
generate an acknowledge after the reception of each
7.1.1 BUS NOT BUSY (A) byte. The master device must generate an extra clock
pulse which is associated with this acknowledge bit.
Both data and clock lines remain HIGH.
Note: Acknowledge bits are not generated if an
7.1.2 START DATA TRANSFER (B) internal programming cycle is in progress.
The device that acknowledges has to pull down the
A HIGH to LOW transition of the SDA line while the
SDA line during the acknowledge clock pulse in such a
clock (SCL) is HIGH determines a START condition. All
way that the SDA line is stable LOW during the HIGH
commands must be preceded by a START condition.
period of the acknowledge related clock pulse. Of
7.1.3 STOP DATA TRANSFER (C) course, setup and hold times must be taken into
account. A master must signal an end of data to the
A LOW to HIGH transition of the SDA line while the slave by not generating an acknowledge bit on the last
clock (SCL) is HIGH determines a STOP condition. All byte that has been clocked out of the slave. In this case,
operations must be ended with a STOP condition. the slave must leave the data line HIGH to enable the
master to generate the STOP condition (Figure 7-4).
SDA
SCL 1 2 3 4 5 6 7 8 9 1 2 3
Transmitter must release the SDA line at this point Receiver must release the SDA line at this point
allowing the Receiver to pull the SDA line low to so the Transmitter can continue sending data.
acknowledge the previous eight bits of data.
YES
Next
Operation
A A A
BUS ACTIVITY C C C
K K K
X = Don’t Care Bit
Note 1: Refer to the PIC12C5XX Programming Specifications to determine how to access the
configuration word. This register is not user addressable during device operation.
SLEEP
XTAL RF(3)
To internal
logic
OSC2
(2)
RS
C2(1)
CLKIN
0.1 µF
XTAL
8.3 RESET
The device differentiates between various kinds of
reset:
a) Power on reset (POR)
b) MCLR reset during normal operation
c) MCLR reset during SLEEP
d) WDT time-out reset during normal operation
e) WDT time-out reset during SLEEP
f) Wake-up from SLEEP on pin change
MCLR Reset
Register Address Power-on Reset WDT time-out
Wake-up on Pin Change
W (PIC12C508/509) — qqqq xxxx (1) qqqq uuuu (1)
W (PIC12C508A/509A/ — qqqq qqxx (1) qqqq qquu (1)
PIC12CE518/519/
PIC12CE509A)
INDF 00h xxxx xxxx uuuu uuuu
TMR0 01h xxxx xxxx uuuu uuuu
PC 02h 1111 1111 1111 1111
STATUS 03h 0001 1xxx q00q quuu (2,3)
FSR (PIC12C508/ 04h 111x xxxx 111u uuuu
PIC12C508A/
PIC12CE518)
FSR (PIC12C509/ 04h 110x xxxx 11uu uuuu
PIC12C509A/
PIC12CE519/
PIC12CR509A)
OSCCAL 05h 0111 ---- uuuu ----
(PIC12C508/509)
OSCCAL 05h 1000 00-- uuuu uu--
(PIC12C508A/509A/
PIC12CE518/512/
PIC12CR509A)
GPIO 06h --xx xxxx --uu uuuu
(PIC12C508/PIC12C509/
PIC12C508A/
PIC12C509A/
PIC12CR509A)
GPIO 06h
(PIC12CE518/
PIC12CE519) 11xx xxxx 11uu uuuu
OPTION — 1111 1111 1111 1111
TRIS — --11 1111 --11 1111
Legend: u = unchanged, x = unknown, - = unimplemented bit, read as ‘0’, q = value depends on condition.
Note 1: Bits <7:2> of W register contain oscillator calibration values due to MOVLW XX instruction at top of memory.
Note 2: See Table 8-7 for reset value for specific conditions
Note 3: If reset was due to wake-up on pin change, then bit 7 = 1. All other resets will cause bit 7 = 0.
Power-Up
Detect
POR (Power-On Reset) Pin Change
VDD Wake-up on
pin change
SLEEP
GP3/MCLR/VPP
WDT Time-out
MCLRE
RESET
8-bit Asynch S Q
On-Chip Ripple Counter
DRT OSC (Start-Up Timer)
R Q
CHIP RESET
VDD
MCLR
INTERNAL POR
TDRT
DRT TIME-OUT
INTERNAL RESET
FIGURE 8-10: TIME-OUT SEQUENCE ON POWER-UP (MCLR TIED TO VDD): FAST VDD RISE TIME
VDD
MCLR
INTERNAL POR
TDRT
DRT TIME-OUT
INTERNAL RESET
V1
VDD
MCLR
INTERNAL POR
TDRT
DRT TIME-OUT
INTERNAL RESET
When VDD rises slowly, the TDRT time-out expires long before VDD has reached its final value. In
this example, the chip will reset properly if, and only if, V1 ≥ VDD min.
The WDT has a nominal time-out period of 18 ms, The CLRWDT instruction clears the WDT and the
(with no prescaler). If a longer time-out period is postscaler, if assigned to the WDT, and prevents it
desired, a prescaler with a division ratio of up to 1:128 from timing out and generating a device RESET.
can be assigned to the WDT (under software control) The SLEEP instruction resets the WDT and the
by writing to the OPTION register. Thus, a time-out postscaler, if assigned to the WDT. This gives the
period of a nominal 2.3 seconds can be realized. maximum SLEEP time before a WDT wake-up reset.
These periods vary with temperature, VDD and part-to-
part process variations (see DC specs).
Under worst case conditions (VDD = Min., Temperature
= Max., max. WDT prescaler), it may take several
seconds before a WDT time-out occurs.
0
M Postscaler
Watchdog 1 Postscaler
U
Timer
X
8 - to - 1 MUX PS2:PS0
0 1
MUX PSA
Note: T0CS, T0SE, PSA, PS2:PS0
are bits in the OPTION register.
WDT
Time-out
Value on Value on
Power-On All Other
Address Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Reset Resets
N/A OPTION GPWU GPPU T0CS T0SE PSA PS2 PS1 PS0 1111 1111 1111 1111
Legend: Shaded boxes = Not used by Watchdog Timer, — = unimplemented, read as ’0’, u = unchanged
VDD
VDD
33k
Q1
10k
MCLR
40k* PIC12C5XX
f Register file address (0x00 to 0x7F) Literal and control operations (except GOTO)
W Working register (accumulator) 11 8 7 0
b Bit address within an 8-bit file register OPCODE k (literal)
k Literal field, constant data or label
k = 8-bit immediate value
Don’t care location (= 0 or 1)
The assembler will generate code with x = 0. It is Literal and control operations - GOTO instruction
x
the recommended form of use for compatibility
with all Microchip software tools. 11 9 8 0
Destination select; OPCODE k (literal)
d = 0 (store result in W)
d k = 9-bit immediate value
d = 1 (store result in file register ’f’)
Default is d = 1
label Label name
TOS Top of Stack
PC Program Counter
WDT Watchdog Timer Counter
TO Time-Out bit
PD Power-Down bit
Destination, either the W register or the specified
dest register file location
[ ] Options
( ) Contents
→ Assigned to
<> Register bit field
∈ In the set of
italics User defined term (font is courier)
Description: The contents of the W register are Encoding: 0100 bbbf ffff
AND’ed with the eight-bit literal 'k'. The Description: Bit 'b' in register 'f' is cleared.
result is placed in the W register.
Words: 1
Words: 1
Cycles: 1
Cycles: 1
Example: BCF FLAG_REG, 7
Example: ANDLW 0x5F
Before Instruction
Before Instruction FLAG_REG = 0xC7
W = 0xA3
After Instruction
After Instruction FLAG_REG = 0x47
W = 0x03
NOP No Operation
MOVLW Move Literal to W Syntax: [ label ] NOP
Syntax: [ label ] MOVLW k Operands: None
Operands: 0 ≤ k ≤ 255 Operation: No operation
Operation: k → (W) Status Affected: None
Status Affected: None Encoding: 0000 0000 0000
Encoding: 1100 kkkk kkkk Description: No operation.
Description: The eight bit literal ’k’ is loaded into the Words: 1
W register. The don’t cares will assem-
ble as 0s.
Cycles: 1
Cycles: 1
Example: MOVLW 0x5A
After Instruction
W = 0x5A
Words: 1 Words: 1
Cycles: 1 Cycles: 1
Example TRIS GPIO Example XORWF REG,1
Before Instruction Before Instruction
W = 0XA5 REG = 0xAF
After Instruction W = 0xB5
TRIS = 0XA5 After Instruction
Note: f = 6 for PIC12C5XX only. REG = 0x1A
W = 0xB5
The MPLAB-ICE Universal In-Circuit Emulator is 10.5 PICSTART Plus Entry Level
intended to provide the product development engineer Development System
with a complete microcontroller design tool set for
PICmicro microcontrollers (MCUs). MPLAB-ICE is The PICSTART programmer is an easy-to-use, low-
supplied with the MPLAB Integrated Development cost prototype programmer. It connects to the PC via
Environment (IDE), which allows editing, “make” and one of the COM (RS-232) ports. MPLAB Integrated
download, and source debugging from a single envi- Development Environment software makes using the
ronment. programmer simple and efficient. PICSTART Plus is not
recommended for production programming.
Interchangeable processor modules allow the system
to be easily reconfigured for emulation of different pro- PICSTART Plus supports all PIC12CXXX, PIC14C000,
cessors. The universal architecture of the MPLAB-ICE PIC16C5X, PIC16CXXX and PIC17CXX devices with
allows expansion to support all new Microchip micro- up to 40 pins. Larger pin count devices such as the
controllers. PIC16C923, PIC16C924 and PIC17C756 may be sup-
ported with an adapter socket. PICSTART Plus is CE
The MPLAB-ICE Emulator System has been designed compliant.
as a real-time emulation system with advanced fea-
tures that are generally found on more expensive devel-
opment tools. The PC compatible 386 (and higher)
machine platform and Microsoft Windows 3.x or
Windows 95 environment were chosen to best make
these features available to you, the end user.
MPLAB-ICE is available in two versions.
MPLAB-ICE 1000 is a basic, low-cost emulator system
with simple trace capabilities. It shares processor mod-
ules with the MPLAB-ICE 2000. This is a full-featured
emulator system with enhanced trace, trigger, and data
monitoring features. Both systems will operate across
the entire operating speed range of the PICmicro
MCU.
The ability to use MPLAB with Microchip’s simulator For easier source level debugging, the compiler pro-
allows a consistent platform and the ability to easily vides symbol information that is compatible with the
switch from the low cost simulator to the full featured MPLAB IDE memory display.
emulator with minimal retraining due to development
10.14 Fuzzy Logic Development System
tools.
(fuzzyTECH-MP)
10.11 Assembler (MPASM)
fuzzyTECH-MP fuzzy logic development tool is avail-
The MPASM Universal Macro Assembler is a PC- able in two versions - a low cost introductory version,
hosted symbolic assembler. It supports all microcon- MP Explorer, for designers to gain a comprehensive
troller series including the PIC12C5XX, PIC14000, working knowledge of fuzzy logic system design; and a
PIC16C5X, PIC16CXXX, and PIC17CXX families. full-featured version, fuzzyTECH-MP, Edition for imple-
menting more complex systems.
MPASM offers full featured Macro capabilities, condi-
tional assembly, and several source and listing formats. Both versions include Microchip’s fuzzyLAB demon-
It generates various object code formats to support stration board for hands-on experience with fuzzy logic
Microchip's development tools as well as third party systems implementation.
programmers.
10.15 SEEVAL Evaluation and
MPASM allows full symbolic debugging from MPLAB- Programming System
ICE, Microchip’s Universal Emulator System.
MPASM has the following features to assist in develop- The SEEVAL SEEPROM Designer’s Kit supports all
ing software for specific use applications. Microchip 2-wire and 3-wire Serial EEPROMs. The kit
includes everything necessary to read, write, erase or
• Provides translation of Assembler source code to program special features of any Microchip SEEPROM
object code for all Microchip microcontrollers. product including Smart Serials and secure serials.
• Macro assembly capability. The Total Endurance Disk is included to aid in trade-
• Produces all the files (Object, Listing, Symbol, and off analysis and reliability calculations. The total kit can
special) required for symbolic debug with significantly reduce time-to-market and result in an
Microchip’s emulator systems. optimized system.
• Supports Hex (default), Decimal and Octal source
and listing formats.
MPASM provides a rich directive language to support
programming of the PICmicro. Directives are helpful
in making the development of your assemble source
code shorter and more maintainable.
MPLAB™-ICE
á
á
á
á
á
á
á
á
á
á
ICEPIC Low-Cost
In-Circuit Emulator
á
á
á
á
á
á
Emulator Products
á
á
á
á
á
á
á
á
á
á
Environment
MPLAB C17*
Compiler
á
á
fuzzyTECH-MP
Explorer/Edition
Software Tools
Fuzzy Logic
á
á
á
á
á
á
á
á
á
Dev. Tool
Total Endurance
Software Model
á
PICSTARTPlus
Low-Cost
á
á
á
á
á
á
á
á
á
á
PRO MATE II
Universal
á
á
á
á
á
á
á
á
á
á
á
á
Programmer
Programmers
KEELOQ
Programmer
á
SEEVAL
Designers Kit
á
SIMICE
á
á
PICDEM-14A
á
PICDEM-1
á
á
á
á
PICDEM-2
á
á
PICDEM-3
á
Demo Boards
KEELOQ®
Evaluation Kit
á
KEELOQ
Transponder Kit
á
DS40139E-page 63
PIC12C5XX
PIC12C5XX
NOTES:
Parm
No.
Characteristic Sym Min Typ(1) Max Units Conditions
1. TppS2ppS
2. TppS
T
F Frequency T Time
Lowercase subscripts (pp) and their meanings:
pp
2 to mc MCLR
ck CLKOUT osc oscillator
cy cycle time os OSC1
drt device reset timer t0 T0CKI
io I/O port wdt watchdog timer
Uppercase letters and their meanings:
S
F Fall P Period
H High R Rise
I Invalid (Hi-impedance) V Valid
L Low Z Hi-impedance
Q4 Q1 Q2 Q3 Q4 Q1
OSC1
1 3 3
4 4
2
Parameter
No.
Sym Characteristic Min Typ(1) Max Units Conditions
Parameter
No.
Sym Characteristic Min* Typ(1) Max* Units Conditions
Q4 Q1 Q2 Q3
OSC1
I/O Pin
(input)
17 19 18
20, 21
Note: All tests must be done with specified capacitive loads (see data sheet) 50 pF on I/O pins and CLKOUT.
Parameter
No. Sym Characteristic Min Typ(1) Max Units
FIGURE 11-4: RESET, WATCHDOG TIMER, AND DEVICE RESET TIMER TIMING - PIC12C508/C509
VDD
MCLR
30
Internal
POR
32 32
32
DRT
Timeout
(Note 2)
Internal
RESET
Watchdog
Timer
RESET
31
34 34
I/O pin
(Note 1)
Note 1: I/O pins must be taken out of hi-impedance mode by enabling the output drivers in software.
2: Runs in MCLR or WDT reset only in XT and LP modes.
Parameter
No. Sym Characteristic Min Typ(1) Max Units Conditions
T0CKI
40 41
42
4.40
4.40
4.30
4.30
4.20
4.20
Frequency (MHz)
Frequency (MHz)
4.10
4.10
Max.
4.00 Max.
4.00
3.90
3.90
3.80
3.80
3.70 Min.
3.70
3.60
Min. 3.60
3.50
-40 25 85 125 3.50
-40 25 85 125
Temperature (Deg.C)
Temperature (Deg.C)
FIGURE 12-3: WDT TIMER TIME-OUT FIGURE 12-4: SHORT DRT PERIOD VS. VDD
PERIOD VS. VDD
1000
50
900
45
800
40
700
35 WDT period (µs)
WDT period (mS)
600
30
Max +125°C
500 Max +125°C
25
Max +85°C Max +85°C
400
20
Typ +25°C 300
Typ +25°C
15
200
10
MIn –40°C
MIn –40°C
100
5 2 3 4 5 6 7
2 3 4 5 6 7 VDD (Volts)
VDD (Volts)
-1
20
-2 Max –40°C
15
IOH (mA)
-3
IOL (mA)
Typ +25°C
-4
10
125 °C
Min +
Min +85°C
-5
85°C
Min +
Min +125°C
-6 5
Typ +25°C
C
Max –40°
-7
500m 1.0 1.5 2.0 2.5
0
VOH (Volts) 0 250.0m 500.0m 1.0
VOL (Volts)
FIGURE 12-6: IOH vs. VOH, VDD = 5.5 V
FIGURE 12-8: IOL vs. VOL, VDD = 5.5 V
0 50
-5
Max –40°C
40
-10
IOH (mA)
30 Typ +25°C
-15
IOL (mA)
°C
25
-20 +1 Min +85°C
in 20
C
M
5°
+8
in
C
M
5°
+2
Min +125°C
p
-25
Ty
0°
–4
10
ax
M
-30
3.5 4.0 4.5 5.0 5.5
VOH (Volts) 0
250.0m 500.0m 750.0m 1.0
VOL (Volts)
Parm
No.
Characteristic Sym Min Typ(1) Max Units Conditions
Parm
Characteristic Sym Min Typ(1) Max Units Conditions
No.
D001 Supply Voltage VDD 2.5 5.5 V FOSC = DC to 4 MHz (Commercial/
Industrial)
D002 RAM Data Retention VDR 1.5* V Device in SLEEP mode
Voltage(2)
D003 VDD Start Voltage to ensure VPOR VSS V See section on Power-on Reset for details
Power-on Reset
D004 VDD Rise Rate to ensure SVDD 0.05* V/ms See section on Power-on Reset for details
Power-on Reset
D010 Supply Current(3) IDD — 0.4 0.8 mA XT and EXTRC options (Note 4)
FOSC = 4 MHz, VDD = 2.5V
D010C — 0.4 0.8 mA INTRC Option
FOSC = 4 MHz, VDD = 2.5V
D010A — 15 23 µA LP OPTION, Commercial Temperature
FOSC = 32 kHz, VDD = 2.5V, WDT disabled
— 15 31 µA LP OPTION, Industrial Temperature
FOSC = 32 kHz, VDD = 2.5V, WDT disabled
D020 Power-Down Current (5) IPD
D021 — 0.2 3 µA VDD = 2.5V, Commercial
D021B — 0.2 4 µA VDD = 2.5V, Industrial
∆IWDT — 2.0 4 mA VDD = 2.5V, Commercial
2.0 5 mA VDD = 2.5V, Industrial
* These parameters are characterized but not tested.
Note 1: Data in the Typical (“Typ”) column is based on characterization results at 25°C. This data is for design
guidance only and is not tested.
2: This is the limit to which VDD can be lowered in SLEEP mode without losing RAM data.
3: The supply current is mainly a function of the operating voltage and frequency. Other factors such as
bus loading, oscillator type, bus rate, internal code execution pattern, and temperature also have an
impact on the current consumption.
a) The test conditions for all IDD measurements in active operation mode are:
OSC1 = external square wave, from rail-to-rail; all I/O pins tristated, pulled to
Vss, T0CKI = VDD, MCLR = VDD; WDT enabled/disabled as specified.
b) For standby current measurements, the conditions are the same, except that
the device is in SLEEP mode.
4: Does not include current through Rext. The current through the resistor can be estimated by the
formula: IR = VDD/2Rext (mA) with Rext in kOhm.
5: The power down current in SLEEP mode does not depend on the oscillator type. Power down current
is measured with the part in SLEEP mode, with all I/O pins in hi-impedance state and tied to VDD or
VSS.
1. TppS2ppS
2. TppS
T
F Frequency T Time
Lowercase subscripts (pp) and their meanings:
pp
2 to mc MCLR
ck CLKOUT osc oscillator
cy cycle time os OSC1
drt device reset timer t0 T0CKI
io I/O port wdt watchdog timer
Uppercase letters and their meanings:
S
F Fall P Period
H High R Rise
I Invalid (Hi-impedance) V Valid
L Low Z Hi-impedance
Q4 Q1 Q2 Q3 Q4 Q1
OSC1
1 3 3
4 4
2
Parameter
No.
Sym Characteristic Min Typ(1) Max Units Conditions
Parameter
No.
Sym Characteristic Min* Typ(1) Max* Units Conditions
Q4 Q1 Q2 Q3
OSC1
I/O Pin
(input)
17 19 18
20, 21
Note: All tests must be done with specified capacitive loads (see data sheet) 50 pF on I/O pins and CLKOUT.
Parameter
No. Sym Characteristic Min Typ(1) Max Units
VDD
MCLR
30
Internal
POR
32 32
32
DRT
Timeout
(Note 2)
Internal
RESET
Watchdog
Timer
RESET
31
34 34
I/O pin
(Note 1)
Note 1: I/O pins must be taken out of hi-impedance mode by enabling the output drivers in software.
2: Runs in MCLR or WDT reset only in XT and LP modes.
TABLE 13-5: RESET, WATCHDOG TIMER, AND DEVICE RESET TIMER - PIC12C508A,
PIC12C509A, PIC12CE518, PIC12CE519, PIC12LC508A, PIC12LC509A,
PIC12LCR509A, PIC12LCE518 and PIC12LCE519
Parameter
No. Sym Characteristic Min Typ(1) Max Units Conditions
T0CKI
40 41
42
4.40 4.40
4.30 4.30
Max.
4.20 4.20
Max.
Frequency (MHz)
4.10 4.10
Frequency (MHz)
4.00 4.00
3.90 3.90
3.80 3.80
3.60 3.60
Min.
3.50 3.50
-40 0 25 85 125 -40 0 25 85 125
FIGURE 14-3: TYPICAL IDD VS. VDD FIGURE 14-4: TYPICAL IDD VS. FREQUENCY
(WDT DIS, 25°C, FREQUENCY (WDT DIS, 25°C, VDD = 5.5V)
= 4MHZ)
600 600
550 550
500 500
450 450
400 400
350 350
IDD (µA)
IDD (µA)
300 300
250 250
200 200
150 150
100 100
0 0
2.5 3.0 4.5 5.0 5.5 0 .5 1.0 1.5 2.0 2.5 3.0 3.5 4.0
VDD (Volts) Frequency (MHz)
50 -1
-2
45
-3
40
-4
WDT period (µS)
IOH (mA)
Min +125°C
35 Min +85°C
-5
Max +125°C
30 -6
Max +85°C Typ +25°C
25 -7
-8
20
Typ +25°C
-9
Max -40°C
15
-10
MIn –40°C .5 .75 1.0 1.25 1.5 1.75 2.0 2.25 2.5
10 VOH (Volts)
0 2.5 3.5 4.5 5.5 6.5
VDD (Volts)
FIGURE 14-6: SHORT DRT PERIOD VS. VDD FIGURE 14-8: IOH vs. VOH, VDD = 3.5 V
950 0
850
-5
750
Min +125°C
IOH (mA)
-10
650
WDT period (µs)
Min +85°C
350
Typ +25°C
250 -25
1.5 2.0 2.5 3.0 3.5
MIn –40°C
VOH (Volts)
150
0
0 2.5 3.5 4.5 5.5 6.5
VDD (Volts)
-5
30
5°
25 C
12
-15 n+
Mi
°C
85
n+
20 Mi
IOH (mA)
IOL (mA)
15 -25
Min +85°C
C
0°
–4
10 -30
ax
M
Min +125°C
5 -35
0 -40
3.5 4.0 4.5 5.0 5.5
0 0.25 0.5 0.75 1.0
VOH (Volts)
VOL (Volts)
45
35
40
30
35
Typ +25°C Typ +25°C
25
IOL (mA)
IOL (mA)
30
25
20
Min +85°C
20
15
Min +85°C
15
Min +125°C Min +125°C
10
10
0 0
0 0.25 0.5 0.75 1.0 0 0.25 0.5 0.75 1.0
VOL (Volts) VOL (Volts)
VTH (Volts)
240 1.4
Ipd (nA)
Typ (25)
230 1.2
210 0.8
200 0.6
2.5 3.0 3.5 4.5 5.0 5.5
VDD (Volts)
0
2.5 3.5 4.5 5.5
VDD (Volts)
3.5
Vih Max (-40 to 125)
VIH Typ (25)
3.0 VIH Min (-40 to 125)
VIL, VIH (Volts)
2.5
2.0
VIL Max (-40 to 125)
1.0
0.5
2.5 3.5 4.5 5.5
VDD (Volts)
XXXXXXXX 12C508A
XXXXXCDE 04I/PSAZ
AABB 9825
XXXXXXX C508A
AABB 9825
XXXXXXX 12C508A
XXXXXXX 04I/SM
AABBCDE 9824SAZ
XXX JW
XXXXXX 12C508A
* Standard OTP marking consists of Microchip part number, year code, week code, facility code, mask
rev#, and assembly code. For OTP marking beyond this, certain price adders apply. Please check with
your Microchip Sales Office. For QTP devices, any special marking adders are included in QTP price.
D
2
1
n
α
E1
A
A1
R L
c A2
β B1
p
eB B
E1
D
2
B n 1
X α
45 °
L
c R2
A
A1
R1 φ
β L1 A2
E1
D
2
n 1
B
c R2
A
A1
R1 φ
L1 A2
β
E W
T D
2
n 1
A
A1
L
A2
c B1
p
eB
B
From: Name
Company
Address
City / State / ZIP / Country
Telephone: (_______) _________ - _________ FAX: (______) _________ - _________
Application (optional):
Would you like a reply? Y N
Questions:
2. How does this document meet your hardware and software development needs?
3. Do you find the organization of this data sheet easy to follow? If not, why?
4. What additions to the data sheet do you think would enhance the structure and subject?
5. What deletions from the data sheet could be made without affecting the overall usefulness?
8. How would you improve our software, systems, and silicon products?
Please contact your local sales office for exact ordering procedures.
Please specify which device, revision of silicon and Data Sheet (include Literature #) you are using.
• The PICmicro family meets the specifications contained in the Microchip Data Sheet.
• Microchip believes that its family of PICmicro microcontrollers is one of the most secure products of its kind on the market today,
when used in the intended manner and under normal conditions.
• There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our knowl-
edge, require using the PICmicro microcontroller in a manner outside the operating specifications contained in the data sheet.
The person doing so may be engaged in theft of intellectual property.
• Microchip is willing to work with the customer who is concerned about the integrity of their code.
• Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not
mean that we are guaranteeing the product as “unbreakable”.
• Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of
our product.
If you have any further questions about this matter, please contact the local sales office nearest to you.
01/18/02