P89LPC938FDH NXP Semiconductors, P89LPC938FDH Datasheet
P89LPC938FDH
Specifications of P89LPC938FDH
Available stocks
Related parts for P89LPC938FDH
P89LPC938FDH Summary of contents
Page 1
P89LPC938 8-bit microcontroller with accelerated two-clock 80C51 core byte-erasable Flash with 10-bit A/D converter Rev. 01 — 25 February 2005 1. General description The P89LPC938 is a single-chip microcontroller, available in low cost packages, based on ...
Page 2
Philips Semiconductors 2.2 Additional features A high performance 80C51 CPU provides instruction cycle times of 111 ns to 222 ns for all instructions except multiply and divide when executing at 18 MHz. This is six times the performance of the ...
Page 3
... Philips Semiconductors 3. Ordering information Table 1: Type number P89LPC938FA P89LPC938FDH P89LPC938FHN 3.1 Ordering options Table 2: Type number P89LPC938FA P89LPC938FDH P89LPC938FHN 9397 750 14051 Product data sheet 8-bit microcontroller with 10-bit A/D converter Ordering information Package Name Description PLCC28 plastic leaded chip carrier; 28 leads TSSOP28 plastic thin shrink small outline package ...
Page 4
Philips Semiconductors 4. Block diagram P89LPC938 AUXILIARY RAM P3[1:0] CONFIGURABLE I/Os P2[7:0] CONFIGURABLE I/Os P1[7:0] CONFIGURABLE I/Os P0[7:0] CONFIGURABLE I/Os WATCHDOG TIMER AND OSCILLATOR PROGRAMMABLE OSCILLATOR DIVIDER X1 CRYSTAL CONFIGURABLE OR RESONATOR X2 Fig 1. Block diagram. 9397 750 14051 ...
Page 5
Philips Semiconductors 5. Functional diagram KBI0 AD05 KBI1 AD00 KBI2 AD01 KBI3 AD02 KBI4 AD03 KBI5 KBI6 KBI7 CLKOUT Fig 2. P89LPC938 functional diagram. 9397 750 14051 Product data sheet 8-bit microcontroller with 10-bit A/D converter CMP2 ...
Page 6
... Philips Semiconductors 6. Pinning information 6.1 Pinning Fig 3. TSSOP28 pin configuration. Fig 4. 9397 750 14051 Product data sheet P2.0/ICB/AD07 1 2 P2.1/OCD/AD06 3 P0.0/CMP2/KBI0/AD05 P1.7/OCC/AD04 4 P1.6/OCB 5 6 P1.5/RST P89LPC938FDH P3.1/XTAL1 8 9 P3.0/XTAL2/CLKOUT 10 P1.4/INT1 P1.3/INT0/SDA 11 12 P1.2/T0/SCL 13 P2.2/MOSI P2.3/MISO 14 5 P1.6/OCB P1.5/RST P3.1/XTAL1 8 P89LPC938FA 9 P3 ...
Page 7
Philips Semiconductors Fig 5. HVQFN28 pin configuration (top view). 6.2 Pin description Table 3: Pin description Symbol Pin TSSOP28, HVQFN28 PLCC28 P0.0 to P0.7 P0.0/CMP2 KBI0/AD05 P0.1/CIN2B KBI1/AD00 9397 750 14051 Product data sheet 8-bit microcontroller ...
Page 8
Philips Semiconductors Table 3: Pin description …continued Symbol Pin TSSOP28, HVQFN28 PLCC28 P0.2/CIN2A KBI2/AD01 P0.3/CIN1B KBI3/AD02 P0.4/CIN1A KBI4/AD03 P0.5/CMPREF KBI5 P0.6/CMP1 KBI6 P0.7/T1/KBI7 19 15 P1.0 to P1.7 P1.0/TXD 18 ...
Page 9
Philips Semiconductors Table 3: Pin description …continued Symbol Pin TSSOP28, HVQFN28 PLCC28 P1.3/INT0/SDA 11 7 P1.4/INT1 10 6 P1.5/RST 6 2 P1.6/OCB 5 1 P1.7/OCC AD04 P2.0 to P2.7 P2.0/ICB/AD07 1 25 P2.1/OCD AD06 P2.2/MOSI 13 ...
Page 10
Philips Semiconductors Table 3: Pin description …continued Symbol Pin TSSOP28, HVQFN28 PLCC28 P2.4/ P2.5/SPICLK 16 12 P2.6/OCA 27 23 P2.7/ICA 28 24 P3.0 to P3.1 P3.0/XTAL2 CLKOUT P3.1/XTAL1 ...
Page 11
Philips Semiconductors 7. Functional description Remark: Please refer to the P89LPC938 User’s Manual for a more detailed functional description. 7.1 Special function registers Remark: SFR accesses are restricted in the following ways: • User must not attempt to access any ...
Page 12
Table 4: P89LPC938 Special function registers * indicates SFRs that are bit addressable. Name Description SFR addr. Bit address ACC* Accumulator E0H AD0CON ADC0 control register 97H AD0INS ADC0 input select A3H AD0MOD ADC0 mode register A C0H A AD0MOD ...
Page 13
Table 4: P89LPC938 Special function registers * indicates SFRs that are bit addressable. Name Description SFR addr. DPTR Data pointer (2 bytes) DPH Data pointer high 83H DPL Data pointer low 82H FMADRH Program Flash address high E7H FMADRL Program ...
Page 14
Table 4: P89LPC938 Special function registers * indicates SFRs that are bit addressable. Name Description SFR addr. IP0H Interrupt priority 0 high B7H Bit address IP1* Interrupt priority 1 F8H IP1H Interrupt priority 1 high F7H IP2 Interrupt priority 2 ...
Page 15
Table 4: P89LPC938 Special function registers * indicates SFRs that are bit addressable. Name Description SFR addr. P1* Port 1 90H Bit address P2* Port 2 A0H Bit address P3* Port 3 B0H P0M1 Port 0 output mode 1 84H ...
Page 16
Table 4: P89LPC938 Special function registers * indicates SFRs that are bit addressable. Name Description SFR addr. SP Stack pointer 81H SPCTL SPI control register E2H SPSTAT SPI status register E1H SPDAT SPI data register E3H TAMOD Timer 0 and ...
Page 17
Table 4: P89LPC938 Special function registers * indicates SFRs that are bit addressable. Name Description SFR addr. WDL Watchdog load C1H WFEED1 Watchdog feed 1 C2H WFEED2 Watchdog feed 2 C3H [1] BRGR1 and BRGR0 must only be written if ...
Page 18
Table 5: P89LPC938 extended special function registers Name Description ADC0HBND ADC0 high _boundary register, left (MSB) ADC0LBND ADC0 low_boundary register (MSB) AD0DAT0R ADC0 data register 0, right (LSB) AD0DAT0L ADC0 data register 0, left (MSB) AD0DAT1R ADC0 data register 1, ...
Page 19
Philips Semiconductors 7.2 Enhanced CPU The P89LPC938 uses an enhanced 80C51 CPU which runs at six times the speed of standard 80C51 devices. A machine cycle consists of two CPU clock cycles, and most instructions execute in one or two ...
Page 20
Philips Semiconductors The frequency of this clock output is in Idle mode, it may be turned off prior to entering Idle, saving additional power. 7.4 On-chip RC oscillator option The P89LPC938 has a 6-bit TRIM register that can be used ...
Page 21
Philips Semiconductors 7.7 CCLK wake-up delay The P89LPC938 has an internal wake-up timer that delays the clock until it stabilizes depending on the clock source used. If the clock source is any of the three crystal selections (low, medium and ...
Page 22
Philips Semiconductors • CODE Code memory space, accessed as part of program execution and via the MOVC instruction. The P89LPC938 has on-chip Code memory. The P89LPC938 also has 512 bytes of on-chip Data EEPROM ...
Page 23
Philips Semiconductors In edge-triggered mode, if successive samples of the INTn pin show a HIGH in one cycle and a LOW in the next cycle, the interrupt request flag IEn in TCON is set, causing an interrupt request ...
Page 24
Philips Semiconductors 7.13 I/O ports The P89LPC938 has four I/O ports: Port 0, Port 1, Port 2, and Port 3. Ports 0, 1and 2 are 8-bit ports, and Port 2-bit port. The exact number of I/O pins ...
Page 25
Philips Semiconductors An open-drain port pin has a Schmitt triggered input that also has a glitch suppression circuit. 7.13.1.3 Input-only configuration The input-only port configuration has no output drivers Schmitt triggered input that also has a glitch ...
Page 26
Philips Semiconductors 7.14.1 Brownout detection The brownout detect function determines if the power supply voltage drops below a certain level. The default operation is for a brownout detection to cause a processor reset, however it may alternatively be configured to ...
Page 27
Philips Semiconductors 7.15.3 Total Power-down mode This is the same as Power-down mode except that the brownout detection circuitry and the voltage comparators are also disabled to conserve additional power. The internal RC oscillator is disabled unless both the RC ...
Page 28
Philips Semiconductors 7.17 Timers/counters 0 and 1 The P89LPC938 has two general purpose counter/timers which are upward compatible with the standard 80C51 Timer 0 and Timer 1. Both can be configured to operate either as timers or event counter. An ...
Page 29
Philips Semiconductors the CPU clock. If the XTAL oscillator is used as the CPU clock, then the RTC will use CCLK as its clock source. Only power-on reset will reset the RTC and its associated SFRs to the default state. ...
Page 30
Philips Semiconductors Capture Noise Filter bit. If set, the capture logic needs to see four consecutive samples of the same value in order to recognize an edge as a capture event. An event counter can be set to delay a ...
Page 31
Philips Semiconductors 7.19.7 Alternating output mode In asymmetrical mode, the user can set up PWM channels A/B and C/D as alternating pairs for bridge drive control. In this mode the output of these PWM channels are alternately gated on every ...
Page 32
Philips Semiconductors 7.19.9 CCU interrupts There are seven interrupt sources on the CCU which share a common interrupt vector. EA (IEN0.7) ECCU (IEN1.4) TOIE2 (TICR2.7) TOIF2 (TIFR2.7) TICIE2A (TICR2.0) TICF2A (TIFR2.0) TICIE2B (TICR2.1) TICF2B (TIFR2.1) TOCIE2A (TICR2.3) TOCF2A (TIFR2.3) TOCIE2B ...
Page 33
Philips Semiconductors 7.20.3 Mode 2 11 bits are transmitted (through TXD) or received (through RXD): start bit (logic 0), 8 data bits (LSB first), a programmable 9 transmitted, the 9 example, the parity bit (P, in the PSW) could be ...
Page 34
Philips Semiconductors 7.20.8 Double buffering The UART has a transmit double buffer that allows buffering of the next character to be written to SBUF while the first character is being transmitted. Double buffering allows transmission of a string of characters ...
Page 35
Philips Semiconductors 2 7.21 I C-bus serial interface 2 I C-bus uses two wires (SDA and SCL) to transfer information between devices connected to the bus, and it has the following features: • Bi-directional data transfer between masters and slaves ...
Page 36
Philips Semiconductors P1.3/SDA P1.2/SCL Fig 14. I 9397 750 14051 Product data sheet P1.3 INPUT FILTER OUTPUT STAGE INPUT FILTER OUTPUT STAGE timer 1 overflow I2CON P1.2 I2SCLH I2SCLL status bus I2STAT 2 C-bus serial interface block diagram. Rev. 01 ...
Page 37
Philips Semiconductors 7.22 SPI The P89LPC938 provides another high-speed serial communication interface—the SPI interface. SPI is a full-duplex, high-speed, synchronous communication bus with two operation modes: Master mode and Slave mode Mbit/s can be supported in either ...
Page 38
Philips Semiconductors 7.22.1 Typical SPI configurations Fig 16. SPI single master single slave configuration. Fig 17. SPI dual device configuration, where either can be a master or a slave. 9397 750 14051 Product data sheet 8-bit microcontroller with 10-bit A/D ...
Page 39
Philips Semiconductors Fig 18. SPI single master multiple slaves configuration. 9397 750 14051 Product data sheet 8-bit microcontroller with 10-bit A/D converter master MISO 8-BIT SHIFT MOSI REGISTER SPICLK SPI CLOCK port GENERATOR port Rev. 01 — 25 February 2005 ...
Page 40
Philips Semiconductors 7.23 Analog comparators Two analog comparators are provided on the P89LPC938. Input and output options allow use of the comparators in a number of different configurations. Comparator operation is such that the output is a logical one (which ...
Page 41
Philips Semiconductors If a comparator interrupt is enabled (except in Total Power-down mode), a change of the comparator output state will generate an interrupt and wake up the processor. If the comparator output to a pin is enabled, the pin ...
Page 42
Philips Semiconductors 7.25 Watchdog timer The watchdog timer causes a system reset when it underflows as a result of a failure to feed the timer prior to the timer reaching its terminal count. It consists of a programmable 12-bit prescaler, ...
Page 43
Philips Semiconductors 7.27 Data EEPROM The P89LPC938 has 512 bytes of on-chip Data EEPROM. The Data EEPROM is SFR based, byte readable, byte writable, and erasable (via row fill and sector fill). The user can read, write and fill the ...
Page 44
Philips Semiconductors 7.28.3 Flash organization The program memory consists of eight 1 kB sectors on the P89LPC938 devices. Each sector can be further divided into 64-byte pages. In addition to sector erase, page erase, and byte erase, a 64-byte page ...
Page 45
Philips Semiconductors In addition, IAP operations can be accomplished through the use of four SFRs consisting of a control/status register, a data register, and two address registers. Additional details may be found in the P89LPC938 User’s Manual . 7.28.8 ISP ...
Page 46
Philips Semiconductors 7.29 User configuration bytes Some user-configurable features of the P89LPC938 must be defined at power-up and therefore cannot be set by the program after start of execution. These features are configured through the use of the Flash byte ...
Page 47
Philips Semiconductors 8.3 Block diagram Fig 21. A/D converter block diagram. 8.4 A/D operating modes 8.4.1 Fixed channel, single conversion mode A single input channel can be selected for conversion. A single conversion will be performed and the result placed ...
Page 48
Philips Semiconductors after the remaining input channels have been converted. After all selected channels have been converted, the process will repeat starting with the first selected channel. Additional conversion results will again cycle through the eight result register pairs, overwriting ...
Page 49
Philips Semiconductors criteria, the boundary limits will again be compared after all 8 MSBs have been converted. A boundary status register (BNDSTA0) flags the channels which caused a boundary interrupt. 8.7 Clock divider The A/D converter requires that its internal ...
Page 50
Philips Semiconductors 9. Limiting values Table 9: Limiting values In accordance with the Absolute Maximum Rating System (IEC 60134). Symbol Parameter T operating bias ambient temperature amb(bias) T storage temperature range stg V voltage on XTAL1, XTAL2 pin to V ...
Page 51
Philips Semiconductors 10. Static characteristics Table 10: DC electrical characteristics 3.6 V unless otherwise specified +85 C for industrial applications, unless otherwise specified. amb Symbol Parameter I operating supply ...
Page 52
Philips Semiconductors Table 10: DC electrical characteristics 3.6 V unless otherwise specified +85 C for industrial applications, unless otherwise specified. amb Symbol Parameter V brownout trip voltage bo V ...
Page 53
Philips Semiconductors 11. Dynamic characteristics Table 11: AC characteristics 3.6 V, unless otherwise specified +85 C for industrial applications, unless otherwise specified. amb Symbol Parameter f internal RC oscillator ...
Page 54
Philips Semiconductors Table 11: AC characteristics …continued 3.6 V, unless otherwise specified +85 C for industrial applications, unless otherwise specified. amb Symbol Parameter t SPICLK HIGH time SPICLKH 3.0 ...
Page 55
Philips Semiconductors Table 12: AC characteristics 3.6 V, unless otherwise specified +85 C for industrial applications, unless otherwise specified. amb Symbol Parameter f internal RC oscillator frequency OSC(RC) f ...
Page 56
Philips Semiconductors Table 12: AC characteristics …continued 3.6 V, unless otherwise specified +85 C for industrial applications, unless otherwise specified. amb Symbol Parameter t SPICLK HIGH time SPICLKH 4.5 ...
Page 57
Philips Semiconductors 11.1 Waveforms clock t QVXH output data write to SBUF t XHDV input data clear RI Fig 22. Shift register mode timing 0.2V 0.2V 0.45 V Fig 23. External clock timing. 9397 750 14051 ...
Page 58
Philips Semiconductors SS SPICLK (CPOL = 0) (output) SPICLK (CPOL = 1) (output) MISO (input) t MOSI SPIF (output) Fig 24. SPI master timing (CPHA = ‘0’). SS SPICLK (CPOL = 0) (output) SPICLK (CPOL = 1) (output) MISO (input) ...
Page 59
Philips Semiconductors SS t SPIR t SPILEAD SPICLK (CPOL = 0) (input) t SPIF SPICLK (CPOL = 1) (input) t SPIA MISO (output) t SPIDSU MOSI (input) Fig 26. SPI slave timing (CPHA = ‘0’). SS t SPIR t SPILEAD ...
Page 60
Philips Semiconductors 11.2 ISP entry mode Table 13: AC characteristics, ISP entry mode 3.6 V, unless otherwise specified +85 C for industrial applications, unless otherwise specified. amb Symbol Parameter ...
Page 61
Philips Semiconductors 12.2 A/D converter electrical characteristics Table 15: A/D converter electrical characteristics 3.6 V, unless otherwise specified +85 C for industrial applications, unless otherwise specified. amb All limits ...
Page 62
Philips Semiconductors 13. Package outline PLCC28: plastic leaded chip carrier; 28 leads pin 1 index DIMENSIONS (mm dimensions are derived from the original inch dimensions ...
Page 63
Philips Semiconductors TSSOP28: plastic thin shrink small outline package; 28 leads; body width 4 pin 1 index 1 DIMENSIONS (mm are the original dimensions) A UNIT max. 0.15 0.95 mm ...
Page 64
Philips Semiconductors HVQFN28: plastic thermal enhanced very thin quad flat package; no leads; 28 terminals; body 0.85 mm terminal 1 index area terminal 1 28 index area DIMENSIONS (mm ...
Page 65
Philips Semiconductors 14. Abbreviations Table 16: Acronym A/D ADC CCU CPU DAC EPROM EEPROM EMI IAP ICP ISP LED PLL PWM RAM RC RTC SAR SFR SPI UART 9397 750 14051 Product data sheet 8-bit microcontroller with 10-bit A/D converter ...
Page 66
Philips Semiconductors 15. Revision history Table 17: Revision history Document ID Release date P89LPC938_1 20050225 9397 750 14051 Product data sheet 8-bit microcontroller with 10-bit A/D converter Data sheet status Change notice Product data sheet - Rev. 01 — 25 ...
Page 67
Philips Semiconductors 16. Data sheet status [1] Level Data sheet status Product status I Objective data Development II Preliminary data Qualification III Product data Production [1] Please consult the most recently issued data sheet before initiating or completing a design. ...
Page 68
Philips Semiconductors 20. Contents 1 General description . . . . . . . . . . . . . . . . . . . . . . 1 2 Features . . . . . . . . ...