| The Datasheet Archive - 100 Million Datasheets from 7500 Manufacturers. |
P89LPC915/916/917 8-bit microcontrollers with two-clock 80C51 core 8-b
Top Searches for this datasheetUM10107 P89LPC915/916/917 8-bit microcontrollers with two-clock 80C51 core 8-bit Rev. July 2004 User manual Document information Info Keywords Abstract Content P89LPC915, P89LPC916, P89LPC917 Technical information P89LPC915, P89LPC916, P89LPC917 devices. Philips Semiconductors UM10107 P89LPC915/916/917 User manual Revision history Date 20040715 Description Initial version (9397 13316). Contact information additional information, please visit: sales office addresses, please send email 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual Introduction P89LPC915/916/917 single-chip microcontrollers designed applications demanding high-integration, cost solutions over wide range performance requirements. P89LPC915/916/917 based high performance processor architecture that executes instructions four clocks, times rate standard 80C51 devices. Many system-level functions have been incorporated into P89LPC915/916/917 order reduce component count, board space, system cost. Logic symbols DAC1 AD10 AD11 AD12 AD13 CLKIN KBI0 KBI1 KBI2 KBI3 KBI4 KBI5 CMP2 CIN2B CIN2A CIN1B CIN1A CMPREF P89LPC915 INT0 INT1 PORT 002aaa828 P89LPC915 logic symbol. PORT DAC1 AD10 AD11 AD12 AD13 CLKIN KBI1 KBI2 KBI3 KBI4 KBI5 CIN2B CIN2A CIN1B CIN1A CMPREF PORT PORT INT0 MOSI MISO SPICLK P89LPC916 PORT 002aaa829 P89LPC916 logic symbol. 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual DAC1 AD10 AD11 AD12 AD13 CLKIN CLKOUT KBI0 KBI1 KBI2 KBI3 KBI4 KBI5 KBI7 CMP2 CIN2B CIN2A CIN1B CIN1A CMPREF P89LPC917 INT0 INT1 PORT PORT 002aaa830 P89LPC917 logic symbol. Product comparison Table highlights differences between these devices. complete list device features, please refer P89LPC915/916/917 data sheet. Table Type number Product comparison Comp output output CLKOUT INT1 P89LPC915 P89LPC916 P89LPC917 Configuration CIN2B/KBI1/AD10/P0.1 KBI0/CMP2/P0.0 RST/P1.5 INT1/P1.4 SDA/INT0/P1.3 SCL/T0/P1.2 002aaa825 P0.2/CIN2A/KBI2/AD11 P0.3/CIN1B/KBI3/AD12 P0.4/CIN1A/KBI4/AD13/DAC1 LPC915 P0.5/CMPREF/KBI5/CLKIN P1.0/TXD P1.1/RXD P89LPC915 TSSOP14 configuration. 9397 13316 PORT Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual CIN2B/KBI1/AD10/P0.1 SS/P2.4 RST/P1.5 MISO/P2.3 MOSI/P2.2 SDA/INT0/P1.3 SCL/T0/P1.2 002aaa826 P0.2/CIN2A/KBI2/AD11 P0.3/CIN1B/KB13/AD12 P0.4/CIN1A/KBI4/AD13/DAC1 LPC916 P0.5/CMPREF/KBI5/CLKIN P2.5/SPICLK P1.0/TXD P1.1/RXD P89LPC916 TSSOP16 configuration. CIN2B/KBI1/AD10/P0.1 KBI0/CMP2/P0.0 RST/P1.5 MOSI/P2.2 INT1/P1.4 SDA/INT0/P1.3 SCL/T0/P1.2 002aaa827 P0.2/CIN2A/KBI2/AD11 P0.3/CIN1B/KB13/AD12 P0.4/CIN1A/KBI4/AD13/DAC1 LPC917 P0.5/CMPREF/KBI5/CLKIN P0.7/T1/KBI7/CLKOUT P1.0/TXD P1.1/RXD P89LPC917 TSSOP configuration. 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual Table Symbol P89LPC915 description Type Description Port Port 6-bit port with user-configurable outputs. During reset Port latches configured input only mode with internal pull-up disabled. operation Port pins inputs outputs depends upon port configuration selected. Each port configured independently. Refer Section details. Keypad Interrupt feature operates with Port pins. pins have Schmitt triggered inputs. Port also provides various special functions described below: P0.0 Port CMP2 Comparator output. KBI0 Keyboard input P0.1 Port CIN2B Comparator positive input KBI1 Keyboard input AD10 channel input P0.2 Port CIN2A Comparator positive input KBI2 Keyboard input AD11 channel input P0.3 Port CIN1B Comparator positive input KBI3 Keyboard input AD12 channel input P0.4 Port CIN1A Comparator positive input KBI4 Keyboard input AD13 channel input DAC1 Digital analog converter output. P0.5 Port CMPREF Comparator reference (negative) input. KBI5 Keyboard input CLKIN External clock input. P0.0 P0.5 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual Table Symbol P89LPC915 description Type Description Port Port 6-bit port with user-configurable outputs. During reset Port (P1.2); latches configured input only mode with internal pull-up disabled. (P1.5) operation inputs outputs depends upon port configuration selected. Refer Section details. P1.2 open drain when used output. P1.5 input only. pins have Schmitt triggered inputs. Port also provides various special functions described below: P1.0 Port Serial port transmitter data. P1.1 Port Serial port receiver data. P1.2 Port (Open drain when used output.) Timer/counter external count input, overflow output, output. serial clock input/output. P1.3 Port (Open drain when used output.) INT0 External interrupt input. serial data input/output. P1.4 Port INT1 External interrupt 1input. P1.5 Port (Input only.) External Reset input during power-on selected UCFG1. When functioning reset input this resets microcontroller, causing ports peripherals take their default states, processor begins execution address Also used during power-on sequence force In-System Programming mode. Ground: reference. Power Supply: This power supply voltage normal operation well Idle Power-down modes. P1.0 P1.5 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual Table Symbol P89LPC916 description Type Description Port Port 5-bit port with user-configurable outputs. During reset Port latches configured input only mode with internal pull-up disabled. operation Port pins inputs outputs depends upon port configuration selected. Each port configured independently. Refer Section details. Keypad Interrupt feature operates with Port pins. pins have Schmitt triggered inputs. Port also provides various special functions described below: P0.1 Port CIN2B Comparator positive input KBI1 Keyboard input AD10 channel input P0.2 Port CIN2A Comparator positive input KBI2 Keyboard input AD11 channel input P0.3 Port CIN1B Comparator positive input KBI3 Keyboard input AD12 channel input P0.4 Port CIN1A Comparator positive input KBI4 Keyboard input AD13 channel input DAC1 Digital analog converter output. P0.5 Port CMPREF Comparator reference (negative) input. KBI5 Keyboard input CLKIN External clock input. P0.1 P0.5 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual Table Symbol P89LPC916 description Type Description Port Port 5-bit port with user-configurable outputs. During reset Port (P1.2); latches configured input only mode with internal pull-up disabled. (P1.5) operation P1.2 input outputs depends upon port configuration selected. Refer Section details. P1.2 open drain when used output. P1.5 input only. pins have Schmitt triggered inputs. Port also provides various special functions described below: P1.0 Port Serial port transmitter data. P1.1 Port Serial port receiver data. P1.2 Port (Open drain when used output.) Timer/counter external count input, overflow output, output. serial clock input/output. P1.3 Port (Open drain when used output.) INT0 External interrupt input. serial data input/output. P1.5 Port (Input only.) External Reset input during power-on selected UCFG1. When functioning reset input this resets microcontroller, causing ports peripherals take their default states, processor begins execution address Also used during power-on sequence force In-System Programming mode. Port Port 4-bit port having user-configurable output types. During reset Port latches configured input only mode with internal pull-up disabled. operation input outputs depends upon port configuration selected. Refer Section details. pins have Schmitt triggered inputs. Port also provides various special functions described below: P2.2 Port MOSI master slave When configured master this output. When configured slave, this input. P2.3 Port MISO master slave out. When configured master this input. When configured slave, this output. P2.4 Port Slave select. P2.5 Port SPICLK When configured master this output. When configured slave, this input. Ground: reference. Power Supply: This power supply voltage normal operation well Idle Power-down modes. P1.0 P1.3, P1.5 P2.2 P2.5 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual Table Symbol P89LPC917 description Type Description Port Port 7-bit port with user-configurable outputs. During reset Port latches configured input only mode with internal pull-up disabled. operation Port pins inputs outputs depends upon port configuration selected. Each port configured independently. Refer Section details. Keypad Interrupt feature operates with Port pins. pins have Schmitt triggered inputs. Port also provides various special functions described below: P0.0 Port CMP2 Comparator output. KBI0 Keyboard input P0.1 Port CIN2B Comparator positive input KBI1 Keyboard input AD10 channel input P0.2 Port CIN2A Comparator positive input KBI2 Keyboard input AD11 channel input P0.3 Port CIN1B Comparator positive input KBI3 Keyboard input AD12 channel input P0.4 Port CIN1A Comparator positive input KBI4 Keyboard input AD13 channel input DAC1 Digital analog converter output. P0.5 Port CMPREF Comparator reference (negative) input. KBI5 Keyboard input CLKIN External clock input. P0.7 Port Timer/counter external count input, overflow output, output. KBI7 Keyboard input CLKOUT Clock output. P0.0 P0.5, P0.7 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual Table Symbol P89LPC917 description Type (P1.0:4); (P1.5) Description Port Port 6-bit port with user-configurable outputs. During reset Port latches configured input only mode with internal pull-up disabled. operation outputs depends upon port configuration selected. Refer Section details. P1.2 P1.3 open drain when used outputs. P1.5 input only. pins have Schmitt triggered inputs. Port also provides various special functions described below: P1.0 Port Serial port transmitter data. P1.1 Port Serial port receiver data. P1.2 Port (Open drain when used output.) Timer/counter external count input, overflow, output. serial clock input/output. P1.3 Port (Open drain when used output.) INT0 External interrupt input. serial data input/output. P1.4 Port INT1 External interrupt 1input. P1.5 Port (Input only.) External Reset input during power-on selected UCFG1. When functioning reset input this resets microcontroller, causing ports peripherals take their default states, processor begins execution address Also used during power-on sequence force In-System Programming mode. Port Port single-bit port with user-configurable output. During reset Port latch configured input only mode with internal pull-up disabled. operation output depends upon port configuration selected. Refer Section details. This Schmitt triggered input. Ground: reference. Power Supply: This power supply voltage normal operation well Idle Power-down modes. P1.0 P1.5 P2.2 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual P89LPC915 HIGH PERFORMANCE ACCELERATED 2-CLOCK 80C51 CODE FLASH 256-BYTE DATA PORT CONFIGURABLE I/Os PORT CONFIGURABLE I/Os INTERNAL UART ADC1/DAC1 REAL-TIME CLOCK/ SYSTEM TIMER TIMER TIMER KEYPAD INTERRUPT WATCHDOG TIMER OSCILLATOR ANALOG COMPARATORS PROGRAMMABLE OSCILLATOR DIVIDER external clock input ON-CHIP OSCILLATOR CLOCK POWER MONITOR (POWER-ON RESET, BROWNOUT RESET) 002aaa822 P89LPC915 block diagram. 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual P89LPC916 HIGH PERFORMANCE ACCELERATED 2-CLOCK 80C51 CODE FLASH 256-BYTE DATA PORT CONFIGURABLE I/Os PORT CONFIGURABLE I/Os PORT CONFIGURABLE I/Os INTERNAL UART ADC1/DAC1 REAL-TIME CLOCK/ SYSTEM TIMER TIMER TIMER KEYPAD INTERRUPT WATCHDOG TIMER OSCILLATOR ANALOG COMPARATORS PROGRAMMABLE OSCILLATOR DIVIDER external clock input ON-CHIP OSCILLATOR CLOCK POWER MONITOR (POWER-ON RESET, BROWNOUT RESET) 002aaa823 P89LPC916 block diagram. 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual P89LPC917 HIGH PERFORMANCE ACCELERATED 2-CLOCK 80C51 CODE FLASH 256-BYTE DATA PORT CONFIGURABLE I/Os PORT CONFIGURABLE I/Os PORT CONFIGURABLE I/Os INTERNAL UART ADC1/DAC1 REAL-TIME CLOCK/ SYSTEM TIMER TIMER TIMER KEYPAD INTERRUPT WATCHDOG TIMER OSCILLATOR ANALOG COMPARATORS PROGRAMMABLE OSCILLATOR DIVIDER external clock input ON-CHIP OSCILLATOR CLKOUT CLOCK POWER MONITOR (POWER-ON RESET, BROWNOUT RESET) 002aaa824 P89LPC917 block diagram. 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual Special function registers Remark: Special Function Registers (SFRs) accesses restricted following ways: User must attempt access locations defined. Accesses defined locations must strictly functions SFRs. bits labeled `-', only written read follows: Unless otherwise specified, must written with `0', return value when read (even written with `0'). reserved used future derivatives. must written with `0', will return when read. must written with `1', will return when read. 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx User manual Rev. July 2004 Koninklijke Philips Electronics N.V. 2004. rights reserved. 9397 13316 Philips Semiconductors Table P89LPC915 Special function registers indicates SFRs that addressable. Name Description functions addresses addr. address ACC* ADCON1 ADINS ADMODA ADMODB AD1BH AD1BL AD1DAT0 AD1DAT1 AD1DAT2 AD1DAT3 AUXR1 BRGR0[2] BRGR1[2] BRGCON CMP1 CMP2 DIVM DPTR FMADRH FMADRL Accumulator control register input select mode register mode register A/D_1 boundary high register A/D_1 boundary register A/D_1 data register A/D_1 data register A/D_1 data register A/D_1 data register Auxiliary function register register Baud rate generator rate Baud rate generator rate high Baud rate generator control Comparator control register Comparator control register clock divide-by-M control Data pointer bytes) Data pointer high Data pointer Program Flash address high Program Flash address 00000000 00000000 00000000 00000000 SBRGS BRGEN CMF1 CMF2 CLKLP EBRR ENT0 SRST 00[2] 00[1] 00[1] 00000000 00000000 00000000 xxxxxx00 xx000000 xx000000 00000000 address ENBI1 ADI13 BNDI1 CLK2 ENADCI ADI12 BURST1 CLK1 TMM1 ADI11 SCC1 CLK0 EDGE1 ADI10 SCAN1 ADCI1 ENDAC1 ENADC1 ADCS11 BSA1 Reset value ADCS10 00000000 00000000 00000000 00000000 000x0000 11111111 00000000 00000000 00000000 00000000 00000000 000000x0 Binary P89LPC915/916/917 User manual UM10107 xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx Table P89LPC915 Special function registers indicates SFRs that addressable. Name FMCON Description Program Flash Control (Read) Program Flash Control (Write) FMDATA I2ADR I2CON* I2DAT I2SCLH Rev. July 2004 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual 9397 13316 Philips Semiconductors functions addresses addr. BUSY Reset value Binary 01110000 FMCMD. FMCMD. FMCMD. FMCMD. FMCMD. FMCMD. FMCMD. FMCMD. STA.4 PADH STA.3 EWDRT PWDRT PWDRT PSTH STA.2 PBOH STA.1 ES/ESR PS/PSR PSH/ PSRH STA.0 PT1H PX1H EKBI PT0H PKBI PKBIH PATN _SEL EI2C PX0H PI2C PI2CH KBIF 00[1] 00[1] 00[1] 00x00000 00x00000 xxxxxx00 00000000 11111111 00[1] 00[1] x0000000 00[1] 00x00000 00000000 00000000 00000000 11111000 I2ADR.6 I2ADR.5 I2EN I2ADR.4 I2ADR.3 I2ADR.2 I2ADR.1 I2ADR.0 CRSEL x00000x0 00000000 00000000 Program Flash data slave address register control register address data register Serial clock generator/SCL duty cycle register high Serial clock generator/SCL duty cycle register status register Interrupt enable Interrupt enable Interrupt priority Interrupt priority high I2SCLL I2STAT IEN0* IEN1* IP0* IP0H address address address address IP1* IP1H KBCON KBMASK KBPATN Interrupt priority Interrupt priority high Keypad control register Keypad interrupt mask register Keypad pattern register address P89LPC915/916/917 User manual x0000000 UM10107 xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx Table P89LPC915 Special function registers indicates SFRs that addressable. Name Description Port functions addresses addr. address P0M1 P0M2 P1M1 P1M2 PCON PCONA PSW* PT0AD RSTSRC RTCCON RTCH RTCL SADDR SADEN SBUF Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 9397 13316 Philips Semiconductors Reset value CIN1A /KBI4 INT1 CIN1B /KBI3 INT0/ CIN2A /KBI2 T0/SCL CIN2B /KBI1 CMP2 /KBI0 Binary SMOD1 RTCPD RTCF SMOD0 RTCS1 CMPREF /KBI5 Port Port output mode Port output mode Port output mode Port output mode Power control register Power control register Program status word Port digital input disable Reset source register Real-time clock control Real-time clock register high Real-time clock register Serial port address register Serial port address enable Serial Port data buffer register Serial port control Serial port extended status register Stack pointer Timer auxiliary mode Timer control Timer high address (P0M1.5) (P0M1.4) (P0M1.3) (P0M1.2) (P0M1.1) (P0M1.0) FF[1] (P0M2.5) (P0M2.4) (P0M2.3) (P0M2.2) (P0M2.1) (P0M2.0) BOPD VCPD RTCS0 (P1M1.4) (P1M1.3) (P1M1.2) (P1M1.1) (P1M1.0) ADPD I2PD R_BK R_WD PMOD1 R_SF ERTC PMOD0 R_EX RTCEN 60[1][6] 00[6] 00[6] 00[1] D3[1] 00[1] 11111111 00000000 11x1xx11 00x0xx00 00000000 00000000 00000000 xx00000x (P1M2.4) (P1M2.3) (P1M2.2) (P1M2.1) (P1M2.0) 00[1] PT0AD.5 PT0AD.4 PT0AD.3 PT0AD.2 PT0AD.1 011xxx00 00000000 00000000 00000000 00000000 xxxxxxxx 00000000 00000000 00000111 xxx0xxx0 00000000 00000000 P89LPC915/916/917 User manual address SCON* SSTAT TAMOD TCON* SM0/FE DBMOD INTLO CIDIS DBISEL STINT UM10107 T0M2 address xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx Table P89LPC915 Special function registers indicates SFRs that addressable. Name TMOD TRIM WDCON WFEED1 WFEED2 Rev. July 2004 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual 9397 13316 Philips Semiconductors Description Timer high Timer Timer Timer mode Internal oscillator trim register Watchdog control register Watchdog load Watchdog feed Watchdog feed functions addresses addr. T1GATE RCCLK PRE2 T1C/T PRE1 T1M1 TRIM.5 PRE0 T1M0 TRIM.4 T0GATE TRIM.3 T0C/T TRIM.2 WDRUN T0M1 TRIM.1 WDTOF Reset value T0M0 TRIM.0 WDCLK Binary 00000000 00000000 00000000 00000000 11111111 ports input only (high impedance) state after power-up. BRGR1 BRGR0 must only written BRGEN BRGCON logic written while BRGEN result unpredictable. RSTSRC register reflects cause P89LPC915/916/917 reset. Upon power-up reset, reset source flags cleared except BOF; power-on reset value xx110000. After reset, value 111001x1, i.e., PRE[2:0] logic WDRUN WDCLK WDTOF logic after Watchdog reset logic after power-on reset. Other resets will affect WDTOF. power-on reset, TRIM initialized with factory preprogrammed value. Other resets will cause initialization TRIM register. only reset source that affects these SFRs power-on reset P89LPC915/916/917 User manual UM10107 xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx User manual Rev. July 2004 Koninklijke Philips Electronics N.V. 2004. rights reserved. 9397 13316 Philips Semiconductors Table P89LPC916 Special function registers indicates SFRs that addressable. Name Description functions addresses addr. address ACC* ADCON1 ADINS ADMODA ADMODB AD1BH AD1BL AD1DAT0 AD1DAT1 AD1DAT2 AD1DAT3 AUXR1 BRGR0[2] BRGR1[2] BRGCON CMP1 CMP2 DIVM DPTR FMADRH Accumulator control register input select mode register mode register A/D_1 boundary HIGH register A/D_1 boundary register A/D_1 data register A/D_1 data register A/D_1 data register A/D_1 data register Auxiliary function register register Baud rate generator rate Baud rate generator rate HIGH Baud rate generator control Comparator control register Comparator control register clock divide-by-M control Data pointer bytes) Data pointer HIGH Data pointer Program Flash address HIGH 00000000 00000000 00000000 SBRGS BRGEN CMF1 CMF2 CLKLP EBRR ENT0 SRST 00[2] 00[1] 00000000 00000000 address ENBI1 ADI13 BNDI1 CLK2 ENADCI ADI12 BURST1 CLK1 TMM1 ADI11 SCC1 CLK0 EDGE1 ADI10 SCAN1 ADCI1 ENDAC1 ENADC1 ADCS11 BSA1 Reset value ADCS10 00000000 00000000 00000000 00000000 000x0000 11111111 00000000 00000000 00000000 00000000 00000000 000000x0 Binary P89LPC915/916/917 User manual 00000000 xxxxxx00 xx000000 xx000000 00000000 UM10107 xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx Table P89LPC916 Special function registers indicates SFRs that addressable. Name FMADRL FMCON Description Program Flash address Program Flash Control (Read) Program Flash Control (Write) FMDATA I2ADR I2CON* I2DAT I2SCLH I2SCLL I2STAT IEN0* IEN1* IP0* IP0H Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 9397 13316 Philips Semiconductors functions addresses addr. BUSY Reset value Binary 00000000 01110000 FMCMD. FMCMD. FMCMD. FMCMD. FMCMD. FMCMD. FMCMD. FMCMD. STA.4 PADH STA.3 EWDRT PWDRT PWDRT PSTH STA.2 PBOH STA.1 ES/ESR PS/PSR PSH/ PSRH STA.0 ESPI PT1H PSPI PSPIH EKBI PT0H PKBI PKBIH PATN _SEL EI2C PX0H PI2C PI2CH KBIF 00[1] 00[1] 00[1] 00x00000 00x00000 xxxxxx00 00000000 11111111 00[1] 00[1] 00[1] 00x00000 00000000 00000000 00000000 11111000 I2ADR.6 I2ADR.5 I2EN I2ADR.4 I2ADR.3 I2ADR.2 I2ADR.1 I2ADR.0 CRSEL x00000x0 00000000 00000000 Program Flash data slave address register address control register data register Serial clock generator/SCL duty cycle register HIGH Serial clock generator/SCL duty cycle register status register Interrupt enable Interrupt enable Interrupt priority Interrupt priority HIGH address address address address IP1* IP1H KBCON KBMASK KBPATN Interrupt priority Interrupt priority HIGH Keypad control register Keypad interrupt mask register Keypad pattern register P89LPC915/916/917 User manual x0000000 x0000000 UM10107 xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx Table P89LPC916 Special function registers indicates SFRs that addressable. Name Description functions addresses addr. address Port address Port address P0M1 P0M2 P1M1 P1M2 P2M1 P2M2 PCON PCONA PSW* PT0AD RSTSRC RTCCON Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 9397 13316 Philips Semiconductors Reset value CIN1A /KBI4 CIN1B /KBI3 INT0/ MISO CIN2A /KBI2 T0/SCL MOSI CIN2B /KBI1 FF[1] 00[1] D3[1] 00[1] FF[1] 00[1] 00[1] 60[1][6] 00[6] 00[6] Binary SMOD1 RTCPD RTCF SMOD0 RTCS1 CMPREF /KBI5 SPICLK Port Port output mode Port output mode Port output mode Port output mode Port output mode Port output mode Power control register Power control register Program status word Port digital input disable Reset source register Real-time clock control Real-time clock register HIGH Real-time clock register Serial port address register Serial port address enable Serial Port data buffer register Serial port control Serial port extended status register address (P0M1.5) (P0M1.4) (P0M1.3) (P0M1.2) (P0M1.1) (P0M2.5) (P0M2.4) (P0M2.3) (P0M2.2) (P0M2.1) 11111111 00000000 11x1xx11 00x0xx00 11111111 00000000 00000000 00000000 00000000 xx00000x (P1M1.3) (P1M1.2) (P1M1.1) (P1M1.0) (P1M2.3) (P1M2.2) (P1M2.1) (P1M2.0) PMOD1 R_SF ERTC PMOD0 R_EX RTCEN (P2M1.5) (P2M1.4) (P2M1.3) (P2M1.2) (P2M2.5) (P2M2.4) (P2M2.3) (P2M2.2) BOPD VCPD RTCS0 ADPD I2PD R_BK SPPD R_WD PT0AD.5 PT0AD.4 PT0AD.3 PT0AD.2 PT0AD.1 P89LPC915/916/917 User manual 011xxx00 00000000 00000000 00000000 00000000 xxxxxxxx 00000000 00000000 RTCH RTCL SADDR SADEN SBUF SCON* SSTAT UM10107 address SM0/FE DBMOD INTLO CIDIS DBISEL STINT xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx Table P89LPC916 Special function registers indicates SFRs that addressable. Name SPCTL SPSTAT SPDAT TAMOD TCON* Rev. July 2004 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual 9397 13316 Philips Semiconductors Description Stack pointer control register status register data register Timer auxiliary mode Timer control Timer HIGH Timer HIGH Timer Timer Timer mode Internal oscillator trim register Watchdog control register Watchdog load Watchdog feed Watchdog feed functions addresses addr. T1GATE RCCLK PRE2 T1C/T PRE1 T1M1 TRIM.5 PRE0 T1M0 TRIM.4 T0GATE TRIM.3 T0C/T TRIM.2 WDRUN T0M1 TRIM.1 WDTOF SSIG SPIF SPEN WCOL DORD MSTR CPOL CPHA SPR1 Reset value SPR0 T0M2 T0M0 TRIM.0 WDCLK 00000000 00000000 00000000 00000000 00000000 00000000 Binary 00000111 00000100 00xxxxxx 00000000 xxx0xxx0 address TMOD TRIM WDCON WFEED1 WFEED2 11111111 ports input only (high impedance) state after power-up. BRGR1 BRGR0 must only written BRGEN BRGCON logic written while BRGEN result unpredictable. P89LPC915/916/917 User manual RSTSRC register reflects cause P89LPC915/916/917 reset. Upon power-up reset, reset source flags cleared except BOF; power-on reset value xx110000. After reset, value 111001x1, i.e., PRE[2:0] logic WDRUN WDCLK WDTOF logic after Watchdog reset logic after power-on reset. Other resets will affect WDTOF. power-on reset, TRIM initialized with factory preprogrammed value. Other resets will cause initialization TRIM register. only reset source that affects these SFRs power-on reset. UM10107 xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx User manual Rev. July 2004 Koninklijke Philips Electronics N.V. 2004. rights reserved. 9397 13316 Philips Semiconductors Table P89LPC917 Special function registers indicates SFRs that addressable. Name Description functions addresses addr. address ACC* ADCON1 ADINS ADMODA ADMODB AD1BH AD1BL AD1DAT0 AD1DAT1 AD1DAT2 AD1DAT3 AUXR1 BRGR0[2] BRGR1[2] BRGCON CMP1 CMP2 DIVM DPTR FMADRH Accumulator control register input select mode register mode register A/D_1 boundary HIGH register A/D_1 boundary register A/D_1 data register A/D_1 data register A/D_1 data register A/D_1 data register Auxiliary function register register Baud rate generator rate Baud rate generator rate HIGH Baud rate generator control Comparator control register Comparator control register clock divide-by-M control Data pointer bytes) Data pointer HIGH Data pointer Program Flash address HIGH 00000000 00000000 00000000 SBRGS BRGEN CMF1 CMF2 CLKLP EBRR ENT1 ENT0 SRST 00[2] 00[1] 00[1] 00000000 00000000 address ENBI1 ADI13 BNDI1 CLK2 ENADCI ADI12 BURST1 CLK1 TMM1 ADI11 SCC1 CLK0 EDGE1 ADI10 SCAN1 ADCI1 ENDAC1 ENADC1 ADCS11 BSA1 Reset value ADCS10 00000000 00000000 00000000 00000000 000x0000 11111111 00000000 00000000 00000000 00000000 00000000 000000x0 Binary P89LPC915/916/917 User manual 00000000 xxxxxx00 xx000000 xx000000 00000000 UM10107 xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx Table P89LPC917 Special function registers indicates SFRs that addressable. Name FMADRL FMCON Description Program Flash address Program Flash Control (Read) Program Flash Control (Write) FMDATA I2ADR I2CON* I2DAT I2SCLH I2SCLL I2STAT IEN0* IEN1* IP0* IP0H Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 9397 13316 Philips Semiconductors functions addresses addr. BUSY Reset value Binary 00000000 01110000 FMCMD. FMCMD. FMCMD. FMCMD. FMCMD. FMCMD. FMCMD. FMCMD. STA.4 PADH STA.3 EWDRT PWDRT PWDRT PSTH STA.2 PBOH STA.1 ES/ESR PS/PSR PSH/ PSRH STA.0 PT1H PX1H EKBI PT0H PKBI PKBIH PATN _SEL EI2C PX0H PI2C PI2CH KBIF 00[1] 00[1] 00[1] 00x00000 00x00000 xxxxxx00 00000000 11111111 00[1] 00[1] 00[1] 00x00000 00000000 00000000 00000000 11111000 I2ADR.6 I2ADR.5 I2EN I2ADR.4 I2ADR.3 I2ADR.2 I2ADR.1 I2ADR.0 CRSEL x00000x0 00000000 00000000 Program Flash data slave address register address control register data register Serial clock generator/SCL duty cycle register HIGH Serial clock generator/SCL duty cycle register status register Interrupt enable Interrupt enable Interrupt priority Interrupt priority HIGH address address address address IP1* IP1H KBCON KBMASK KBPATN Interrupt priority Interrupt priority HIGH Keypad control register Keypad interrupt mask register Keypad pattern register P89LPC915/916/917 User manual x0000000 x0000000 UM10107 xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx Table P89LPC917 Special function registers indicates SFRs that addressable. Name Description functions addresses addr. address Port address P0M1 P0M2 P1M1 P1M2 PCON PCONA PSW* PT0AD RSTSRC RTCCON RTCH RTCL SADDR SADEN Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 9397 13316 Philips Semiconductors Reset value CIN1A /KBI4 INT1 CIN1B /KBI3 INT0/ CIN2A /KBI2 T0/SCL CIN2B /KBI1 CMP2 /KBI0 Binary T1/KBI7/ CLKOUT (P0M1.7) (P0M2.7) SMOD1 RTCPD RTCF SMOD0 RTCS1 CMPREF /KBI5 Port Port output mode Port output mode Port output mode Port output mode Power control register Power control register Program status word Port digital input disable Reset source register Real-time clock control Real-time clock register HIGH Real-time clock register Serial port address register Serial port address enable Serial Port data buffer register Serial port control Serial port extended status register Stack pointer Timer auxiliary mode Timer control address (P0M1.5) (P0M1.4) (P0M1.3) (P0M1.2) (P0M1.1) (P0M1.0) FF[1] (P0M2.5) (P0M2.4) (P0M2.3) (P0M2.2) (P0M2.1) (P0M2.0) BOPD VCPD RTCS0 (P1M2.4) (P1M2.3) (P1M2.2) (P1M2.1) (P1M2.0) ADPD I2PD R_BK R_WD PMOD1 R_SF ERTC PMOD0 R_EX RTCEN 60[1][6] 00[6] 00[6] 00[1] 00[1] 00[1] (P1M1.4) (P1M1.3) (P1M1.2) (P1M1.1) (P1M1.0) D3[1] 11111111 00000000 11x1xx11 00x0xx00 00000000 00000000 00000000 xx00000x PT0AD.5 PT0AD.4 PT0AD.3 PT0AD.2 PT0AD.1 011xxx00 00000000 00000000 00000000 00000000 xxxxxxxx 00000000 00000000 00000111 xxx0xxx0 00000000 P89LPC915/916/917 User manual SBUF SCON* SSTAT TAMOD TCON* address SM0/FE DBMOD INTLO CIDIS DBISEL STINT UM10107 T1M2 T0M2 address xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx Table P89LPC917 Special function registers indicates SFRs that addressable. Name TMOD TRIM WDCON WFEED1 WFEED2 Rev. July 2004 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual 9397 13316 Philips Semiconductors Description Timer HIGH Timer HIGH Timer Timer Timer mode Internal oscillator trim register Watchdog control register Watchdog load Watchdog feed Watchdog feed functions addresses addr. T1GATE RCCLK PRE2 T1C/T ENCLK PRE1 T1M1 TRIM.5 PRE0 T1M0 TRIM.4 T0GATE TRIM.3 T0C/T TRIM.2 WDRUN T0M1 TRIM.1 WDTOF Reset value T0M0 TRIM.0 WDCLK Binary 00000000 00000000 00000000 00000000 00000000 11111111 ports input only (high impedance) state after power-up. BRGR1 BRGR0 must only written BRGEN BRGCON logic written while BRGEN result unpredictable. RSTSRC register reflects cause P89LPC915/916/917 reset. Upon power-up reset, reset source flags cleared except BOF; power-on reset value xx110000. After reset, value 111001x1, i.e., PRE[2:0] logic WDRUN WDCLK WDTOF logic after Watchdog reset logic after power-on reset. Other resets will affect WDTOF. power-on reset, TRIM initialized with factory preprogrammed value. Other resets will cause initialization TRIM register. only reset source that affects these SFRs power-on reset. P89LPC915/916/917 User manual UM10107 Philips Semiconductors UM10107 P89LPC915/916/917 User manual Memory organization 07FFh 0700h 06FFh 0600h 05FFh 0500h 04FFh 0400h 03FFh 0300h 02FFh 0200h 01FFh 0100h 00FFh 000h Flash code memory space 002aaa913 SECTOR SECTOR SECTOR SECTOR SECTOR SECTOR SECTOR SECTOR SPECIAL FUNCTION REGISTERS (DIRECTLY ADDRESSABLE) IDATA (incl. DATA) BYTES ON-CHIP DATA MEMORY (STACK INDIR. ADDR.) DATA BYTES ON-CHIP DATA MEMORY (STACK, DIRECT INDIR. ADDR.) REG. BANKS R[7:0] data memory (DATA, IDATA) P89LPC915/916/917 memory map. various P89LPC915/916/917 memory spaces follows: DATA bytes internal data memory space (00h:7Fh) accessed direct indirect addressing, using instruction other than MOVX MOVC. part Stack this area. IDATA Indirect Data. bytes internal data memory space (00h:FFh) accessed indirect addressing using instructions other than MOVX MOVC. part Stack this area. This area includes DATA area bytes immediately above Special Function Registers. Selected registers peripheral control status registers, accessible only direct addressing. CODE Code memory space, accessed part program execution MOVC instruction. P89LPC915/916/917 on-chip Code memory. Table Type DATA IDATA Data arrangement Data Directly indirectly addressable memory Indirectly addressable memory Size (bytes) 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual Clocks Enhanced P89LPC915/916/917 uses enhanced 80C51 which runs times speed standard 80C51 devices. machine cycle consists clock cycles, most instructions execute machine cycles. Clock definitions P89LPC915/916/917 device several internal clocks defined below: OSCCLK Input DIVM clock divider. OSCCLK selected from three clock sources also optionally divided slower frequency (see Figure Section "CPU Clock (CCLK) modification: DIVM register"). Note: fosc defined OSCCLK frequency. CCLK clock; output DIVM clock divider. There CCLK cycles machine cycle, most instructions executed machine cycles (two four CCLK cycles). RCCLK internal 7.373 oscillator output. PCLK Clock various peripheral devices CCLKe2. P89LPC915/916/917 provides user-selectable oscillator options. This allows optimization range needs from high precision lowest possible cost. These options configured when FLASH programmed include on-chip watchdog oscillator, on-chip oscillator, external clock source. Clock output (P89LPC917) P89LPC917 supports user-selectable clock output function CLKOUT pin. This allows external devices synchronize P89LPC917. This output enabled ENCLK TRIM register. frequency this clock output that CCLK. clock output needed Idle mode, turned prior entering Idle, saving additional power. Note: reset, TRIM initialized with factory preprogrammed value. Therefore when setting clearing ENCLK bit, user should retain contents bits TRIM register. This done reading contents TRIM register (into example), modifying writing this result back into TRIM register. Alternatively, `ANL direct' `ORL direct' instructions used clear TRIM register. On-chip oscillator option P89LPC915/916/917 TRIM register that used tune frequency oscillator. During reset, TRIM value initialized factory pre-programmed value adjust oscillator frequency 7.373 MHz, (Note: initial value better than please refer P89LPC915/916/917 data sheet behavior over temperature). user applications write TRIM register adjust on-chip oscillator other frequencies. Increasing TRIM value will decrease oscillator frequency. 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual On-chip oscillator trim register (TRIM address 96h) allocation RCCLK ENCLK TRIM.5 TRIM.4 TRIM.3 TRIM.2 TRIM.1 TRIM.0 Table Symbol Reset Table Bits loaded with factory stored value during reset. On-chip oscillator trim register (TRIM address 96h) description Description Trim value. Determines frequency internal oscillator. During reset, these bits loaded with stored factory calibration value. When writing either this register, care should taken preserve current TRIM value reading this register, modifying bits required, writing result this register. Symbol TRIM.0 TRIM.1 TRIM.2 TRIM.3 TRIM.4 TRIM.5 ENCLK RCCLK when CCLKe2 output XTAL2 provided crystal oscillator being used. when selects Oscillator output clock (CCLK) Watchdog oscillator option watchdog separate oscillator which frequency kHz. This oscillator used save power when high clock frequency needed. External clock input option this configuration, processor clock derived from external source driving P0.5 pin. rate from MHz. RTCS1:0 XCLK RCCLK CLKIN RCCLK ADC1/DAC1 PCLK WATCHDOG OSCILLATOR (400 kHz) peripheral clock PCLK OSCCLK DIVM OSCILLATOR (7.3728 MHz) CCLK CLKOUT BAUD RATE GENERATOR UART TIMERS (P89LPC916) 002aaa831 Block diagram oscillator control. 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual Oscillator Clock (OSCCLK) wake-up delay P89LPC915/916/917 internal wake-up timer that delays clock until stabilizes. This delay OSCCLK cycles plus Clock (CCLK) modification: DIVM register OSCCLK frequency divided down, integer, times configuring dividing register, DIVM, provide CCLK. This produces CCLK frequency using following formula: CCLK frequency fosc (2N) Where: fosc frequency OSCCLK, value DIVM. Since ranges from 255, CCLK frequency range fosc fosc/510. (for CCLK fosc). This feature makes possible temporarily lower rate, reducing power consumption. dividing clock, retain ability respond events other than those that cause interrupts (i.e. events that allow exiting Idle mode) executing normal program lower rate. This often result lower power consumption than Idle mode. value DIVM changed program time without interrupting code execution. power select P89LPC915/916/917 designed (CCLK) maximum. However, CCLK slower, CLKLP (AUXR1.7) logic lower power consumption further. reset, CLKLP logic allowing highest performance. This then software CCLK running slower. converter P89LPC915/916/917 8-bit, 4-channel, multiplexed successive approximation analog-to-digital converter module (ADC1) module (DAC1). block diagram converter shown Figure consists 4-input multiplexer which feeds sample hold circuit providing input signal comparator inputs. control logic combination with successive approximation register (SAR) drives digital-to-analog converter which provides other input comparator. output comparator SAR. 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual COMP INPUT CONTROL LOGIC DAC1 CCLK 002aaa783 converter block diagram. Features 8-bit, 4-channel, multiplexed input, successive approximation converter. Four result registers. operating modes Fixed channel, single conversion mode Fixed channel, continuous conversion mode Auto scan, single conversion mode Auto scan, continuous conversion mode Dual channel, continuous conversion mode Single step mode Three conversion start modes Timer triggered start Start immediately Edge triggered 8-bit conversion time clock Interrupt polled operation Boundary limits interrupt output port with high output impedance Clock divider Power-down mode 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual operating modes 3.2.1 Fixed channel, single conversion mode single input channel selected conversion. single conversion will performed result placed result register which corresponds selected input channel (See Table 11). interrupt, enabled, will generated after conversion completes. input channel selected ADINS register. This mode selected setting SCAN1 ADMODA register. Table Input channels Result registers fixed channel single, auto scan single, autoscan continuous conversion modes. Input channel AD10 AD11 Result register AD1DAT2 AD1DAT3 Input channel AD12 AD13 Result register AD1DAT0 AD1DAT1 3.2.2 Fixed channel, continuous conversion mode single input channel selected continuous conversion. results conversions will sequentially placed four result registers Table interrupt, enabled, will generated after every four conversions. Additional conversion results will again cycle through four result registers, overwriting previous results. Continuous conversions continue until terminated user. This mode selected setting SCC1 ADMODA register. 3.2.3 Auto scan, single conversion mode combination four input channels selected conversion setting channel's respective ADINS register. channels converted from order ADINS). single conversion each selected input will performed result placed result register which corresponds selected input channel (See Table 11). interrupt, enabled, will generated after selected channels have been converted. only single channel selected this equivalent single channel, single conversion mode. This mode selected setting SCAN1 ADMODA register. Table Result registers conversion results fixed channel, continuous conversion mode. Contains Selected channel, first conversion result Selected channel, second conversion result Selected channel, third conversion result Selected channel, forth conversion result Result register AD1DAT0 AD1DAT1 AD1DAT2 AD1DAT3 3.2.4 Auto scan, continuous conversion mode combination four input channels selected conversion setting channel's respective ADINS register. channels converted from order ADINS). conversion each selected input will performed result placed result register which corresponds selected input channel (See Table 11). interrupt, enabled, will generated after selected channels have been converted. process will repeat starting with first selected channel. Additional 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual conversion results will again cycle through result registers selected channels, overwriting previous results. Continuous conversions continue until terminated user. This mode selected setting BURST1 ADMODA register. 3.2.5 Dual channel, continuous conversion mode combination four input channels selected conversion. result conversion first channel placed first result register. result conversion second channel placed second result register. first channel again converted result stored third result register. second channel again converted result placed fourth result register (See Table 13). interrupt generated, enabled, after every four conversions (two conversions channel). This mode selected setting SCC1 ADMODA register. Table Result registers conversion results dual channel, continuous conversion mode. Contains First channel, first conversion result Second channel, first conversion result First channel, second conversion result Second channel, second conversion result Result register AD1DAT0 AD1DAT1 AD1DAT2 AD1DAT3 3.2.6 Single step This special mode allows `single-stepping' auto scan conversion mode. combination four input channels selected conversion. After each channel converted, interrupt generated, enabled, waits next start condition. result each channel placed result register which corresponds selected input channel (See Table 11). used with start modes. This mode selected clearing BURST1, SCC1, SCAN1 bits ADMODA register. 3.2.7 Conversion mode selection bits uses three bits ADMODA select conversion mode. These mode bits summarized Table below. Combinations three bits, other than combinations shown, undefined. Table Conversion mode bits. Scan1 ADC1 conversion BURST0 SCC0 mode single step fixed channel, single auto scan, single fixed channel, continuous dual channel, continuous auto scan, continuous Scan0 ADC0 conversion mode single step fixed channel, single auto scan, single fixed channel, continuous dual channel, continuous auto scan, continuous BURST1 SCC1 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual Trigger modes 3.3.1 Timer triggered start conversion started overflow Timer Once conversion started, additional Timer triggers ignored until conversion completed. Timer triggered start mode available operating modes. This mode selected TMM1 ADCS11 ADCS10 bits (See Table 16). 3.3.2 Start immediately Programming this mode immediately starts conversion. This start mode available operating modes. This mode selected setting ADCS11 ADCS10 bits ADCON1 register (See Table 16). 3.3.3 Edge triggered conversion started rising falling edge P1.4. Once conversion started, additional edge triggers ignored until conversion completed. edge triggered start mode available operating modes. This mode selected setting ADCS11 ADCS10 bits ADCON1 register (See Table 16). 3.3.4 Boundary limits interrupt converter both high boundary limit register. After four MSBs have been converted, these four bits compared with four MSBs boundary high registers. four MSBs conversion outside limit interrupt will generated, enabled. conversion result within limits, boundary limits will again compared after bits have been converted. interrupt will generated, enabled, result outside boundary limits. boundary limit disabled clearing boundary limit interrupt enable. output port with high impedance AD0DAT3 register used hold value DAC. After value been written AD0DAT3 output will appear DAC0 pin. output enabled ENDAC0 ADMODB register (See Table 20). Clock divider converter requires that internal clock source range maintain accuracy. programmable clock divider that divides clock from provided this purpose (See Table 20). pins used with converter functions analog input pins used with converter have digital input output function. order give best analog performance, pins that being used with should have their digital outputs inputs disabled have tolerance disconnected. Digital outputs disabled putting port pins into Input-only mode described Port Configurations section (see Table 28). 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual Digital inputs will disconnected automatically from these pins when been selected setting corresponding ADINS register been enabled. Pins selected ADINS will tolerant provided that enabled device power-down, otherwise will remain tolerant. Power-down idle mode idle mode converter, enabled, will continue function cause device exit idle mode when conversion completed interrupt enabled. Power-down mode Total power-down mode, does function. enabled, will consume power. Power reduced disabling A/D. Table Symbol Reset Table Control register (ADCON1 address 97h) allocation ENBI1 ENADCI TMM1 EDGE1 ADCI1 ADCS10 ENADC1 ADCS11 Control register (ADCON1 address 97h) description Symbol ADCS10 ADCS11 Description start mode bits [11:10]: Timer Trigger mode when TMM1 Conversions starts overflow Timer Stop mode when TMM1 start occurs. Immediate Start mode. Conversions starts immediately. Edge Trigger mode. Conversion starts when edge condition defined EDGE1 occurs. ENADC1 ADCI1 EDGE1 Enable channel When enables ADC1. Must also operation this channel. Conversion complete Interrupt when conversion multiple conversions completed. Cleared software. When Edge conversion start triggered falling edge P1.4. When Edge conversion start triggered rising edge P1.4. Timer Trigger mode Selects either stop mode (TMM1 timer trigger mode (TMM1 when ADCS11 ADCS10 bits Enable Conversion complete Interrupt When set, will cause interrupt ADCI1 flag interrupt enabled. Enable boundary interrupt When set, will cause interrupt boundary interrupt flag, BNDI1, interrupt enabled. TMM1 ENADCI1 ENBI1 Table Symbol Reset Mode Register (ADMODA address C0h) allocation BNBI1 SCAN1 BURST1 SCC1 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual Mode Register (ADMODA address C0h) description Symbol SCAN1 SCC1 BURST1 BNBI1 Description reserved when selects single conversion mode (auto scan fixed channel) ADC1 when selects fixed channel, continuous conversion mode ADC1 when selects auto scan, continuous conversion mode ADC1 ADC1 boundary interrupt flag. When set, indicates that converted result from ADC1 outside range defined ADC1 boundary registers Table Table Symbol Reset Table Mode Register (ADMODB address A1h) allocation CLK2 CLK1 CLK0 BSA1 ENDAC1 Mode Register (ADMODB address A1h) description Symbol BSA1 Description reserved ADC1 Boundary Select All. When BNDI1 will ADC1 input exceeds boundary limits. When BNDI1 will only AD10 input exceeded boundary limits. reserved When selects mode ADC1; when selects mode. reserved Clock divider produce clock. Divides CCLK value indicated below. resulting clock should less. minimum required maintain accuracy. start mode bits: CLK2:0 divisor ENDAC1 CLK0 CLK1 CLK2 Table Symbol Reset 9397 13316 Input Select register (ADINS address A3h) allocation AIN13 AIN12 AIN11 AIN10 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual Input Select register (ADINS address A3h) description Symbol AIN10 AIN11 AIN12 AIN13 Description reserved when set, enables AD10 sampling conversion when set, enables AD11 sampling conversion when set, enables AD12 sampling conversion when set, enables AD13 sampling conversion Table Interrupts P89LPC915/916/917 uses four priority level interrupt structure. This allows great flexibility controlling handling P89LPC915/916/917's many interrupt sources. Each interrupt source individually enabled disabled setting clearing interrupt enable registers IEN0 IEN1. IEN0 register also contains global enable bit, which enables interrupts. Each interrupt source individually programmed four priority levels setting clearing bits interrupt priority registers IP0, IP0H, IP1, IP1H. interrupt service routine progress interrupted higher priority interrupt, another interrupt same lower priority. highest priority interrupt service cannot interrupted other interrupt source. requests different priority levels received simultaneously, request higher priority level serviced. requests same priority level pending start instruction cycle, internal polling sequence determines which request serviced. This called arbitration ranking. Note that arbitration ranking only used pending requests same priority level. Table summarizes interrupt sources, flag bits, vector addresses, enable bits, priority bits, arbitration ranking, whether each interrupt wake from Power-down mode. Interrupt priority structure Table IPxH Interrupt priority level Interrupt priority level Level (lowest priority) Level Level Level Priority bits There four SFRs associated with four interrupt levels: IP0, IP0H, IP1, IP1H. Every interrupt bits IPxH 0,1) therefore assigned four levels, shown Table P89LPC915/916/917 external interrupt inputs addition Keypad Interrupt function. interrupt inputs identical those present standard 80C51 microcontrollers. 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual These external interrupts programmed level-triggered edge-triggered clearing setting Register TCON. external interrupt triggered level detected INTn pin. external interrupt edge triggered. this mode consecutive samples INTn show high level cycle level next cycle, interrupt request flag TCON set, causing interrupt request. Since external interrupt pins sampled once each machine cycle, input high level should held least machine cycle ensure proper sampling. external interrupt edge-triggered, external source hold request high least machine cycle, then hold least machine cycle. This ensure that transition detected that interrupt request flag set. automatically cleared when service routine called. external interrupt level-triggered, external source must hold request active until requested interrupt generated. external interrupt still asserted when interrupt service routine completed, another interrupt will generated. necessary clear interrupt flag when interrupt level sensitive, simply tracks input level. external interrupt enabled when P89LPC915/916/917 into Power-down Idle mode, interrupt occurrence will cause processor wake resume operation. Refer Section "Power reduction modes" details. External Interrupt glitch suppression Most P89LPC915/916/917 pins have glitch suppression circuits reject short glitches (please refer P89LPC915/916/917 data sheet, Dynamic characteristics glitch filter specifications). However, pins SDA/INT0/P1.3 SCL/T0/P1.2 have glitch suppression circuits. Therefore, INT1 glitch suppression while INT0 does not. Table Summary interrupts P89LPC915, P89LPC917 Interrupt flag bit(s) WDOVF/RTCF KBIF CMF1/CMF2 ADCI1,BNDI1 002Bh 0053h 0033h 003Bh 0043h 006Bh 0073h (IEN0.5) EWDRT (IEN0.6) EI2C (IEN1.0) EKBI (IEN1.1) (IEN1.2) (IEN1.6) (IEN1.7) IP0H.5,IP0.5 IP0H.6,IP0.6 IP0H.0,IP0.0 IP0H.0,IP0.0 IP0H.0,IP0.0 IP0H.0,IP0.0 IP1H.7,IP1.7 (lowest) Vector address 0003h 000Bh 0013h 001Bh 0023h Interrupt enable bit(s) (IEN0.0) (IEN0.1) (IEN0.2) (IEN0.3) ES/ESR (IEN0.4) Interrupt priority IP0H.0,IP0.0 IP0H.1,IP0.1 IP0H.2,IP0.2 IP0H.3,IP0.3 IP0H.4,IP0.4 Arbitration ranking (highest) Powerdown wake-up Description External interrupt Timer interrupt External interrupt Timer interrupt Serial port Serial port Brownout detect Watchdog timer/Real-time clock interrupt interrupt Comparators interrupts Serial port 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual Table Summary interrupts P89LPC916 Interrupt flag bit(s) WDOVF/RTCF KBIF CMF1/CMF2 SPIF ADCI1,BNDI1 002Bh 0053h 0033h 003Bh 0043h 004Bh 006Bh 0073h (IEN0.5) EWDRT (IEN0.6) EI2C (IEN1.0) EKBI (IEN1.1) (IEN1.2) (IEN1.3) (IEN1.6) (IEN1.7) IP0H.5,IP0.5 IP0H.6,IP0.6 IP0H.0,IP0.0 IP0H.0,IP0.0 IP0H.0,IP0.0 IP1H.3, IP1.3 IP0H.0,IP0.0 IP1H.7,IP1.7 (lowest) Vector address 0003h 000Bh 001Bh 0023h Interrupt enable bit(s) (IEN0.0) (IEN0.1) (IEN0.3) ES/ESR (IEN0.4) Interrupt priority IP0H.0,IP0.0 IP0H.1,IP0.1 IP0H.3,IP0.3 IP0H.4,IP0.4 Arbitration ranking (highest) Powerdown wake-up Description External interrupt Timer interrupt Timer interrupt Serial port Serial port Brownout detect Watchdog timer/Real-time clock interrupt interrupt Comparators interrupts Serial port 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual (P89LPC915/917) BOPD RTCF ERTC (RTCCON.1) WDOVF KBIF EKBI EWDRT CMF2 CMF1 (IE0.7) RI/RI ES/ESR EI2C (P89LPC916) SPIF ESPI INTERRUPT WAKE-UP POWER-DOWN) ENADCI1 ADCI1 ENBI1 BNDI1 002aaa833 Interrupt sources, interrupt enables, power-down wake sources. 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual ports P89LPC915 ports: Port Port Ports 6-bit ports. P89LPC916 three ports: Port Port Port Ports 5-bit port, Port 5-bit port Port 4-bit port. P89LPC917 three ports: Port Port Port Ports 7-bit port, Port 6-bit port Port 1-bit port. exact number pins available depends upon clock reset options chosen (see Table Table 27). Table Number pins available P89LPC915 Reset option Number pins Clock source On-chip oscillator watchdog oscillator External clock input external reset (except during power External supported External supported external reset (except during power Table Number pins available P89LPC916/917 Reset option Number pins Clock source On-chip oscillator watchdog oscillator External clock input external reset (except during power External supported External supported external reset (except during power Port configurations three port pins P89LPC915/916/917 configured software four types pin-by-pin basis, shown Table These are: quasi-bidirectional (standard 80C51 port outputs), push-pull, open drain, input-only. configuration registers each port select output type each port pin. P1.5 (RST) only input cannot configured. P1.2 (SCL/T0) P1.3 (SDA/INT0) only configured either input-only open drain. Table PxM1.y Port output configuration settings PxM2.y Port output mode Quasi-bidirectional Push-pull Input only (high impedance) Open drain 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual Quasi-bidirectional output configuration Quasi-bidirectional outputs used both input output without need reconfigure port. This possible because when port outputs logic high, weakly driven, allowing external device pull low. When driven low, driven strongly able sink large current. There three pull-up transistors quasi-bidirectional output that serve different purposes. these pull-ups, called `very weak' pull-up, turned whenever port latch contains logic This very weak pull-up sources very small current that will pull high left floating. second pull-up, called `weak' pull-up, turned when port latch contains logic itself also logic level. This pull-up provides primary source current quasi-bidirectional that outputting this pulled external device, weak pull-up turns off, only very weak pull-up remains order pull under these conditions, external device sink enough current overpower weak pull-up pull port below input threshold voltage. third pull-up referred `strong' pull-up. This pull-up used speed low-to-high transitions quasi-bidirectional port when port latch changes from logic logic When this occurs, strong pull-up turns clocks quickly pulling port high. quasi-bidirectional port configuration shown Figure Although P89LPC915/916/917 device most pins V-tolerant. applied configured quasi-bidirectional mode, there will current flowing from causing extra power consumption. Therefore, applying pins configured quasi-bidirectional mode discouraged. quasi-bidirectional port Schmitt-triggered input that also glitch suppression circuit. (Please refer P89LPC915/916/917 data sheet, Dynamic characteristics glitch filter specifications). 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual CLOCK DELAY strong very weak weak port port latch data input data glitch rejection 002aaa914 Quasi-bidirectional output. Open drain output configuration open drain output configuration turns pull-ups only drives pull-down transistor port when port latch contains logic used logic output, port configured this manner must have external pull-up, typically resistor tied VDD. pull-down this mode same quasi-bidirectional mode. open drain port configuration shown Figure open drain port Schmitt-triggered input that also glitch suppression circuit. Please refer P89LPC915/916/917 data sheet, Dynamic characteristics glitch filter specifications) port port latch data input data glitch rejection 002aaa915 Open drain output. Input-only configuration input port configuration shown Figure Schmitt-triggered input that also glitch suppression circuit. 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual (Please refer P89LPC915/916/917 data sheet, Dynamic characteristics glitch filter specifications). input data glitch rejection port 002aaa916 Input only. Push-pull output configuration push-pull output configuration same pull-down structure both open drain quasi-bidirectional output modes, provides continuous strong pull-up when port latch contains logic push-pull mode used when more source current needed from port output. push-pull port configuration shown Figure push-pull port Schmitt-triggered input that also glitch suppression circuit. (Please refer P89LPC915/916/917 data sheet, Dynamic characteristics glitch filter specifications). strong port latch data port input data glitch rejection 002aaa917 Push-pull output. Port analog functions P89LPC915/916/917 incorporates Analog Comparators. order give best analog performance minimize power consumption, pins that being used analog functions must have both digital outputs digital inputs disabled. Digital outputs disabled putting port pins into Input-only mode described Port Configurations section (see Figure 16). 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual Digital inputs Port disabled through PT0AD register. Bits through this register correspond pins P0.1 through P0.5 Port respectively. Setting corresponding PT0AD disables that pin's digital input. Port bits that have their digital inputs disabled will read instruction that accesses port. reset, PT0AD bits through default enable digital functions. pins used with analog functions After power-up, pins Input-only mode. Please note that this different from LPC76x series devices. After power-up, pins except P1.5, configured software. P1.5 input only. Pins P1.2 P1.3 configurable either input-only open drain. Every output P89LPC915/916/917 been designed sink typical drive current. However, there maximum total output current ports which must exceeded. Please refer P89LPC915/916/917 data sheet detailed specifications. ports pins that function output have slew rate controlled outputs limit noise generated quickly switching output signals. slew rate factory-set approximately rise fall times. Table Port P0.0 P0.1 P0.2 P0.3 P0.4 P0.5 P0.7 P1.0 P1.1 P1.2 P1.3 P1.4 P1.5 P2.2 P2.3 P2.4 P2.5 Port output configuration Configuration bits PxM1.y P0M1.0 P0M1.1 P0M1.2 P0M1.3 P0M1.4 P0M1.5 P0M1.7 P1M1.0 P1M1.1 P1M1.2 P1M1.3 P1M1.4 P1M1.5 P2M1.2 P2M1.3 P2M1.4 P2M1.5 PxM2.y P0M2.0 P0M2.1 P0M2.2 P0M2.3 P0M2.4 P0M2.5 P0M2.7 P1M2.0 P1M2.1 P1M2.2 P1M2.3 P1M2.4 P1M2.5 P2M2.2 P2M2.3 P2M2.4 P2M2.5 Alternate usage KBIO, CMP2 KBI1, CIN2B, AD10 Refer Section "Port KBI2, CIN2A, AD11 analog functions" usage analog inputs. KBI3, CIN1B, AD12 KBI4, CIN1A, AD13, DAC1 KBI5, CMPREF KBI7, INTO, INT1 MOSI MISO SPICLK input-only open-drain input-only open-drain Notes 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual Power monitoring functions P89LPC915/916/917 incorporates power monitoring functions designed prevent incorrect operation during initial power-on power loss reduction during operation. This accomplished with hardware functions: Power-on Detect Brownout Detect. Brownout detection Brownout Detect function determines power supply voltage drops below certain level. default operation Brownout Detection cause processor reset. However, alternatively configured generate interrupt setting (PCON.4) (IEN0.5) bit. Enabling disabling Brownout Detection done BOPD (PCON.5) bit, field PMOD1/0 (PCON[1:0]) user configuration (UCFG1.5). unprogrammed state, brownout disabled regardless PMOD1/0 BOPD. programmed state, PMOD1/0 BOPD will used determine whether Brownout Detect will disabled enabled. PMOD1/0 used select power reduction mode. PMOD1/0 `11', circuitry Brownout Detection disabled lowest power consumption. BOPD defaults logic indicating brownout detection enabled power-on programmed. Brownout Detection enabled, operating voltage range brownout condition occurs when falls below Brownout trip voltage, (see P89LPC915/916/917 data sheet, Static characteristics), negated when rises above VBO. Brownout Detection disabled, operating voltage range P89LPC915/916/917 device operate with power supply that below should left unprogrammed state that device operate otherwise continuous brownout reset prevent device from operating. Brownout Detect enabled (BOE programmed, PMOD1/0 `11', BOPD (RSTSRC.5) will when brownout detected, regardless whether reset interrupt enabled, will stay until cleared software writing logic bit. Note that unprogrammed, meaningless. programmed, initial power-on occurs, will addition power-on flag (POF RSTSRC.4). correct activation Brownout Detect, certain rise fall times must observed. Please P89LPC915/916/917 data sheet specifications 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual Table (UCFG1.5) (erased) Brownout options PMOD1/0 (PCON[1:0]) (total power-down) BOPD (PCON.5) (PCON.4) (IEN0.5) (IEN0.7) Description Brownout disabled. operating range Brownout disabled. operating range However, BOPD default logic upon power-up. Brownout reset enabled. operating range Upon brownout reset, (RSTSRC.5) will indicate reset source. cleared writing logic bit. Brownout interrupt enabled. operating range Upon brownout interrupt, (RSTSRC.5) will set. cleared writing logic bit. Both brownout reset interrupt disabled. operating range However, (RSTSRC.5) will when falls Brownout Detection trip point. cleared writing logic bit. (programmed) (any mode 1(brownout other than total detect power-down powered down) (brownout (brownout detect active) detect generates reset) (brownout (enable detect brownout generates interrupt) interrupt) (global interrupt enable) Power-on detection Power-On Detect function similar Brownout Detect, designed work power initially comes before power supply voltage reaches level where Brownout Detect function. flag (RSTSRC.4) indicate initial power-on condition. flag will remain until cleared software writing logic bit. Note that (UCFG1.5) programmed, (RSTSRC.5) will when set. unprogrammed, meaningless. Power reduction modes P89LPC915/916/917 supports three different power reduction modes determined bits PCON[1:0] (see Table 31). 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual Table Power reduction modes Description Normal mode (default) power reduction. Idle mode. Idle mode leaves peripherals running order allow them activate processor when interrupt generated. enabled interrupt source reset terminate Idle mode. Power-down mode: P89LPC915/916/917 exits Power-down mode reset, certain interrupts external pins INT0, INT1, brownout Interrupt, keyboard, Real-time Clock/System Timer), watchdog, comparator trips. Waking reset only enabled corresponding reset enabled, waking interrupt only enabled corresponding interrupt enabled (IEN0.7) set. Power-down mode internal oscillator disabled unless both oscillator been selected system clock enabled. Power-down mode, power supply voltage reduced keep-alive voltage VRAM. This retains contents point where Power-down mode entered. contents guaranteed after been lowered VRAM, therefore recommended wake processor Reset this situation. must raised within operating range before Power-down mode exited. When processor wakes from Power-down mode, will start oscillator immediately begin execution when oscillator stable. Oscillator stability determined counting clocks after start-up internal external clock input configurations. Some chip functions continue operate draw power during Power-down mode, increasing total power used during power-down. These include: PMOD1 PMOD0 (PCON.1) (PCON.0) Brownout Detect Watchdog timer WDCLK (WDCON.0) logic Comparators (Note: Comparators powered down separately with PCONA.5 logic comparators disabled); Real-time Clock/System Timer (unless RTCPD, i.e., PCONA.7 logic Total Power-down mode: This same Power-down mode except that Brownout Detection circuitry voltage comparators also disabled conserve additional power. Note that brownout reset interrupt will occur. Voltage comparator interrupts Brownout interrupt cannot used wake-up source. internal oscillator disabled unless both oscillator been selected system clock enabled. following wake-up options supported: Watchdog timer WDCLK (WDCON.0) logic Could generate Interrupt Reset, either wake device External interrupts INTO/INT1 Keyboard Interrupt Real-time Clock/System Timer (unless RTCPD, i.e., PCONA.7 logic Note: Using internal RC-oscillator clock during power-down result relatively high power consumption. Lower power consumption achieved using external frequency clock when Real-time Clock running during power-down. Table Symbol Reset Power Control register (PCON address 87h) allocation SMOD1 SMOD0 BOPD PMOD1 PMOD0 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual Power Control register (PCON address 87h) description Symbol PMOD0 PMOD1 BOPD General Purpose Flag read written user software, effect operation General Purpose Flag read written user software, effect operation Brownout Detect Interrupt Enable. When logic Brownout Detection will generate interrupt. When logic Brownout Detection will cause reset Brownout Detect Power-down. When logic Brownout Detect powered down therefore disabled. When logic Brownout Detect enabled. (Note: BOPD must logic before programming erasing commands issued. Otherwise these commands will aborted.) Framing Error Location: Description Power Reduction mode (see Section Table SMOD0 SMOD1 When logic SCON accessed UART. When logic SCON accessed framing error status (FE) UART Double Baud Rate serial port (UART) when Timer used baud rate source. When logic Timer overflow rate supplied UART. When logic Timer overflow rate divided before being supplied UART. (See Section Table Symbol Reset Table Power Control register (PCONA address B5h) allocation RTCPD VCPD I2PD Power Control register (PCONA address B5h) description Symbol Description reserved Serial Port (UART) Power-down: When logic internal clock UART disabled. Note that either Power-down mode Total Power-down mode, UART clock will disabled regardless this bit. reserved Power-down: When logic internal clock I2C-bus disabled. Note that either Power-down mode Total Power-down mode, clock will disabled regardless this bit. reserved Analog Voltage Comparators Power-down: When logic voltage comparators powered down. User must disable voltage comparators prior setting this bit. reserved Real-time Clock Power-down: When logic internal clock Real-time Clock disabled. I2PD VCPD RTCPD 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual Reset P1.5/RST function either active reset input digital input, P1.5. (Reset Enable) UCFG1, when logic enables external reset input function P1.5. When cleared, P1.5 used input pin. Note: During power-on sequence, selection overridden this will always functions reset input. external circuit connected this should hold this during Power-on sequence this will keep device reset. After power-on this input will function either external reset input digital input defined bit. Only power-on reset will temporarily override selection defined bit. Other sources reset will override bit. Note: During power cycle, must fall below VPOR (see P89LPC915/916/917 data sheet, Static characteristics) before power reapplied, order ensure power-on reset. Reset triggered from following sources (see Figure 18): External reset (during power-on user configured UCFG1); Power-on Detect; Brownout Detect; Watchdog timer; Software reset; UART break detect reset. every reset source, there flag Reset Register, RSTSRC. user read this register determine most recent reset source. These flag bits cleared software writing logic corresponding bit. More than flag set: During power-on reset, both other flag bits cleared. other reset, previously flag bits that have been cleared will remain set. (UCFG1.6) WDTE (UCFG1.7) Watchdog timer reset Software reset SRST (AUXR1.3) chip reset Power-on detect UART break detect EBRR (AUXR1.6) Brownout detect reset BOPD (PCON.5) 002aaa918 Block diagram reset. 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual Reset Sources register (RSTSRC address DFh) allocation R_BK R_WD R_SF R_EX Table Symbol Reset[1] value shown power-on reset. Other reset sources will their corresponding bits. Table R_EX Reset Sources register (RSTSRC address DFh) description Description external reset Flag. When this logic indicates external reset. Cleared software writing logic Power-on reset. still asserted after Power-on reset over, R_EX will set. software reset Flag. Cleared software writing logic Power-on reset Watchdog timer reset flag. Cleared software writing logic Power-on reset. (Note: UCFG1.7 must break detect reset. break detect occurs EBRR (AUXR1.6) logic system reset will occur. This indicate that system reset caused break detect. Cleared software writing logic Power-on reset. Power-on Detect Flag. When Power-on Detect activated, flag indicate initial power-up condition. flag will remain until cleared software writing logic bit. (Note: Power-on reset, both this will while other flag bits cleared.) Brownout Detect Flag. When Brownout Detect activated, this set. will remain until cleared software writing logic bit. (Note: Power-on reset, both this will while other flag bits cleared.) reserved Symbol R_SF R_WD R_BK Reset vector Following reset, P89LPC915/916/917 will fetch instructions from either address 0000h Boot address. Boot address formed using Boot Vector high byte address byte address =00h. Boot address will used UART break reset occurs non-volatile Boot Status (BOOTSTAT.0) Timers P89LPC915/916/917 general-purpose counter/timers which upward compatible with 80C51 Timer Timer Both timers P89LPC917 configured operate either timers event counters (see Table 39). Timer P89LPC915 P89LPC916 configured operate either timer event counter (see Table 39). Timer P89LPC915 P89LPC916 devices only function timer. option automatically toggle upon timer overflow been added. `Timer' function, timer incremented every PCLK. 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual `Counter' function, register incremented response 1-to-0 transition corresponding external input pin, (P89LPC917). external input sampled once during every machine cycle. When high during cycle next cycle, count incremented. count value appears register during cycle following which transition detected. Since takes machine cycles clocks) recognize 1-to-0 transition, maximum count rate clock frequency. There restrictions duty cycle external input signal, ensure that given level sampled least once before changes, should held least full machine cycle. `Timer' `Counter' function selected control bits TnC/T Timers respectively) Special Function Register TMOD. Timer Timer have five operating modes (modes which selected bit-pairs (TnM1, TnM0) TMOD TnM2 TAMOD. Modes same both Timers/Counters. Mode different. operating modes described later this section. Table Symbol Reset Table T0M0 T0M1 T0C/T T0GATE Timer/Counter Mode register (TMOD address 89h) allocation T1GATE T1C/T T1M1 T1M0 T0GATE T0C/T T0M1 T0M0 Timer/Counter Mode register (TMOD address 89h) description Description Mode Select Timer These bits used with T0M2 TAMOD register determine Timer mode (see Table 41). Timer Counter selector Timer Cleared Timer operation (input from CCLK). Counter operation (input from input pin). Gating control Timer When set, Timer/Counter enabled only while INT0 high control set. When cleared, Timer enabled when control set. Mode Select Timer These bits used with T1M2 TAMOD register determine Timer mode (see Table 41). Timer Counter Selector Timer Cleared Timer operation (input from CCLK). Counter operation (input from input pin). Gating control Timer When set, Timer/Counter enabled only while INT1 high control set. When cleared, Timer enabled when control set. Symbol T1M0 T1M1 T1C/T T1GATE Table Symbol Reset Timer/Counter Auxiliary Mode register (TAMOD address 8Fh) allocation T1M2 T0M2 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual Timer/Counter Auxiliary Mode register (TAMOD address 8Fh) description Description Mode Select Timer These bits used with T0M2 TAMOD register determine Timer mode (see Table 41). reserved Mode Select Timer These bits used with T1M2 TAMOD register determine Timer mode (see Table 41). P89LPC917. following timer modes selected timer mode bits TnM[2:0]: 8048 Timer `TLn' serves 5-bit prescaler. (Mode 16-bit Timer/Counter `THn' `TLn' cascaded; there prescaler. (Mode 8-bit auto-reload Timer/Counter. holds value which loaded into when overflows. (Mode Timer dual 8-bit Timer/Counter this mode. 8-bit Timer/Counter controlled standard Timer control bits. 8-bit timer only, controlled Timer control bits (see text). Timer this mode stopped. (Mode Reserved. User must configure this mode. Reserved. User must configure this mode. mode (see Section 8.5). Reserved. User must configure this mode. Table T0M2 Symbol T1M2 reserved Mode Putting either Timer into Mode makes look like 8048 Timer, which 8-bit Counter with divide-by-32 prescaler. Figure shows Mode operation. this mode, Timer register configured 13-bit register. count rolls over from sets Timer interrupt flag TFn. count input enabled Timer when either TnGATE INTn (Setting TnGATE allows Timer controlled external input INTn, facilitate pulse width measurements). control Special Function Register TCON (Table 43). TnGATE TMOD register. 13-bit register consists bits lower bits TLn. upper bits indeterminate should ignored. Setting flag (TRn) does clear registers. Mode operation same Timer Timer Figure There different GATE bits, Timer (TMOD.7) Timer (TMOD.3). Mode Mode same Mode except that bits timer register (THn TLn) used. Figure 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual Mode Mode configures Timer register 8-bit Counter (TLn) with automatic reload, shown Figure Overflow from only sets TFn, also reloads with contents THn, which must preset software. reload leaves unchanged. Mode operation same Timer Timer Mode When Timer Mode stopped. effect same setting Timer Mode establishes separate 8-bit counters. logic Mode Timer shown Figure uses Timer control bits: T0C/T, T0GATE, TR0, INT0, TF0. locked into timer function (counting machine cycles) takes over from Timer Thus, controls `Timer interrupt. Mode provided applications that require extra 8-bit timer. With Timer Mode P89LPC915/916/917 device look like three Timer/Counters. Note: When Timer Mode Timer turned switching into Mode still used serial port baud rate generator, application requiring interrupt. Mode this mode, corresponding timer changed with full period timer clocks (see Figure 23). structure similar Mode except that: Timers respectively) cleared hardware; period THn, should between 254, and; high period always 256THn. Loading with will force high, loading with will force low. Note that interrupt still enabled high transition TFn, that still cleared software like other modes. This mode available Timer P89LPC915/916/917 devices Timer P89LPC917 device. Table Symbol Reset Table Timer/Counter Control register (TCON) address 88h) allocation Timer/Counter Control register (TCON address 88h) description Description Interrupt Type control bit. Set/cleared software specify falling edge/low level triggered external interrupts. Interrupt Edge flag. hardware when external interrupt edge detected. Cleared hardware when interrupt processed, software. Interrupt Type control bit. Set/cleared software specify falling edge/low level triggered external interrupts (P89LPC915/917) Koninklijke Philips Electronics N.V. 2004. rights reserved. Symbol 9397 13316 User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual Timer/Counter Control register (TCON address 88h) description Description Interrupt Edge flag. hardware when external interrupt edge detected. Cleared hardware when interrupt processed, software (P89LPC915/917) Timer control bit. Set/cleared software turn Timer/Counter on/off. Timer overflow flag. hardware Timer/Counter overflow. Cleared hardware when processor vectors interrupt routine, software. (except Mode where cleared hardware) Timer control bit. Set/cleared software turn Timer/Counter on/off Timer overflow flag. hardware Timer/Counter overflow. Cleared hardware when interrupt processed, software (except Mode above, when cleared hardware). Table Symbol PCLK control (5-bits) (8-bits) overflow interrupt toggle Gate INTn ENTn 002aaa919 Timer/counter Mode (13-bit counter). PCLK control (8-bits) (8-bits) overflow interrupt toggle Gate INTn ENTn 002aaa920 Timer/counter Mode (16-bit counter). 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual PCLK control (8-bits) reload overflow interrupt toggle Gate INTn (8-bits) ENTn 002aaa921 Timer/counter Mode (8-bit auto-reload). PCLK control (8-bits) overflow toggle interrupt Gate INT0 ENT0 (AUXR1.4) (P1.2 open drain) Osc/2 control (8-bits) overflow interrupt toggle (P0.7) ENT1 (AUXR1.5) 002aaa922 Timer/counter Mode (two 8-bit counters). PCLK control (8-bits) overflow interrupt reload falling transition (256-THn) rising transition toggle Gate INTn (8-bits) ENTn 002aaa923 Timer/counter Mode (PWM auto-reload). Timer overflow toggle output Timers configured automatically toggle port output whenever timer overflow occurs. same device pins that used count inputs outputs also used timer toggle outputs. This function enabled 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual control bits ENT0 ENT1 AUXR1 register, apply Timer Timer respectively. port outputs will logic prior first timer overflow when this mode turned order this mode function, must cleared selecting PCLK clock source timer. Timer toggle output available only P89LPC917 device. Timer toggle output available P89LPC915, P89LPC916, P89LPC917 devices. Real-time clock system timer P89LPC915/916/917 simple Real-time Clock/System Timer that allows user continue running accurate timer while rest device powered down. Real-time Clock interrupt wake-up source (see Figure 24). Real-time Clock 23-bit down counter. clock source this counter either clock (CCLK) external clock input. There three SFRs used RTC: RTCCON Real-time Clock control. RTCH Real-time Clock counter reload high (bits 15). RTCL Real-time Clock counter reload (bits Real-time clock system timer enabled setting RTCEN (RTCCON.0) bit. Real-time Clock 23-bit down counter (initialized when RTCEN that comprised 7-bit prescaler 16-bit loadable down counter. When RTCEN written with logic counter first loaded with (RTCH,RTCL,`1111111') will count down. When reaches 0's, counter will reloaded again with (RTCH,RTCL,'1111111') flag RTCF (RTCCON.7) will set. Power-on reset RTCH RTCL Reset XTAL2 XTAL1 Reload underflow FREQ. MED. FREQ. HIGH FREQ. CCLK internal oscillators RTCS1 RTCS2 select 002aaa924 23-bit down counter 7-bit prescaler ÷128 Wake-up from power-down RTCF Interrupt enabled (shared with WDT) underflow flag ERTC RTCEN enable Real-time clock/system timer block diagram. 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual Real-time clock source RTCS1/RTCS0 (RTCCON[6:5]) used select either external clock input CCLK clock source RTC, either Internal oscillator internal oscillator used CCLK. CCLK derived from external clock input P0.5 then CCLK (external clock input/DIVM) external input clock source. Changing RTCS1/RTCS0 RTCS1/RTCS0 cannot changed currently enabled (RTCCON.0 Setting RTCEN updating RTCS1/RTCS0 done single write RTCCON. However, RTCEN this must first cleared before updating RTCS1/RTCS0. Real-time clock interrupt/wake-up ERTC (RTCCON.1), EWDRT (IEN1.0.6) (IEN0.7) logic RTCF used interrupt source. This interrupt vector shared with watchdog timer. also source wake device. Reset sources affecting Real-time clock Only power-on reset will reset Real-time Clock associated SFRs their default state. Table FOSC2:0 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. Real-time Clock/System Timer clock sources RCCLK RTCS1:0 clock source undefined clock source undefined External clock input Internal oscillator DIVM Internal oscillator DIVM External clock input Internal oscillator Internal oscillator External clock input Watchdog oscillator /DIVM Watchdog oscillator /DIVM External clock input Internal oscillator Internal oscillator undefined undefined User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual Real-time Clock/System Timer clock sources RCCLK RTCS1:0 Internal oscillator External clock input /DIVM External clock input Internal oscillator clock source External clock input clock source External clock input/DIVM Table FOSC2:0 Table Symbol Reset Table Real-time Clock Control register (RTCCON address D1h) allocation RTCF RTCS1 RTCS0 ERTC RTCEN Real-time Clock Control register (RTCCON address D1h) description Real-time Clock enable. Real-time Clock will enabled this logic Note that this will power-down Real-time Clock. RTCPD (PCONA.7) set, will power-down disable this block regardless RTCEN. Real-time Clock interrupt enable. Real-time Clock shares same interrupt watchdog timer. Note that user configuration WDTE (UCFG1.7) logic watchdog timer enabled generate interrupt. Users read RTCF (RTCCON.7) determine whether Real-time Clock caused interrupt. reserved Real-time Clock source select (see Table 44). Real-time Clock Flag. This logic when 23-bit Real-time Clock reaches count logic cleared software. Symbol Description RTCEN ERTC RTCS0 RTCS1 RTCF UART P89LPC915/916/917 enhanced UART that compatible with conventional 80C51 UART except that Timer overflow cannot used baud rate source. P89LPC915/916/917 does include independent Baud Rate Generator. baud rate selected from CCLK (divided constant), Timer overflow, independent Baud Rate Generator. addition baud rate generation, enhancements over standard 80C51 UART include Framing Error detection, break detect, automatic address recognition, selectable double buffering several interrupt options. UART operated four modes, described following sections. 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual 10.1 Mode Serial data enters exits through RxD. outputs shift clock. bits transmitted received, first. baud rate fixed 1e16 clock frequency. 10.2 Mode bits transmitted (through TxD) received (through RxD): start (logic data bits (LSB first), stop (logic When data received, stop stored Special Function Register SCON. baud rate variable determined Timer overflow rate Baud Rate Generator (see Section 10.6 "Baud Rate generator selection" page 10.3 Mode bits transmitted (through TxD) received (through RxD): start (logic data bits (LSB first), programmable data bit, stop (logic When data transmitted, data (TB8 SCON) assigned value example, parity PSW) could moved into TB8. When data received, data goes into Special Function Register SCON stop saved. baud rate programmable either 1e16 1e32 CCLK frequency, determined SMOD1 PCON. 10.4 Mode bits transmitted (through TxD) received (through RxD): start (logic data bits (LSB first), programmable data bit, stop (logic Mode same Mode respects except baud rate. baud rate Mode variable determined Timer overflow rate Baud Rate Generator (see Section 10.6 "Baud Rate generator selection" page four modes, transmission initiated instruction that uses SBUF destination register. Reception initiated Mode condition Reception initiated other modes incoming start 10.5 space UART SFRs following locations: Table Register PCON SCON SBUF SADDR SADEN SSTAT BRGR1 BRGR0 BRGCON 9397 13316 UART addresses Description Power Control Serial Port (UART) Control Serial Port (UART) Data Buffer Serial Port (UART) Address Serial Port (UART) Address Enable Serial Port (UART) Status Baud Rate Generator Rate High Byte Baud Rate Generator Rate Byte Baud Rate Generator Control location Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual 10.6 Baud Rate generator selection P89LPC915/916/917 enhanced UART independent Baud Rate Generator. baud rate determined value programmed into BRGR1 BRGR0 SFRs. UART either Timer baud rate generator output determined BRGCON[2:1] (see Figure 25). Note that Timer further divided SMOD1 (PCON.7) set. independent Baud Rate Generator uses CCLK. 10.7 Updating BRGR1 BRGR0 SFRs baud rate SFRs, BRGR1 BRGR0 must only loaded when Baud Rate Generator disabled (the BRGEN BRGCON register logic This avoids loading interim value baud rate generator. (CAUTION: either BRGR0 BRGR1 written when BRGEN result unpredictable.) Table SCON.7 (SM0) UART baud rate generation. SCON.6 (SM1) PCON.7 BRGCON.1 (SMOD1) (SBRGS) Table Symbol Reset Table Receive/transmit baud rate UART CCLKe CCLKe (256TH1)64 CCLKe (256TH1)32 CCLKe ((BRGR1, BRGR0)+16) CCLKe CCLKe CCLKe (256TH1)64 CCLKe (256TH1)32 CCLKe ((BRGR1, BRGR0)+16) Baud Rate Generator Control register (BRGCON address BDh) allocation SBRGS BRGEN Baud Rate Generator Control register (BRGCON address BDh) description Description Baud Rate Generator Enable. Enables baud rate generator. BRGR1 BRGR0 only written when BRGEN Select Baud Rate Generator source baud rates UART modes (see Table details) reserved Symbol BRGEN SBRGS Timer Overflow (PCLK-based) Baud Rate Generator (CCLK-based) SMOD1 SBRGS Baud Rate Modes SBRGS 002aaa419 SMOD1 Baud rate generation UART (Modes 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual 10.8 Framing error Framing error occurs when stop sensed logic Framing error reported status register (SSTAT). addition, SMOD0 (PCON.6) framing errors made available SCON.7. SMOD0 SCON.7 SM0. recommended that (SCON[7:6]) programmed when SMOD0 logic 10.9 Break detect break detect reported status register (SSTAT). break detected when consecutive bits sensed low. Since break condition also satisfies requirements framing error, break condition will also result reporting framing error. Once break condition been detected, UART will into idle state remain this idle state until stop been received. break detect used reset device force device into mode setting EBRR (AUXR1.6) Table Symbol Reset Table Serial Port Control register (SCON address 98h) allocation SM0/FE Serial Port Control register (SCON address 98h) description Description Receive interrupt flag. hardware time Mode approximately halfway through stop time Mode Mode Mode SMOD0, near middle data (bit SMOD0 near middle stop (see SCON.5 exceptions). Must cleared software. Transmit interrupt flag. hardware time Mode stop (see description INTLO SSTAT register) other modes. Must cleared software. data that received Modes Mode (SM2 must stop that received. Mode undefined. data that will transmitted Modes clear software desired. Enables serial reception. software enable reception. Clear software disable reception. Enables multiprocessor communication feature Modes Mode logic then will activated received data (RB8) Mode should Mode must With defines Serial port mode, Table this determined SMOD0 PCON register. SMOD0 this read written SM0, which with SM1, defines Serial port mode. SMOD0 this read written (Framing Error). receiver when invalid stop detected. Once set, this cannot cleared valid frames cleared software. (Note: UART mode bits should programmed when SMOD0 logic default mode reset.) Symbol SM0/FE 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual Serial Port modes UART mode Mode shift register Mode 8-bit UART Mode 9-bit UART Mode 9-bit UART UART baud rate CCLKe Table SM0,SM1 Table Symbol Reset Table (default mode reset) CCLKe16 Variable (see Table CCLKe Variable (see Table Serial Port Status register (SSTAT address BAh) allocation DBMOD INTLO CIDIS DBISEL STINT Serial Port Status register (SSTAT address BAh) description Description Status Interrupt Enable. When cause interrupt. interrupt used (vector address 0023h) shared with (CIDIS combined TI/RI (CIDIS When cleared cannot cause interrupt. (Note: often accompanied which will generate interrupt regardless state STINT). Note that cause break detect reset EBRR (AUXR1.6) logic Overrun Error flag character received receiver buffer while still full (before software read previous character from buffer), i.e., when byte received while SCON still set. Cleared software. Break Detect flag. break detected when consecutive bits sensed low. Cleared software. Framing error flag when receiver fails valid STOP frame. Cleared software. Double buffering transmit interrupt select. Used only double buffering enabled. This controls number interrupts that occur when double buffering enabled. When set, transmit interrupt generated after each character written SBUF, there also more transmit interrupt generated beginning (INTLO (INTLO STOP last character sent (i.e., more data buffer). This last interrupt used indicate that transmit operations over. When cleared only transmit interrupt generated character written SBUF. Must logic when double buffering disabled. Note that except first character written (when buffer empty), location transmit interrupt determined INTLO. When first character written, transmit interrupt generated immediately after SBUF written. Combined Interrupt Disable. When interrupts separate. When cleared UART uses combined Tx/Rx interrupt (like conventional 80C51 UART). This reset logic select combined interrupts. Transmit interrupt position. When cleared interrupt issued beginning stop bit. When interrupt issued stop bit. Must logic mode Note that case single buffering, interrupt occurs STOP bit, exist before next start bit. Symbol STINT DBISEL CIDIS INTLO DBMOD Double buffering mode. When enables double buffering. Must logic UART mode order compatible with existing 80C51 devices, this reset logic disable double buffering. 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual 10.10 More about UART Mode Mode write SBUF will initiate transmission. transmission, (SCON.1) set, which must cleared software. Double buffering must disabled this mode. Reception initiated clearing (SCON.0). Synchronous serial transfer occurs will again transfer. When cleared, reception next character will begin. Refer Figure write SBUF shift (data out) (shift clock) transmit WRITE SCON (clear receive shift (data (shift clock) 002aaa925 Serial Port Mode (double buffering must disabled). 10.11 More about UART Mode Reception initiated detecting 1-to-0 transition RxD. sampled rate times programmed baud rate. When transition detected, divide-by-16 counter immediately reset. Each time thus divided into counter states. 7th, 8th, counter states, detector samples value RxD. value accepted value that seen least samples. This done noise rejection. value accepted during first time receive circuits reset receiver goes back looking another 1-to-0 transition. This provides rejection false start bits. start proves valid, shifted into input shift register, reception rest frame will proceed. signal load SBUF RB8, will generated only following conditions time final shift pulse generated: either SM2=0 received stop either these conditions met, received frame lost. both conditions met, stop goes into RB8, data bits into SBUF, activated. 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual clock write SBUF shift INTLO INTLO start stop transmit clock shift reset start stop receive 002aaa926 Serial Port Mode (only single transmit buffering case shown). 10.12 More about UART Modes Reception same Mode signal load SBUF RB8, will generated only following conditions time final shift pulse generated. Either received data either these conditions met, received frame lost, set. both conditions met, received data goes into RB8, first data bits into SBUF. clock write SBUF shift INTLO clock shift SMOD0 SMOD0 reset start stop receive INTLO start stop transmit 002aaa927 Serial Port Mode (only single transmit buffering case shown). 10.13 Framing error Modes with modes behaves following table. 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual when SM2= Modes when Similar Figure with SMOD0 occurs during RB8, before when Similar Figure with SMOD0 occurs during STOP Occurs during STOP Occurs during STOP Will occur Occurs during STOP Table Mode PCON.6 (SMOD0) 10.14 Break detect break detected when consecutive bits sensed reported status register (SSTAT). Mode this consists start bit, data bits, stop times. Modes this consists start bit, data bits, stop bit. break detect cleared software reset. break detect used force device execute code using Boot vector. This occurs UART enabled EBRR (AUXR1.6) break occurs. 10.15 Double buffering UART transmit double buffer that allows buffering next character written SBUF while first character being transmitted. Double buffering allows transmission string characters with only stop between characters, provided next character written between start stop previous character. Double buffering disabled. disabled (DBMOD, i.e. SSTAT.7 UART compatible with conventional 80C51 UART. enabled, UART allows writing SnBUF while previous data being shifted out. 10.16 Double buffering different modes Double buffering only allowed Modes When operated Mode double buffering must disabled (DBMOD 10.17 Transmit interrupts with double buffering enabled (Modes Unlike conventional UART, when double buffering enabled, interrupt generated when double buffer ready receive data. following occurs during transmission (assuming eight data bits): double buffer empty initially. writes SBUF. SBUF data loaded shift register interrupt generated immediately. there more data, else continue. there more data, then: DBISEL logic more interrupts will occur. 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual DBISEL logic INTLO logic interrupt will occur beginning STOP data currently shifter (which also last data). DBISEL logic INTLO logic interrupt will occur STOP data currently shifter (which also last data). Note that DBISEL logic writing SBUF when STOP last data shifted out, there uncertainty whether interrupt generated already with UART knowing whether there more data following. there more data, writes SBUF again. Then: INTLO logic data will loaded interrupt will occur beginning STOP data currently shifter. INTLO logic data will loaded interrupt will occur STOP data currently shifter. write SBUF interrupt Single buffering (DBMOD/SSTAT.7 early interrupt (INTLO/SSTAT.6 shown write SBUF interrupt Double buffering (DBMOD/SSTAT.7 early interrupt (INTLO/SSTAT.6 shown, ending interrupt (DBISEL/SSTAT.4 write SBUF interrupt Double buffering (DBMOD/SSTAT.7 early interrupt (INTLO/SSTAT.6 shown, with ending interrupt (DBISEL/SSTAT.4 002aaa928 Transmission with without double buffering. 10.18 (bit double buffering (Modes double buffering disabled (DBMOD, i.e. SSTAT.7 written before after SBUF written, provided updated before that shifted out. must changed again until after shifting been completed, indicated interrupt. 9397 13316 Koninklijke Philips Electronics N.V. 2004. rights reserved. User manual Rev. July 2004 Philips Semiconductors UM10107 P89LPC915/916/917 User manual double buffering enabled, MUST updated before SBUF written, will double-buffered together with SBUF data. operation described Section 10.17 "Transmit interrupts with double buffering enabled (Modes page becomes follows: double buffer empty initially. writes TB8. writes SBUF. SBUF/TB8 data loaded shift register interrupt generated immediately. there more data, else continue there more data, then: DBISEL logic more interrupt will occur. DBISEL logic INTLO logic interrupt will occur beginning STOP data currently shifter (which also last data). DBISEL logic INTLO logic interrupt will occur STOP data currently shifter (which also last data). there more data, writes again. writes SBUF again. Then: INTLO logic data will loaded interrupt will occur beginning STOP data currently shifter. INTLO logic data will loaded interrupt will occur STOP data currently shifter. 10.Note that DBISEL logic writing SBUF when STOP last data shifted out, there uncertainty whether interrupt generated already with UART knowing whether there more data f Other recent searchesXPIF300 - XPIF300 XPIF300 Datasheet MMBTSC3356 - MMBTSC3356 MMBTSC3356 Datasheet DAC908 - DAC908 DAC908 Datasheet CN8223 - CN8223 CN8223 Datasheet CN8223EPF - CN8223EPF CN8223EPF Datasheet B64290 - B64290 B64290 Datasheet AP3012 - AP3012 AP3012 Datasheet
Privacy Policy | Disclaimer |