P89C662HFA Philips Semiconductors, P89C662HFA Datasheet

no-image

P89C662HFA

Manufacturer Part Number
P89C662HFA
Description
80C51 8-bit Flash microcontroller family P89C662HFA80C51 8-bit Flash microcontroller family
Manufacturer
Philips Semiconductors
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
P89C662HFA/00,512
Manufacturer:
NXP Semiconductors
Quantity:
10 000
Semiconductors
Product data
Replaces P89C660/P89C662/P89C664 of 2001 Jul 19
and P89C668 of 2001 Jul 27
hilips
P89C660/P89C662/P89C664/P89C668
80C51 8-bit Flash microcontroller family
16KB/32KB/64KB ISP/IAP FLASH with 512B/1KB/2KB/8KB RAM
INTEGRATED CIRCUITS
2002 Oct 28

Related parts for P89C662HFA

P89C662HFA Summary of contents

Page 1

P89C660/P89C662/P89C664/P89C668 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP FLASH with 512B/1KB/2KB/8KB RAM Product data Replaces P89C660/P89C662/P89C664 of 2001 Jul 19 and P89C668 of 2001 Jul 27 hilips Semiconductors INTEGRATED CIRCUITS 2002 Oct 28 ...

Page 2

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM DESCRIPTION The P89C660/662/664/668 device contains a non-volatile 16KB/32KB/64KB Flash program memory that is both parallel programmable and serial In-System and In-Application Programmable. In-System Programming (ISP) allows the user to download new code while the microcontroller sits in the application. ...

Page 3

... P89C662 1K – – 32K 4 P89C660 512B – – 16K 4 ORDERING INFORMATION MEMORY TEMPERATURE RANGE ( C) TEMPERATURE RANGE ( C) DEVICE FLASH RAM P89C660HBA 16 KB 512 B P89C660HFA 16 KB 512 B P89C660HBBD 16 KB 512 B P89C662HBA P89C662HFA P89C662HBBD P89C662HFBD P89C664HBA P89C664HFA P89C664HBBD P89C664HFBD P89C668HBA P89C668HFA P89C668HBBD 2002 Oct 28 ...

Page 4

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM BLOCK DIAGRAM 1 16K / 32K / 64 KBYTE CODE FLASH 0. KBYTE DATA RAM PORT 3 CONFIGURABLE I/Os PORT 2 CONFIGURABLE I/Os PORT 1 CONFIGURABLE I/Os PORT 0 CONFIGURABLE I/Os CRYSTAL OR OSCILLATOR RESONATOR 2002 Oct 28 P89C660/P89C662/P89C664/ ...

Page 5

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM BLOCK DIAGRAM (CPU-ORIENTED RAM ADDR RAM REGISTER B ACC REGISTER PSEN ALE TIMING AND EA/V PP CONTROL RST PD OSCILLATOR XTAL1 XTAL2 2002 Oct 28 P89C660/P89C662/P89C664/ P0.0–P0.7 P2.0–P2.7 PORT 0 PORT 2 ...

Page 6

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM LOGIC SYMBOL XTAL1 XTAL2 RST EA/V PP PSEN SCL ALE/PROG SDA RxD TxD INT0 INT1 PINNING Plastic Leaded Chip Carrier PLCC Pin Function Pin Function 1 NIC* 16 P3.4/T0/CEX3 2 P1.0/T2 17 P3.5/T1/CEX4 3 P1 ...

Page 7

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM PIN DESCRIPTIONS PIN NUMBER MNEMONIC MNEMONIC TYPE TYPE PLCC LQFP P0.0–0.7 43–36 37–30 I/O P1.0–P1.7 2–9 40–44, I/O 1– I/O P2.0–P2.7 24–31 18–25 I/O P3.0– ...

Page 8

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM PIN NUMBER MNEMONIC MNEMONIC TYPE TYPE PLCC LQFP EA XTAL1 XTAL2 NOTE: To avoid “latch-up” effect at power-on, the voltage on any pin (other than V 2002 Oct 28 P89C660/P89C662/P89C664/ NAME AND FUNCTION ...

Page 9

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM Table 1. Special Function Registers DIRECT SYMBOL DESCRIPTION ADDRESS ACC* Accumulator E0H AUXR# Auxiliary 8EH AUXR1# Auxiliary 1 A2H B* B register F0H CCAP0H# Module 0 Capture High FAH CCAP1H# Module 1 Capture High ...

Page 10

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM Table 1 Special Function Registers (Continued) DIRECT SYMBOL DESCRIPTION ADDRESS PSW* Program Status Word D0H RCAP2H# Timer 2 Capture High CBH RCAP2L# Timer 2 Capture Low CAH SADDR# Slave Address A9H ...

Page 11

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM LOW POWER MODES Stop Clock Mode The static design enables the clock speed to be reduced down to 0 MHz (stopped). When the oscillator is stopped, the RAM and Special Function Registers retain their values. This mode allows step-by-step utilization and reduces system power consumption by lowering the clock frequency down to any value ...

Page 12

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM SERIAL COMMUNICATION — SIO1 2 2 The I C serial port is identical to the I C serial port on the 8XC554, 8XC654, and 8XC652 devices. 2 Note that the P89C660/662/664/668 I C pins are alternate functions to port pins P1 ...

Page 13

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM bus P1.7/SDA P1.6/SCL P89C66x SDA MSB SLAVE ADDRESS SCL START CONDITION SIO1 Implementation and Operation 2 Figure 3 shows how the on-chip I C bus interface is implemented, and the following text describes the individual blocks. ...

Page 14

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM P1.7 INPUT FILTER P1.7/SDA OUTPUT STAGE INPUT FILTER P1.6/SCL OUTPUT STAGE P1.6 Figure 3. I 2002 Oct 28 P89C660/P89C662/P89C664/ S1ADR ADDRESS REGISTER COMPARATOR S1DAT SHIFT REGISTER ARBITRATION & SYNC LOGIC TIMING & ...

Page 15

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM Arbitration and Synchronization Logic In the Master Transmitter mode, the arbitration logic checks that every transmitted logic 1 actually appears as a logic 1 on the I bus. If another device on the bus overrules a logic 1 and pulls the SDA line low, arbitration is lost, and SIO1 immediately changes from master transmitter to slave receiver ...

Page 16

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM Serial Clock Generator This programmable clock pulse generator provides the SCL clock pulses when SIO1 is in the Master Transmitter or Master Receiver mode switched off when SIO1 Slave mode. The ...

Page 17

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM SDA SCL SHIFT PULSES SDA D7 D6 SCL SHIFT ACK & S1DAT ACK (2) S1DAT (1) (2) SHIFT BSD7 BSD7 D7 D6 LOADED BY THE CPU (1) Valid data in S1DAT (2) Shifting data in S1DAT and ACK (3) High level on SDA In the following text assumed that ENS1 = “ ...

Page 18

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM If the STA and STO bits are both set, the a STOP condition is 2 transmitted to the I C bus if SIO1 Master mode (in a Slave mode, SIO1 generates an internal STOP condition which is not transmitted). SIO1 then transmits a START condition. STO = “ ...

Page 19

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM Table 3. Serial Clock Rates 6-clock mode CR2 CR1 CR0 3 MHz 6. 100 0.24 < 62.5 0.49 < 62.5 0 < 255 12-clock mode CR2 CR1 CR0 6 MHz 6. 100 0.24 < 62.5 0.49 < 62.5 0 < ...

Page 20

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM More Information on SIO1 Operating Modes The four operating modes are: – Master Transmitter – Master Receiver – Slave Receiver – Slave Transmitter Data transfers in each mode of operation are shown in Figures 8-11. ...

Page 21

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM Ç Ç Ç Ç Ç Ç Ç Ç SUCCESSFUL TRANSMISSION TO A SLAVE RECEIVER Ç Ç Ç Ç Ç Ç Ç Ç NEXT TRANSFER STARTED WITH A REPEATED START CONDITION ...

Page 22

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM Ç Ç Ç Ç Ç Ç Ç Ç SUCCESSFUL RECEPTION S SLA FROM A SLAVE TRANSMITTER Ç Ç Ç Ç Ç Ç Ç Ç 08H NEXT TRANSFER STARTED WITH A REPEATED START CONDITION ...

Page 23

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM Ç Ç Ç Ç Ç Ç Ç RECEPTION OF THE OWN SLAVE ADDRESS AND ONE OR MORE DATA BYTES ALL ARE ACKNOWLEDGED. Ç Ç Ç Ç Ç Ç Ç LAST DATA BYTE RECEIVED IS ...

Page 24

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM Ç Ç Ç Ç Ç Ç Ç Ç RECEPTION OF THE Ç Ç Ç Ç Ç Ç Ç Ç OWN SLAVE ADDRESS S SLA AND TRANSMISSION OF ONE OR MORE Ç Ç Ç Ç Ç Ç Ç Ç ...

Page 25

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM Table 4. Master Transmitter mode APPLICATION SOFTWARE RESPONSE STATUS STATUS STATUS OF THE STATUS OF THE 2 CODE I C BUS AND TO/FROM S1DAT TO/FROM S1DAT (S1STA) (S1STA) SIO1 HARDWARE SIO1 HARDWARE 08H ...

Page 26

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM Table 5. Master Receiver Mode APPLICATION SOFTWARE RESPONSE 2 2 STATUS STATUS STATUS OF THE I STATUS OF THE CODE BUS AND TO/FROM S1DAT TO/FROM S1DAT (S1STA) (S1STA) SIO1 HARDWARE SIO1 HARDWARE 08H ...

Page 27

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM Table 6. Slave Receiver mode APPLICATION SOFTWARE RESPONSE STATUS STATUS STATUS OF THE STATUS OF THE 2 CODE I C BUS AND TO/FROM S1DAT TO/FROM S1DAT (S1STA) (S1STA) SIO1 HARDWARE SIO1 HARDWARE 60H ...

Page 28

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM Table 6. Slave Receiver mode (Continued) APPLICATION SOFTWARE RESPONSE STATUS STATUS STATUS OF THE STATUS OF THE 2 CODE I C BUS AND TO/FROM S1DAT TO/FROM S1DAT (S1STA) (S1STA) SIO1 HARDWARE SIO1 HARDWARE ...

Page 29

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM Table 8. Miscellaneous States APPLICATION SOFTWARE RESPONSE STATUS STATUS STATUS OF THE STATUS OF THE 2 CODE I C BUS AND TO/FROM S1DAT TO/FROM S1DAT (S1STA) (S1STA) SIO1 HARDWARE SIO1 HARDWARE F8H No relevant state No S1DAT action information available ...

Page 30

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM S SLA W A 08H 18H Figure 12. Simultaneous Repeated START Conditions from 2 Masters TIME OUT STA FLAG SDA LINE SCL LINE Bus Obstructed by a Low Level on SCL or SDA bus hang-up occurs if SDA or SCL is pulled LOW by an uncontrolled source ...

Page 31

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM STA FLAG (1) SDA LINE SCL LINE (1) Unsuccessful attempt to send a Start condition (2) SDA line released (3) Successful attempt to send a Start condition; state 08H is entered Figure 14. Recovering from a Bus Obstruction Caused by a Low Level on SDA ...

Page 32

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM TIMER 0 AND TIMER 1 OPERATION Timer 0 and Timer 1 The “Timer” or “Counter” function is selected by control bits C/T in the Special Function Register TMOD (see Figure 15). These two Timer/Counters have four operating modes, which are selected by bit-pairs (M1, M0) in TMOD ...

Page 33

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM OSC d* Tn Pin TRn Timer n Gate bit INTn Pin * 6-clock mode 12-clock mode. Figure 16. Timer/Counter 0/1 Mode 0: 13-Bit Timer/Counter TCON Address = 88H Bit Addressable 7 TF1 TR1 BIT SYMBOL FUNCTION TCON ...

Page 34

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM OSC d* Tn Pin TRn Timer n Gate bit INTn Pin * 6-clock mode 12-clock mode. Figure 18. Timer/Counter 0/1 Mode 2: 8-Bit Auto-Reload OSC d* T0 Pin TR0 Timer 0 Gate bit INT0 Pin ...

Page 35

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM TIMER 2 OPERATION Timer 2 Timer 16-bit Timer/Counter which can operate as either an event timer or an event counter, as selected by C/T2 in the special function register T2CON (see Figure 20). Timer 2 has three operating modes: – ...

Page 36

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM Table 9. Timer 2 Operating Modes RCLK + TCLK CP/RL2 OSC Pin Transition Detector T2EX Pin Control EXEN2 * 6-clock mode 12-clock mode. T2MOD Address = 0C9H Not Bit Addressable — — ...

Page 37

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM OSC PIN TRANSITION DETECTOR T2EX PIN EXEN2 * 6-clock mode 12-clock mode. Figure 23. Timer 2 in Auto-Reload Mode (DCEN = 0) n* OSC C/ C/ PIN TR2 * 6-clock mode 12-clock mode. Figure 24. Timer 2 Auto Reload Mode (DCEN = 1) ...

Page 38

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM OSC C/ C/ Pin Transition Detector T2EX Pin EXEN2 Note availability of additional external interrupt. Table 10. Timer 2 Commonly Used Generated Baud Rates Baud Rate Osc Freq 12 clock 6 clock RCAP2H mode ...

Page 39

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM When Timer the baud rate generator mode, one should not try to read or write TH2 and TL2 baud rate generator, Timer 2 is incremented every state time (f /2) or asynchronously from pin OSC T2 ...

Page 40

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM FULL-DUPLEX ENHANCED UART Standard UART operation A full-duplex serial port can transmit and receive simultaneously also receive-buffered, meaning it can commence reception of a second byte before a previously received byte has been read from the register. (However, if the first byte still hasn’ ...

Page 41

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM SCON Address = 98H Bit Addressable SM0 Where SM0, SM1 specify the serial port mode, as follows: SM0 SM1 Mode Description shift register 8-bit UART 9-bit UART 9-bit UART SM2 Enables the multiprocessor communication feature in Modes 2 and 3 ...

Page 42

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM shifted to the left by one position. The value that comes in, from the right, is the value that was sampled at the P3.0 pin at S5P2 of the same machine cycle. As data bits come in from the right, 1s shift out to the left. When the ...

Page 43

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM Write to SBUF Serial Port Interrupt REN ALE Write to SBUF S6P2 Send Shift RxD (Data Out TxD (Shift Clock) S3P1 S6P1 TI Write to SCON (Clear RI) RI Receive Shift RxD (Data In) ...

Page 44

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM Timer 1 Overflow Write 2 to SBUF SMOD = 1 SMOD = 0 16 Serial Port Interrupt Sample 1-to-0 Transition Detector RxD TX Clock Write to SBUF Send Data S1P1 Shift Start Bit TxD Reset RX Clock ...

Page 45

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM Write to SBUF Phase 2 Clock (1 OSC Mode 2 16 SMOD = 1 Serial 2 Port Interrupt SMOD = 0 (SMOD is PCON.7) Sample 1-to-0 Transition Detector RxD TX Clock Write to SBUF Send Data S1P1 Shift Start Bit ...

Page 46

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM Timer 1 Overflow Write 2 to SBUF SMOD = 1 SMOD = 0 16 Serial Port Interrupt Sample 1-to-0 Transition Detector RxD TX Clock Write to SBUF Send Data S1P1 Shift Start Bit TxD Stop Bit Gen. ...

Page 47

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM Enhanced UART In addition to the standard operation, the UART can perform framing error detect by looking for missing stop bits, and automatic address recognition. The UART also fully supports multiprocessor communication as does the standard 80C51 UART ...

Page 48

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM S0CON Address = 98H Bit Addressable SM0/FE SM1 Bit (SMOD0 = 0/1)* Symbol Function FE Framing Error bit. This bit is set by the receiver when an invalid stop bit is detected. The FE bit is not cleared by valid frames but should be cleared by software ...

Page 49

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM D0 START BIT SM0 / FE SMOD1 SMOD0 0 : S0CON.7 = SM0 1 : S0CON RECEIVED ADDRESS PROGRAMMED ADDRESS IN UART MODE 2 OR MODE 3 AND SM2 = 1: INTERRUPT IF REN=1, RB8=1 AND “RECEIVED ADDRESS” = “PROGRAMMED ADDRESS” ...

Page 50

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM Interrupt Priority Structure The P89C660/662/664/668 has an 8 source four-level interrupt structure (see Table 13). There are 4 SFRs associated with the four-level interrupt. They are the IE, IP, IEN1, and IPH (see Figures 35, 36, 37, and 38). The IPH (Interrupt Priority High) register makes the four-level interrupt structure possible ...

Page 51

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM 7 IP (0B8H) PT2 PPC Priority Bit = 1 assigns high priority Priority Bit = 0 assigns low priority BIT SYMBOL FUNCTION IP.7 PT2 Timer 2 interrupt priority bit. IP.6 PPC PCA interrupt priority bit IP ...

Page 52

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM Reduced EMI Mode The AO bit (AUXR.0) in the AUXR register when set disables the ALE output. Reduced EMI Mode AUXR (8EH – – – – – – AUXR.1 EXTRAM (See more detailed description in AUXR ...

Page 53

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM Programmable Counter Array (PCA) The Programmable Counter Array available on the 89C66x is a special 16-bit Timer that has five 16-bit capture/compare modules associated with it. Each of the modules can be programmed to operate in one of four modes: rising and/or falling edge capture, software timer, high-speed output, or pulse width modulator ...

Page 54

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM OSC/6 (6 CLOCK MODE) OR OSC/12 (12 CLOCK MODE) OSC/2 (6 CLOCK MODE) OR OSC/4 (12 CLOCK MODE) TIMER 0 OVERFLOW EXTERNAL INPUT (P1.2/ECI) IDLE PCA TIMER/COUNTER MODULE 0 MODULE 1 MODULE 2 MODULE 3 MODULE 4 CMOD.0 ECF 2002 Oct 28 ...

Page 55

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM CMOD Address = C1H CIDL WDTE Bit Symbol Function CIDL Counter Idle control: CIDL = 0 programs the PCA Counter to continue functioning during idle Mode. CIDL = 1 programs gated off during idle. ...

Page 56

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM CCAPMn Address CCAPM0 0C2H CCAPM1 0C3H CCAPM2 0C4H CCAPM3 0C5H CCAPM4 0C6H Not Bit Addressable – ECOMn Bit Symbol Function – Not implemented, reserved for future use*. ECOMn Enable Comparator ...

Page 57

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM CF CR CEXn –– ECOMn 0 CF WRITE TO RESET CCAPnH CCAPnH WRITE TO CCAPnL 0 1 ENABLE 16–BIT COMPARATOR CH PCA TIMER/COUNTER –– 2002 Oct 28 P89C660/P89C662/P89C664/ –– CCF4 CCF3 CCF2 ...

Page 58

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM WRITE TO RESET CCAPnH CCAPnH WRITE TO CCAPnL 0 1 ENABLE 16–BIT COMPARATOR CH PCA TIMER/COUNTER –– –– ECOMn 2002 Oct 28 P89C660/P89C662/P89C664 –– CCF4 CCF3 CCF2 CCAPnL (TO CCFn) MATCH ...

Page 59

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM WRITE TO RESET CCAP4L WRITE TO CCAP4H 1 0 ENABLE Figure 51. PCA Watchdog Timer m(Module 4 only) PCA Watchdog Timer An on-board watchdog timer is available with the PCA to improve the reliability of the system without increasing chip count. Watchdog timers are useful for systems that are susceptible to noise, power glitches, or electrostatic discharge ...

Page 60

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM INIT_WATCHDOG: MOV CCAPM4, #4CH ; Module 4 in compare mode MOV CCAP4L, #0FFH ; Write to low byte first MOV CCAP4H, #0FFH ; Before PCA timer counts FFFF Hex, these compare values ; must be changed ORL CMOD, #40H ...

Page 61

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM Expanded Data RAM Addressing The P89C660/662/664/668 has internal data memory that is mapped into four separate segments: the lower 128 bytes of RAM, upper 128 bytes of RAM, 128 bytes Special Function Register (SFR), and 256 bytes expanded RAM (ERAM) (256 bytes for the ’ ...

Page 62

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM FF/2FF/6FF/1FFF ERAM 256, 768, 1792 OR 7936 BYTES 000 Figure 54. Internal and External Data Memory Address Space with EXTRAM = 0 Hardware WatchDog Timer (One-Time Enabled with Reset-Out for P89C660/662/664/668) The WDT is intended as a recovery method in situations where the CPU may be subjected to software upset ...

Page 63

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM FLASH EPROM MEMORY GENERAL DESCRIPTION The P89C660/662/664/668 Flash memory augments EPROM functionality with in-circuit electrical erasure and programming. The Flash can be read and written as bytes. The Chip Erase operation will erase the entire program memory ...

Page 64

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM 89C664/89C668 89C662 89C660 Power-On Reset Code Execution The P89C660/662/664/668 contains two special Flash registers: the BOOT VECTOR and the STATUS BYTE. At the falling edge of reset, the P89C660/662/664/668 examines the contents of the Status Byte. If the Status Byte is set to zero, power-up execution starts at location 0000H, which is the normal start address of the user’ ...

Page 65

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM V CC Figure 56. In-System Programming with a Minimum of Pins In-System Programming (ISP) The In-System Programming (ISP) is performed without removing the microcontroller from the system. The In-System Programming (ISP) facility consists of a series of internal hardware resources coupled with internal firmware to facilitate remote programming of the P89C660/662/664/668 through the serial port ...

Page 66

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM The ISP facility was designed so that specific crystal frequencies were not required in order to generate baud rates or time the programming pulses. The user thus needs to provide the Table 14. Intel-Hex Records Used by In-System Programming ...

Page 67

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM RECORD TYPE 03 Miscellaneous Write Functions :nnxxxx03ffssddcc Where number of bytes (hex) in record xxxx = required field, but value is a “don’t care” Write Function ff = subfunction code ss = selection code dd = data input (as needed) ...

Page 68

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM RECORD TYPE 05 Miscellaneous Read Functions General Format of Function 05 :02xxxx05ffsscc Where number of bytes (hex) in record xxxx = required field, but value is a “don’t care” “Miscellaneous Read” function code ...

Page 69

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM In Application Programming Method Several In Application Programming (IAP) calls are available for use by an application program to permit selective erasing and programming of Flash sectors. All calls are made through a common interface, PGM_MTP. The programming functions are selected by setting up the microcontroller’ ...

Page 70

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM IAP CALL ERASE BOOT VECTOR & Input Parameters: STATUS BYTE R0 = osc freq (integer 04h R1 = 84h (WDT feed, Rx2 & 66x only) DPH = 00h DPL = don’t care Return Parameter ...

Page 71

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM IAP CALL PROGRAM STATUS BYTE Input Parameters osc freq (integer 06h R1 = 86h (WDT feed, Rx2, 66x only) DPH = 00h DPL = 00h – program status byte ACC = status byte Return Parameter ACC = 00 if pass ...

Page 72

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM IAP CALL READ MANUFACTURER ID Input Parameters osc freq (integer 00h R1 = 80h (WDT feed, Rx2 & 66x only) DPH = 00h DPL = 00h (manufacturer ID) Return Parameter ACC = value of byte read Sample routine: ...

Page 73

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM IAP CALL READ SECURITY BITS Input Parameters osc freq (integer 07h R1 = 87h (WDT feed, Rx2 & 66x only) DPH = 00h DPL = 00h (security bits) Return Parameter ACC = value of byte read Sample routine: ...

Page 74

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM Security The security feature protects against software piracy and prevents the contents of the Flash from being read. The Security Lock bits are located in Flash. The P89C660/662/664/668 has 3 programmable security lock bits that will provide different levels of protection for the on-chip code and data (see Table 16) ...

Page 75

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM ABSOLUTE MAXIMUM RATINGS PARAMETER Operating temperature under bias Storage temperature range Voltage on EA/V pin Voltage on any other pin Maximum I per I/O pin OL Power dissipation (based on package heat transfer limitations, not device power consumption) NOTES: 1 ...

Page 76

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM DC ELECTRICAL CHARACTERISTICS + 10% or – + 5%; V amb SYMBOL SYMBOL PARAMETER PARAMETER V Input low voltage IL V Input low voltage to P1.6/SCL, P1.7/SDA IL2 V Input high voltage (ports EA Input high voltage, XTAL1, RST ...

Page 77

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM AC ELECTRICAL CHARACTERISTICS (6 CLOCK MODE + 10% or – + amb CC SYMBOL FIGURE 1/t 57 Oscillator frequency CLCL t 57 ALE pulse width LHLL t 57 Address valid to ALE low AVLL t 57 Address hold after ALE low ...

Page 78

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM AC ELECTRICAL CHARACTERISTICS (6 CLOCK MODE) (Continued + 10% or – +85 C,V amb CC SYMBOL PARAMETER Interface t START condition hold time HD;STA t SCL low time LOW t SCL high time HIGH t SCL rise time ...

Page 79

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM AC ELECTRICAL CHARACTERISTICS (12 CLOCK MODE + 10%, or – + amb CC SYMBOL FIGURE 1/t 57 Oscillator frequency CLCL t 57 ALE pulse width LHLL t 57 Address valid to ALE low AVLL t 57 Address hold after ALE low ...

Page 80

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM AC ELECTRICAL CHARACTERISTICS (12 CLOCK MODE) (Continued + 10%, or – + amb CC SYMBOL PARAMETER Interface t START condition hold time HD;STA t SCL low time LOW t SCL high time HIGH t SCL rise time RC t SCL fall time ...

Page 81

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM EXPLANATION OF THE AC SYMBOLS Each timing symbol has five characters. The first character is always ‘t’ (= time). The other characters, depending on their positions, indicate the name of a signal or the logical status of that signal. The designations are: A – ...

Page 82

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM ALE PSEN t LLWL WR t LLAX t AVLL A0–A7 PORT 0 FROM RI OR DPL t AVWL PORT 2 INSTRUCTION 0 1 ALE t XLXL CLOCK t QVXH OUTPUT DATA 0 WRITE TO SBUF t XHDV INPUT DATA VALID CLEAR RI ...

Page 83

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM V –0.5 CC 0.2V +0.9 CC 0.2V –0.1 CC 0.45V NOTE: AC inputs during testing are driven at V –0.5 for a logic ‘1’ and 0.45V for a logic ‘0’. CC Timing measurements are made at V min for a logic ‘ ...

Page 84

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM START or repeated START condition t RD SDA (INPUT/OUTPUT SCL (INPUT/OUTPUT HD;STA LOW HIGH V –0.5 CC 0.45V NOTE: AC inputs during testing are driven at V Timing measurements are made LOAD V LOAD V LOAD ...

Page 85

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM V CC RST 89C660 89C662 89C664 (NC) XTAL2 89C668 CLOCK SIGNAL XTAL1 V SS Figure 68. I Test Condition, Active Mode. CC All other pins are disconnected V CC 0.5V Figure 70. Clock Signal Waveform for I Figure 71 ...

Page 86

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM PLCC44: plastic leaded chip carrier; 44 leads 2002 Oct 28 P89C660/P89C662/P89C664/ 86 Product data P89C668 SOT187-2 ...

Page 87

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM LQFP44: plastic low profile quad flat package; 44 leads; body 1.4 mm 2002 Oct 28 P89C660/P89C662/P89C664/ 87 Product data P89C668 SOT389-1 ...

Page 88

... Philips Semiconductors 80C51 8-bit Flash microcontroller family 16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM REVISION HISTORY Rev Date Description _4 20021028 Product data (9397 750 10403); replaces P89C660/P89C662/P89C664 of 2001 Jul 19 (9397 750 08584) and P89C668 of 2001 Jul 27 (9397 750 08651) Engineering Change Notice 853–2392 29118 (date: 20021028) ...

Page 89

... Life support — These products are not designed for use in life support appliances, devices, or systems where malfunction of these products can reasonably be expected to result in personal injury. Philips Semiconductors customers using or selling these products for use in such applications their own risk and agree to fully indemnify Philips Semiconductors for any damages resulting from such application. Right to make changes — ...

Related keywords