| The Datasheet Archive - 100 Million Datasheets from 7500 Manufacturers. |
COP688KG/COP888KG COP688KG/COP888KG 8-Bit Microcontroller with UA
Top Searches for this datasheetCOP688KG/COP888KG 8-Bit Microcontroller with UART Three Multi-Function Timers COP688KG/COP888KG COP688KG/COP888KG 8-Bit Microcontroller with UART Three Multi-Function Timers General Description COP8feature family microcontrollers uses 8-bit single-chip core architecture fabricated with National Semiconductor's M2CMOSprocess technology. COP888KG member this expandable 8-bit core processor family microcontrollers. fully static part, fabricated using double-metal silicon gate microCMOS technology. Features include 8-bit memory mapped architecture, MICROWIRE/PLUSserial I/O, three 16-bit timer/counters supporting three modes (Processor Independent generation, External Event counter, Input Capture mode capabilities), full duplex UART, comparators, power saving modes (HALT IDLE), both with multi-sourced wakeup/ interrupt capability. This multi-sourced interrupt capability also used independent HALT IDLE modes. Each software selectable configurations. devices operate over voltage range 2.5V 5.5V. High throughput achieved with efficient, regular instruction operating maximum rate instruction. radiated emissions achieved gradual turn-on output drivers internal smoothing filters chip logic crystal oscillator. MICROWIRE/PLUS serial Features Memory mapped Software selectable options (TRI-STATE Output, Push-Pull Output, Weak Pull-Up Input, High Impedance Input) Schmitt trigger inputs ports Packages: with pins PLCC with pins CPU/Instruction Features instruction cycle time Fourteen multi-source vectored interrupts servicing External Interrupt with selectable edge Idle Timer Three Timers (each with interrupts) MICROWIRE/PLUS Multi-Input Wake-Up Software Trap UART Default (default interrupt) Versatile easy instruction 8-bit Stack Pointer SP-(stack RAM) 8-bit Register Indirect Data Memory Pointers Features Full duplex UART Three 16-bit timers, each with 16-bit registers supporting: Processor Independent mode External Event counter mode Input Capture mode Quiet design (low radiated emissions) kbytes on-board bytes on-board Fully Static CMOS power saving modes: HALT IDLE current drain (typically Single supply operation: 2.5V-5.5V Temperature ranges: -40°C +85°C, -55°C +125°C Additional Peripheral Features Idle Timer Multi-Input Wake-Up (MIWU) with optional interrupts analog comparators WATCHDOGand Clock Monitor logic Development Support Emulation devices Real time emulation full program debug offered MetaLink's Development System TRI-STATE registered trademark National Semiconductor Corporation. MICROWIRE/PLUSTM, M2CMOSTM, COP8TM, MICROWIREand WATCHDOGare trademarks National Semiconductor Corporation. iceMASTERis trademark MetaLink Corporation. 1997 National Semiconductor Corporation DS012829 www.national.com PrintDate=1997/07/03 PrintTime=15:36:19 9973 ds012829 Rev. Proof Block Diagram DS012829-1 FIGURE COP888KG Block Diagram Connection Diagrams Plastic Chip Carrier Dual-In-Line Package DS012829-2 View Order Number COP688KG-XXX/V, COP888KG-XXX/V Package Number V44A DS012829-3 View Order Number COP688KG-XXX/N, COP888KG-XXX/N Package Number N40A FIGURE Connection Diagrams www.national.com PrintDate=1997/07/03 PrintTime=15:36:20 9973 ds012829 Rev. Proof Connection Diagrams Port RESET (Continued) Pinouts 44-Pin Packages Type WDOUT I/CKO COMP1IN- COMP1IN+ COMP1OUT COMP2IN- COMP2IN+ COMP2OUT HALT Restart Alt. MIWU MIWU MIWU MIWU MIWU MIWU MIWU MIWU Alt. 40-Pin 44-Pin PLCC www.national.com PrintDate=1997/07/03 PrintTime=15:36:21 9973 ds012829 Rev. Proof Absolute Maximum Ratings (Note Military/Aerospace specified devices required, please contact National Semiconductor Sales Office/ Distributors availability specifications. Supply Voltage (VCC) Voltage -0.3V 0.3V Total Current into (Source) Total Current (Sink) Storage Temperature Range -65°C +140°C Note Absolute maximum ratings indicate limits beyond which damage device occur. electrical specifications ensured when operating device absolute maximum ratings. Electrical Characteristics COP888KG: -40°C +85°C unless otherwise specified Parameter Operating Voltage Power Supply Ripple (Note Supply Current (Note HALT Current (Note IDLE Current Input Levels (VIH, VIL) RESET Logic High Logic CKI, Other Inputs Logic High Logic Hi-Z Input Leakage Input Pullup Current Port Input Hysteresis Output Current Levels Outputs Source Sink Others Source (Weak Pull-Up Mode) Source (Push-Pull Mode) Sink (Push-Pull Mode) TRI-STATE Leakage Allowable Sink/Source 2.7V 2.5V, 1.8V 3.3V 2.5V, 1.8V 0.4V 2.5V, 0.4V 5.5V -2.5 -0.4 -0.2 -110 3.3V 2.5V, 1.8V 2.5V, 0.4V -0.4 -0.2 5.5V, 5.5V, (Note -250 0.35 5.5V, 5.5V, 5.5V, 5.5V, 5.5V, 12.5 Peak-to-Peak Conditions Units www.national.com PrintDate=1997/07/03 PrintTime=15:36:23 9973 ds012829 Rev. Proof Electrical Characteristics COP888KG: -40°C +85°C unless otherwise specified Parameter Current Outputs (Sink) others Maximum Input Current without Latchup (Notes Retention Voltage, Input Capacitance Load Capacitance Room Temperature Rise Fall Time (min) (Note (Note Conditions (Continued) Units 1000 Electrical Characteristics COP888KG: -40°C +85°C unless otherwise specified Parameter Instruction Cycle Time (tc) Crystal, Resonator Oscillator Clock Duty Cycle (Note Rise Time (Note Fall Time (Note Inputs tSETUP tHOLD Output Propagation Delay tPD1, tPD0 Others MICROWIRE Setup Time (tUWS) (Note MICROWIRE Hold Time (tUWH) (Note MICROWIRE Output Propagation Delay (tUPD) Input Pulse Width (Note Interrupt Input High Time Interrupt Input Time Timer Input High Time Timer Input Time Reset Pulse Width Note Maximum rate voltage change must less than V/ms. Note Supply current measured after running 2000 cycles with square wave input, open, inputs rails outputs open. Conditions 5.5V 2.5V 5.5V 2.5V Clock Clock 5.5V 2.5V 5.5V 2.5V 2.2k, 5.5V 2.5V 5.5V 2.5V Units 1.75 www.national.com PrintDate=1997/07/03 PrintTime=15:36:25 9973 ds012829 Rev. Proof Electrical Characteristics COP888KG: (Continued) Note HALT mode will stop from oscillating Crystal configurations. Measurement HALT done with device neither sourcing sinking current; with G0-G5 programmed outputs driving load; outputs programmed driving load; inputs tied VCC; clock monitor comparators disabled. Parameter refers HALT mode entered setting Port data register. Part will pull during HALT crystal clock mode. Note Pins RESET designed with high voltage input network. These pins allow input voltages greater than pins will have sink current when biased voltages greater than (the pins have source current when biased voltage below VCC). effective resistance (typical). These pins will latch voltage pins must limited less than 14V. WARNING: Voltages excess will cause damage pins. This warning excludes transients. Note Parameter characterized tested. Note Instruction Cycle Time www.national.com PrintDate=1997/07/03 PrintTime=15:36:25 9973 ds012829 Rev. Proof Absolute Maximum Ratings (Note Military/Aerospace specified devices required, please contact National Semiconductor Sales Office/ Distributors availability specifications. Supply Voltage (VCC) Voltage -0.3V 0.3V Total Current into (Source) Total Current (Sink) Storage Temperature Range -65°C +140°C Note Absolute maximum ratings indicate limits beyond which damage device occur. electrical specifications ensured when operating device absolute maximum ratings. Electrical Characteristics COP688KG: -55°C +125°C unless otherwise specified Parameter Operating Voltage Power Supply Ripple (Note Supply Current (Note HALT Current (Note IDLE Current Input Levels (VIH, VIL) RESET Logic High Logic CKI, Other Inputs Logic High Logic Hi-Z Input Leakage Input Pullup Current Port Input Hysteresis Output Current Levels Outputs Source Sink Others Source (Weak Pull-Up Mode) Source (Push-Pull Mode) Sink (Push-Pull Mode) TRI-STATE Leakage Allowable Sink/Source Current Outputs (Sink) others Maximum Input Current without Latchup (Notes Retention Voltage, Input Capacitance Load Capacitance Room Temp Rise Fall Time (min) (Note (Note 1000 4.5V, 2.7V 4.5V, 3.3V 4.5V, 0.4V 5.5V -0.4 -140 4.5V, 3.3V 4.5V, -0.4 5.5V, 5.5V, (Note -400 0.35 5.5V, 5.5V, 5.5V, 5.5V, 5.5V, 12.5 Peak-to-Peak Conditions Units www.national.com PrintDate=1997/07/03 PrintTime=15:36:27 9973 ds012829 Rev. Proof Electrical Characteristics COP688KG: -55°C +125°C unless otherwise specified Parameter Instruction Cycle Time (tc) Crystal, Resonator Inputs tSETUP tHOLD Output Propagation Delay tPD1, tPD0 Others MICROWIRESetup Time (tUWS) (Note MICROWIRE Hold Time (tUWH) (Note MICROWIRE Output Propagation Delay (tUPD) Input Pulse Width (Note Interrupt Input High Time Interrupt Input Time Timer Input High Time Timer Input Time Reset Pulse Width Note Maximum rate voltage change must less than V/ms. Note Supply current measured after running 2000 cycles with square wave input, open, inputs rails outputs open. Note HALT mode will stop from oscillating Crystal configurations. Measurement HALT done with device neither sourcing sinking current; with G0-G5 programmed outputs driving load; outputs programmed driving load; inputs tied VCC; clock monitor comparators disabled. Parameter refers HALT mode entered setting Port data register. Part will pull during HALT crystal clock mode. Note Pins RESET designed with high voltage input network. These pins allow input voltages greater than pins will have sink current when biased voltages greater than (the pins have source current when biased voltage below VCC). effective resistance (typical). These pins will latch voltage pins must limited less than 14V. WARNING: Voltages excess will cause damage pins. This warning excludes transients. Note Parameter characterized tested. Note Instruction Cycle Time Conditions 4.5V 4.5V 4.5V 2.2k, 4.5V 4.5V Units Comparators Characteristics -40°C +85°C. Parameter Input Offset Voltage Input Common Mode Voltage Range Voltage Gain Level Output Current High Level Output Current Supply Current Comparator (When Enabled) Response Time Overdrive, Load 0.4V 4.6V Conditions 0.4V 1.5V 300k Units www.national.com PrintDate=1997/07/03 PrintTime=15:36:30 9973 ds012829 Rev. Proof Comparators Characteristics (Continued) DS012829-4 FIGURE MICROWIRE/PLUS Timing Descriptions power supply pins. pins must connected. clock input. This come from generated oscillator, crystal oscillator conjunction with CKO). Oscillator Description section. RESET master reset input. Reset Description section. device contains three bidirectional 8-bit ports where each individual independently configured input (Schmitt Trigger inputs ports output TRI-STATE under program control. Three data memory address locations allocated each these ports. Each port associated 8-bit memory mapped registers, CONFIGURATION register output DATA register. memory mapped address also reserved input pins each port. (See memory various addresses associated with ports.) Figure shows port configurations. DATA CONFIGURATION registers allow each port individually configured under software control shown below: CONFIGURATION Register DATA Register Hi-Z Input (TRI-STATE Output) Input with Weak Pull-Up Push-Pull Zero Output Push-Pull Output Port Set-Up UART transmit receive. used timer input functions T2B. used timer input functions T3B. Port following alternate features: MIWU MIWU MIWU MIWU MIWU MIWU MIWU MIWU Port 8-bit port with pins (G0, G2-G5), input (G6), dedicated output (G7). Pins G2-G6 have Schmitt Triggers their inputs. serves dedicated WDOUT WATCHDOG output, while either input output depending oscillator mask option selected. With crystal oscillator option selected, serves dedicated output clock output. With single-pin oscillator mask option selected, serves general purpose input also used bring device HALT mode with high transition There registers associated with Port, data register configuration register. Therefore, each bits (G0, G2-G5) individually configured under software control. Since input only dedicated clock output (crystal clock option) general purpose input (R/C clock option), associated bits data configuration registers used special purpose functions outlined next page. Reading data bits will return zeros. PORT 8-bit port. L-pins have Schmitt triggers inputs. Port supports Multi-Input Wake eight pins. used UART external clock. used www.national.com PrintDate=1997/07/03 PrintTime=15:36:31 9973 ds012829 Rev. Proof Descriptions (Continued) DS012829-5 FIGURE Port Configurations Note that chip will placed HALT mode writing Port Data Register. Similarly chip will placed IDLE mode writing Port Data Register. Writing Port Configuration Register enables MICROWIRE/PLUS operate with alternate phase clock. configuration bit, high, enables clock start delay after HALT when clock configuration used. Config Reg. CLKDLY Alternate Data Reg. HALT IDLE REGISTERS 8-bit addition, subtraction, logical shift operation instruction (tc) cycle time. There registers: 8-bit Accumulator Register 15-bit Program Counter Register upper bits program counter (PC) lower bits program counter (PC) 8-bit address pointer, which optionally post auto incremented decremented. 8-bit alternate address pointer, which optionally post auto incremented decremented. 8-bit stack pointer, which points subroutine/ interrupt stack RAM). initialized address with reset. 8-bit Data Segment Address Register used extend lower half address range into data segments bytes each. registers memory mapped with exception Accumulator Program Counter (PC). PROGRAM MEMORY program memory consists kbytes ROM. These bytes hold program instructions constant data (data tables LAID instruction, jump vectors instruction, interrupt vectors instruction). program memory addressed 15-bit program counter (PC). interrupts devices vector program memory location Hex. Port 8-bit output port that preset high when RESET goes low. user more port outputs (except together order higher drive. Functional Description architecture device modified Harvard architecture. With Harvard architecture, control store program memory (ROM) separated from data store memory (RAM). Both have their separate addressing space with separate address buses. architecture, though based Harvard architecture, permits transfer data from RAM. Port following alternate features: INTR (External Interrupt Input) (Timer Capture Input) (Timer I/O) (MICROWIRE Serial Data Output) (MICROWIRE Serial Clock) (MICROWIRE Serial Data Input) Port following dedicated functions: WDOUT WATCHDOG and/or Clock Monitor dedicated output Oscillator dedicated output general purpose input Port 8-bit port. 40-pin device does have full complement Port pins. unavailable pins terminated. read operation these unterminated pins will return unpredicatable values. Port eight-bit Hi-Z input port. Port I1-I3 used Comparator Port I4-I6 used Comparator Port following alternate features: COMP1-IN (Comparator Negative Input) COMP1+IN (Comparator Positive Input) COMP1OUT (Comparator Output) COMP2-IN (Comparator Negative Input) COMP2+IN (Comparator Positive Input) COMP2OUT (Comparator Output) www.national.com PrintDate=1997/07/03 PrintTime=15:36:32 9973 ds012829 Rev. Proof Functional Description DATA MEMORY (Continued) data memory address space includes on-chip data registers, registers (Configuration, Data Pin), control registers, MICROWIRE/PLUS shift register, various registers, counters associated with timers (with exception IDLE timer). Data memory addressed directly instruction indirectly pointers register. data memory consists bytes RAM. Sixteen bytes mapped "registers" addresses Hex. These registers loaded immediately, also decremented tested with DRSZ (decrement register skip zero) instruction. memory pointer registers memory mapped into this space address locations respectively, with other registers being available general usage. instruction permits memory set, reset tested. registers (except memory mapped; therefore, bits register bits directly individually set, reset tested. accumulator bits also directly individually tested. Note: contents undefined upon power-up. equals zero, then data segment extension register used extend base address range (from 0000 007F) from XX00 XX7F, where represents bits from register. Thus 128-byte data segment extensions located from addresses 0100 017F data segment 0200 027F data segment etc., FF00 FF7F data segment 255. base address range from 0000 007F represents data segment Data Memory Segment Extension Data memory address used memory mapped location Data Segment Address Register (S). data store memory either addressed directly single byte address within instruction, indirectly relative reference pointers (each contains single-byte address). This single-byte address allows addressing range locations from hex. upper this single-byte address divides data store memory into separate sections outlined previously. With exception register memory from address locations 00F0 00FF, memory memory mapped with upper single-byte address being equal zero. This allows upper single-byte address determine whether base address range (from 0000 00FF) extended. this upper equals (representing address range 0080 00FF), then address extension does take place. Alternatively, this upper Figure illustrates register data memory extension used extending lower half base address range hex) into data segments bytes each, with total addressing range kbytes from XX00 XX7F. This organization allows total data segments bytes each with additional upper base segment bytes. Furthermore, addressing modes available data segments. register must changed under program control move from data segment (128 bytes) another. However, upper base segment (containing memory registers, registers, control registers, etc.) always available regardless contents register, since upper base segment (address range 0080 00FF) independent data segment extension. instructions that utilize stack pointer (SP) always reference stack part base segment (Segment regardless contents register. register changed these instructions. Consequently, stack (used with subroutine linkage interrupts) always located base segment. stack pointer will intitialized point data memory location 006F result reset. bytes contained base segment split between lower upper base segments. first bytes resident from address 0000 006F lower base segment, while remaining bytes represent data memory registers located addresses 00F0 00FF upper base segment. located upper sixteen addresses (0070 007F) lower base segment. Additional beyond these initial bytes, however, will always memory mapped groups bytes less) data segment address extensions (XX00 XX7F) lower base segment. additional bytes memory mapped segment through segment (see Figure www.national.com PrintDate=1997/07/03 PrintTime=15:36:33 9973 ds012829 Rev. Proof Data Memory Segment Extension (Continued) DS012829-6 *Reads ones. FIGURE Organization Reset RESET input when pulled initializes microcontroller. Initialization will occur whenever RESET input pulled low. Upon initialization, data configuration registers ports cleared, resulting these Ports being initialized TRI-STATE mode. Port exception noted below) since dedicated WATCHDOG and/or Clock Monitor error output pin. Port high. PSW, ICNTRL, CNTRL, T2CNTRL T3CNTRL control registers cleared. UART registers PSR, (except that TBMT set), ENUR ENUI cleared. Comparator Select Register cleared. register initialized zero. MultiInput Wakeup registers WKEN WKEDG cleared. Wakeup register WKPND unknown. stack pointer, initialized hex. device comes reset with both WATCHDOG logic Clock Monitor detector armed, with WATCHDOG service window bits Clock Monitor set. WATCHDOG Clock Monitor circuits inhibited during reset. WATCHDOG service window bits being initialized high default maximum WATCHDOG service window clock cycles. Clock Monitor being initialized high will cause Clock Monitor error following reset clock reached minimum specified frequency termination reset. Clock Monitor error will cause active error output This error output will continue until tC-32 clock cycles following clock frequency reaching minimum specified value, which time output will enter TRI-STATE mode. external network shown Figure should used ensure that RESET held until power supply chip stabilizes. DS012829-7 Power Supply Rise Time FIGURE Recommended Reset Circuit Oscillator Circuits chip driven clock input input which between MHz. output clock (crystal configuration). input frequency divided down produce instruction cycle clock (1/tc). Figure shows Crystal oscillator diagrams. CRYSTAL OSCILLATOR connected make closed loop crystal resonator) controlled oscillator. Table shows component values required various standard crystal values. OSCILLATOR selecting single oscillator input, single oscillator circuit connected available general purpose input, and/or HALT restart input. Table shows variation oscillator frequencies functions component values. www.national.com PrintDate=1997/07/03 PrintTime=15:36:34 9973 ds012829 Rev. Proof Oscillator Circuits (Continued) BUSY EXPND T1ENA MICROWIRE/PLUS busy shifting flag External interrupt pending Timer Interrupt Enable Timer Underflow Input capture edge T1PNDA Timer Interrupt Pending Flag (Autoreload mode Underflow Mode capture edge mode Carry Flag DS012829-9 Half Carry Flag CT1PNDAT1ENAEXPNDBUSYEXEN DS012829-8 FIGURE Crystal Oscillator Diagrams TABLE Crystal Oscillator Configuration, 25°C (pF) (pF) 30-36 30-36 Freq Conditions (MHz) 0.455 Half-Carry also affected instructions that affect Carry flag. (Set Carry) (Reset Carry) instructions will respectively clear both carry flags. addition instructions, ADC, SUBC, instructions affect carry Half Carry flags. ICNTRL Register (Address X'00E8) ICNTRL register contains following bits: T1ENB Timer Interrupt Enable Input capture edge T1PNDB Timer Interrupt Pending Flag capture edge µWEN Enable MICROWIRE/PLUS interrupt µWPND MICROWIRE/PLUS interrupt pending T0EN Timer Interrupt Enable (Bit toggle) T0PND Timer Interrupt pending LPEN Port Interrupt Enable (Multi-Input Wakeup/ Interrupt) could used flag UnusedLPEN T0PNDT0EN µWPND µWEN T1PNDB T1ENB 100-150 TABLE Oscillator Configuration, 25°C (pF) Freq (MHz) Instr. Cycle (µs) 10.8 Conditions Note: 200k Control Registers CNTRL Register (Address X'00EE) Timer1 (T1) MICROWIRE/PLUS control register contains following bits: Select MICROWIRE/PLUS clock divide IEDG External interrupt edge polarity select Rising edge, Falling edge) MSEL Selects MICROWIRE/PLUS signals respectively T1C0 Timer Start/Stop control timer modes Timer Underflow Interrupt Pending Flag timer mode Timer mode control Timer mode control Timer mode control T1C1 T1C2 T1C3 T2CNTRL Register (Address X'00C6) T2CNTRL register contains following bits: T2ENB Timer Interrupt Enable Input capture edge T2PNDB Timer Interrupt Pending Flag capture edge T2ENA Timer Interrupt Enable Timer Underflow Input capture edge T2PNDA Timer Interrupt Pending Flag (Autoreload mode Underflow mode capture edge mode T2C0 Timer Start/Stop control timer modes Timer Underflow Interrupt Pending Flag timer mode T2C1 Timer mode control T2C2 T2C3 Timer mode control Timer mode control T1C3 T1C2 T1C1 T1C0 MSEL IEDG Register (Address X'00EF) T2C3 T2C2 T2C1 T2C02PNDA T2ENA2PNDB T2ENB register contains following select bits: Global interrupt enable (enables interrupts) EXEN Enable external interrupt www.national.com PrintDate=1997/07/03 PrintTime=15:36:36 9973 ds012829 Rev. Proof Control Registers (Continued) T3CNTRL Register (Address X'00B6) T3CNTRL register contains following bits: T3ENB Timer Interrupt Enable Input capture edge T3PNDB Timer Interrupt Pending Flag capture edge T3ENA Timer Interrupt Enable Timer Underflow Input capture edge T3PNDA Timer Interrupt Pending Flag (Autoreload mode Underflow mode capture edge mode T3C0 Timer Start/Stop control timer modes Timer Underflow Interrupt Pending Flag timer mode T3C1 Timer mode control T3C2 Timer mode control T3C3 Timer mode control T3C3 T3C2 T3C1 T3C0 3PNDAT3ENA T3PNDBT3ENB timer functions with minimal software overhead. timer block three operating modes: Processor Independent mode, External Event Counter mode, Input Capture mode. control bits TxC3, TxC2, TxC1 allow selection different modes operation. Mode Processor Independent Mode name suggests, this mode allows device generate signal with very minimal user intervention. user only define parameters signal time time). Once begun, timer block will continuously generate signal completely independent microcontroller. user software services timer block only when parameters require updating. this mode timer counts down fixed rate Upon every underflow timer alternately reloaded with contents supporting registers, RxB. very first underflow timer causes timer reload from register RxA. Subsequent underflows cause timer reloaded from registers alternately beginning with register RxB. Timer control bits, TxC3, TxC2 TxC1 timer mode operation. Timers device contains very versatile timers (T0, T3). timers associated autoreload/capture registers power containing random data. TIMER (IDLE TIMER) device supports applications that require maintaining real time power with IDLE mode. This IDLE mode support furnished IDLE timer which 16-bit timer. Timer runs continuously fixed rate instruction cycle clock, user cannot read write IDLE Timer which count down timer. Timer supports following functions: Exit Idle Mode (See Idle Mode description) WATCHDOG logic (See WATCHDOG description) Start delay HALT mode IDLE Timer generate interrupt when thirteenth toggles. This toggle latched into T0PND pending flag, will occur every maximum clock frequency µs). control flag T0EN allows interrupt from thirteenth Timer enabled disabled. Setting T0EN will enable interrupt, while resetting will disable interrupt. Figure shows block diagram timer mode. underflows programmed toggle output pin. underflows also programmed generate interrupts. Underflows from timer alternately latched into pending flags, TxPNDA TxPNDB. user must reset these pending flags under software control. control enable flags, TxENA TxENB, allow interrupts from timer underflow enabled disabled. Setting timer enable flag TxENA will cause interrupt when timer underflow causes register reloaded into timer. Setting timer enable flag TxENB will cause interrupt when timer underflow causes register reloaded into timer. Resetting timer enable flags will disable associated interrupts. Either both timer underflow interrupts enabled. This gives user flexibility interrupting once period either rising falling edge output. Alternatively, user choose interrupt both edges output. TIMER TIMER TIMER device three powerful timer/counter blocks, associated features functioning timer block described referring timer block Since three timer blocks, identical, comments equally applicable three timer blocks. Each timer block consists 16-bit timer, supporting 16-bit autoreload/capture registers, RxB. Each timer block pins associated with TxB. supports required timer block, while input timer block. powerful flexible timer block allows device easily perform www.national.com DS012829-10 FIGURE Timer Mode PrintDate=1997/07/03 PrintTime=15:36:37 9973 ds012829 Rev. Proof Timers (Continued) Mode External Event Counter Mode This mode quite similar processor independent mode described above. main difference that timer, clocked input signal from pin. timer control bits, TxC3, TxC2 TxC1 allow timer clocked either positive negative edge from pin. Underflows from timer latched into TxPNDA pending flag. Setting TxENA control flag will cause interrupt when timer underflows. this mode input used independent positive edge sensitive interrupt input TxENB control flag set. occurrence positive edge input latched into TxPNDB flag. sequently, TxC0 control should reset when entering Input Capture mode. timer underflow interrupt enabled with TxENA control flag. When interrupt occurs Input Capture mode, user must check both TxPNDA TxC0 pending flags order determine whether input capture timer underflow both) caused interrupt. Figure shows block diagram timer Input Capture mode. Figure shows block diagram timer External Event Counter mode. Note: output available this mode since being used counter input clock. DS012829-12 FIGURE Timer Input Capture Mode TIMER CONTROL FLAGS timers have indentical control structures. control bits their functions summarized below. Timer Start/Stop control Modes (Processor Independent External Event Counter), where Start, Stop Timer Underflow Interrupt Pending Flag Mode (Input Capture) TxPNDA Timer Interrupt Pending Flag TxPNDB Timer Interrupt Pending Flag TxENA Timer Interrupt Enable Flag TxENB Timer Interrupt Enable Flag Timer Interrupt Enabled Timer Interrupt Disabled TxC3 Timer mode control TxC2 Timer mode control TxC1 Timer mode control TxC0 DS012829-11 FIGURE Timer External Event Counter Mode Mode Input Capture Mode device precisely measure external frequencies time external events placing timer block, input capture mode. this mode, timer constantly running fixed rate. registers, RxB, capture registers. Each register acts conjunction with pin. register acts conjunction with register acts conjunction with pin. timer value gets copied over into register when trigger event occurs corresponding pin. Control bits, TxC3, TxC2 TxC1, allow trigger events specified either positive negative edge. trigger condition each input specified independently. trigger conditions also programmed generate interrupts. occurrence specified trigger condition pins will respectively latched into pending flags, TxPNDA TxPNDB. control flag TxENA allows interrupt either enabled disabled. Setting TxENA flag enables interrupts generated when selected trigger condition occurs pin. Similarly, flag TxENB controls interrupts from pin. Underflows from timer also programmed generate interrupts. Underflows latched into timer TxC0 pending flag (the TxC0 control serves timer underflow interrupt pending flag Input Capture mode). Con- www.national.com PrintDate=1997/07/03 PrintTime=15:36:38 9973 ds012829 Rev. Proof Timers TxC3 (Continued) timer mode control bits (TxC3, TxC2 TxC1) detailed below: TxC2 TxC1 Timer Mode MODE (External Event Counter) MODE (External Event Counter) MODE (PWM) Toggle MODE (PWM) Toggle MODE (Capture) Captures: Pos. Edge Pos. Edge MODE (Capture) Captures: Pos. Edge Neg. Edge MODE (Capture) Captures: Neg. Edge Pos. Edge MODE (Capture) Captures: Neg. Edge Neg. Edge Interrupt Source Timer Underflow Timer Underflow Autoreload Autoreload Pos. Edge Timer Underflow Pos. Edge Timer Underflow Neg. Edge Timer Underflow Neg. Edge Timer Underflow method with high transition (G7) pin. This method precludes crystal clock configuration (since becomes dedicated output), only used with clock configuration. third method exiting HALT mode pulling RESET low. Since crystal ceramic resonator selected oscillator, Wakeup signal allowed start chip running immediately since crystal oscillators ceramic resonators have delayed start time reach full amplitude frequency stability. IDLE timer used generate fixed delay ensure that oscillator indeed stabilized before allowing instruction execution. this case, upon detecting valid Wakeup signal, only oscillator circuitry enabled. IDLE timer loaded with value clocked with instruction cycle clock. clock derived dividing oscillator clock down factor Schmitt trigger following inverter chip ensures that IDLE timer clocked only when oscillator sufficiently large amplitude meet Schmitt trigger specifications. This Schmitt trigger part oscillator closed loop. startup timeout from IDLE timer enables clock signals routed rest chip. clock option being used, fixed delay introduced optionally. control bit, CLKDLY, mapped configuNeg. Edge Pos. Edge Neg. Edge Interrupt Source Pos. Edge Pos. Edge Autoreload Autoreload Pos. Edge Timer Counts Pos. Edge Neg. Edge Power Save Modes device offers user power save modes operation: HALT IDLE. HALT mode, microcontroller activities stopped. IDLE mode, on-board oscillator circuitry timer active other microcontroller activities stopped. either mode, on-board RAM, registers, states, timers (with exception unaltered. HALT MODE device placed HALT mode writing HALT flag data bit). microcontroller activities, including clock timers, stopped. WATCHDOG logic device disabled during HALT mode. However, clock monitor circuitry enabled remains active will cause WATCHDOG output (WDOUT) low. HALT mode used user does want activate WDOUT pin, Clock Monitor should disabled after device comes reset (resetting Clock Monitor control with first write WDSVR register). HALT mode, power requirements device minimal applied voltage (VCC) decreased 2.0V) without altering state machine. device supports three different ways exiting HALT mode. first method exiting HALT mode with Multi-Input Wakeup feature port. second www.national.com PrintDate=1997/07/03 PrintTime=15:36:39 9973 ds012829 Rev. Proof Power Save Modes (Continued) ration controls whether delay introduced not. delay included CLKDLY set, excluded CLKDLY reset. CLKDLY cleared reset. device mask options associated with HALT mode. first mask option enables HALT mode feature, while second mask option disables HALT mode. With HALT mode enable mask option, device will enter exit HALT mode described above. With HALT disable mask option, device cannot placed HALT mode (writing HALT flag will have effect, HALT flag will remain "0"). IDLE MODE device placed IDLE mode writing IDLE flag data bit). this mode, activities, except associated on-board oscillator circuitry IDLE Timer stopped. power supply requirements micro-controller this mode operation typically around normal power requirement microcontroller. with HALT mode, device returned normal operation with reset, with Multi-Input Wakeup from Port. Alternately, microcontroller resumes normal operation from IDLE mode when thirteenth (representing 4.096 internal clock frequency MHz, IDLE Timer toggles. This toggle condition thirteenth IDLE Timer latched into T0PND pending flag. user option being interrupted with transition thirteenth IDLE Timer interrupt enabled disabled T0EN control bit. Setting T0EN flag enables interrupt vice versa. user enter IDLE mode with Timer interrupt enabled. this case, when T0PND gets set, device will first execute Timer interrupt service routine then return instruction following "Enter Idle Mode" instruction. Alternatively, user enter IDLE mode with IDLE Timer interrupt disabled. this case, device will resume normal operation with instruction immediately following "Enter IDLE Mode" instruction. Note: necessary program instructions following both HALT mode IDLE mode instructions. These instructions necessary allow clock resynchronization following HALT IDLE modes. Multi-Input Wakeup Multi-Input Wakeup feature return (wakeup) device from either HALT IDLE modes. Alternately Multi-Input Wakeup/Interrupt feature also used generate edge selectable external interrupts. Figure shows Multi-Input Wakeup logic. Multi-Input Wakeup feature utilizes Port. user selects which particular port combination Port bits) will cause device exit HALT IDLE modes. selection done through Register WKEN. Register WKEN 8-bit read/write register, which contains control every port bit. Setting particular WKEN enables Wakeup from associated port pin. DS012829-13 FIGURE Multi-Input Wake Logic www.national.com PrintDate=1997/07/03 PrintTime=15:36:40 9973 ds012829 Rev. Proof Multi-Input Wakeup (Continued) user select whether trigger condition selected Port going either positive edge (low high transition) negative edge (high transition). This selection made Register WKEDG, which 8-bit control register with assigned each Port pin. Setting control will select trigger condition negative edge that particular Port pin. Resetting selects trigger condition positive edge. Changing edge select entails several steps order avoid RBIT SBIT RBIT SBIT WKEN WKEDG WKPND WKEN Disable Port Wakeup Select going edge sensitivity Clear pending Re-enable Wakeup condition result edge change. First, associated WKEN should reset, followed edge select change WKEDG. Next, associated WKPND should cleared, followed associated WKEN being re-enabled. example serve clarify this procedure. Suppose wish change edge select from positive (low going high) negative (high going low) Port where previously been enabled input interrupt. program would follows: port bits have been used outputs then changed inputs with Multi-Input Wakeup/Interrupt, safety procedure should also followed avoid wakeup conditions. After selected port bits have been changed from output input before associated WKEN bits enabled, associated edge select bits WKEDG should reset desired edge selects, followed associated WKPND bits being cleared. This same procedure should used following reset, since port inputs left floating result reset. occurrence selected trigger condition MultiInput Wakeup latched into pending register called WKPND. respective bits WKPND register will occurrence selected trigger edge corresponding Port pin. user responsibility clearing these pending flags. Since WKPND pending register occurrence selected wakeup conditions, device will enter HALT mode Wakeup both enabled pending. Consequently, user must clear pending flags before attempting enter HALT mode. WKEN, WKPND WKEDG read/write registers, cleared reset. PORT INTERRUPTS Port provides user with additional eight fully selectable, edge sensitive interrupts which vectored into same service subroutine. interrupt from Port shares logic with wake circuitry. register WKEN allows interrupts from Port individually enabled disabled. register WKEDG specifies trigger condition either positive negative edge. Finally, register WKPND latches pending trigger conditions. (Global Interrupt Enable) enables interrupt function. control flag, LPEN, functions global interrupt enable Port interrupts. Setting LPEN flag will enable interrupts vice versa. separate global pending flag needed since register WKPND adequate. Since Port also used waking device HALT IDLE modes, user elect exit HALT IDLE modes either with without interrupt enabled. elects disable interrupt, then device will restart execution from instruction immediately following instruction that placed microcontroller HALT IDLE modes. other case, device will first execute interrupt service routine then revert normal operation. (See HALT MODE clock option wakeup information.) UART device contains full-duplex software programmable UART. UART (Figure consists transmit shift register, receive shift register seven addressable registers, follows: transmit buffer register (TBUF), receiver buffer register (RBUF), UART control status register (ENU), UART receive control status register (ENUR), UART interrupt clock source register (ENUI), prescaler select register (PSR) baud (BAUD) register. register contains flags transmit receive functions; this register also determines length data frame bits), value ninth transmission, parity selection bits. ENUR register flags framing, data overrun parity errors while UART receiving. Other functions ENUR register include saving ninth received data frame, enabling disabling UART's attention mode operation providing additional receiver/transmitter status information RCVG XMTG bits. determination internal external clock source done ENUI register, well selecting number stop bits enabling disabling transmit receive interrupts. control flag this register also select UART mode operation: asynchronous synchronous. www.national.com PrintDate=1997/07/03 PrintTime=15:36:41 9973 ds012829 Rev. Proof UART (Continued) DS012829-14 FIGURE UART Block Diagram UART CONTROL STATUS REGISTERS operation UART programmed through three registers: ENU, ENUR ENUI. function individual bits these registers follows: ENU-UART Control Status Register (Address 0BA) PSEL1XBIT9/ CHL1 CHL0 RBFL TBMT PSEL0 (Address 0BB) SPARERBIT9 ATTNXMTGRCVG (Note ENUI-UART Interrupt Clock Source Register (Address 0BC) STP2STP78 ETDX SSEL XRCLK XTCLK ENUR-UART Receive Control Status Register www.national.com PrintDate=1997/07/03 PrintTime=15:36:42 9973 ds012829 Rev. Proof UART (Continued) RBIT9: Contains ninth data received when UART operating with nine data bits frame. SPARE: Reserved future use. Flags Parity Error. Indicates Parity Error been detected since last time ENUR register read. Indicates occurrence Parity Error. Flags Framing Error. Indicates Framing Error been detected since last time ENUR register read. Indicates occurrence Framing Error. DOE: Flags Data Overrun Error. Indicates Data Overrun Error been detected since last time ENUR register read. Indicates occurrence Data Overrun Error. ENUI-UART INTERRUPT CLOCK SOURCE REGISTER ETI: This enables/disables interrupt from transmitter section. Interrupt from transmitter disabled. Interrupt from transmitter enabled. ERI: This enables/disables interrupt from receiver section. Interrupt from receiver disabled. Interrupt from receiver enabled. XTCLK: This selects clock source transmitter section. XTCLK clock source selected through BAUD registers. XTCLK Signal (L1) used clock. XRCLK: This selects clock source receiver section. XRCLK clock source selected through BAUD registers. XRCLK Signal (L1) used clock. SSEL: UART mode select. SSEL Asynchronous Mode. SSEL Synchronous Mode. ETDX: (UART Transmit Pin) alternate function assigned Port selected setting ETDX bit. simulate line break generation, software should reset ETDX output logic zero through Port data configuration registers. STP78: This program last Stop 7/8th length. STP2: This programs number Stop bits transmitted. STP2 Stop transmitted. STP2 Stop bits transmitted. Note used. cleared reset. reset. read-only; cannot written software. read/write. cleared read; when read software one, cleared automatically. Writing does affect state. DESCRIPTION UART REGISTER BITS ENU-UART CONTROL STATUS REGISTER TBMT: This when UART transfers byte data from TBUF register into TSFT register transmission. automatically reset when software writes into TBUF register. RBFL: This when UART received complete character copied into RBUF register. automatically reset when software reads character from RBUF. ERR: This global UART error flag which gets combination errors (DOE, occur. CHL1, CHL0: These bits select character frame format. Parity included generated/verified hardware. CHL1 CHL0 frame contains eight data bits. CHL1 CHL0 frame contains seven data bits. CHL1 CHL0 frame contains nine data bits. CHL1 CHL0 Loopback Mode selected. Transmitter output internally looped back receiver input. Nine framing format used. XBIT9/PSEL0: Programs ninth transmission when UART operating with nine data bits frame. seven eight data bits frame, this conjunction with PSEL1 selects parity. PSEL1, PSEL0: Parity select bits. PSEL1 PSEL0 Parity Parity enabled) PSEL1 PSEL0 Parity Parity enabled) PSEL1 PSEL0 Mark(1) Parity enabled) PSEL1 PSEL0 Space(0) Parity enabled) PEN: This enables/disables Parity 8-bit modes only). Parity disabled. Parity enabled. ENUR-UART RECEIVE CONTROL STATUS REGISTER RCVG: This high whenever framing error occurs goes when goes high. XMTG: This indicate that UART transmitting. gets reset last frame (end last Stop bit). ATTN: ATTENTION Mode enabled while this set. This cleared automatically receiving character with data nine set. Associated Pins Data transmitted received pin. alternate function assigned Port selected setting ETDX ENUI register) one. inherent function Port requiring setup. www.national.com PrintDate=1997/07/03 PrintTime=15:36:44 9973 ds012829 Rev. Proof Associated Pins (Continued) baud rate clock UART generated on-chip, taken from external source. Port (CKX) external clock pin. either input output, determined Port Configuration Data registers (Bit input, accepts clock signal which selected drive transmitter and/or receiver. output, presents internal Baud Rate Generator output. When external clock input selected pin, data transmit receive performed synchronously with this clock through TDX/RDX pins. data transmit receive selected with clock output, device generates synchronous clock output pin. internal baud rate generator used produce synchronous clock. Data transmit receive performed synchronously with this clock. FRAMING FORMATS UART supports several serial framing formats (Figure 13). format selected using control bits ENU, ENUR ENUI registers. first format data transmission (CHL0 CHL1 consists Start bit, seven Data bits (excluding parity) 7/8, Stop bits. applications using parity, parity generated verified hardware. second format (CHL0 CHL1 consists Start bit, eight Data bits (excluding parity) 7/8, Stop bits. Parity generated verified hardware. third format transmission (CHL0 CHL1 consists Start bit, nine Data bits 7/8, Stop bits. This format also supports UART "ATTENTION" feature. When operating this format, eight bits TBUF RBUF used data. ninth data transmitted received using bits ENUR registers, called XBIT9 RBIT9. RBIT9 read only bit. Parity generated verified this mode. above framing formats, last Stop programmed 7/8th length. Stop bits selected 7/8th (selected), second Stop will 7/8th length. parity enabled/disabled located register. Parity selected 8-bit modes only. parity enabled (PEN parity selection then performed PSEL0 PSEL1 bits located register. Note that XBIT9/PSEL0 located register serves mutually exclusive functions. This programs ninth transmission when UART operating with nine data bits frame. There parity selection this framing format. other framing formats XBIT9 needed PSEL0 used conjunction with PSEL1 select parity. frame formats receiver differ from transmitter number Stop bits required. receiver only requires Stop frame, regardless setting Stop selection bits control register. Note that implicit assumption made full duplex UART operation that framing formats same transmitter receiver. UART Operation UART modes operation: asynchronous mode synchronous mode. ASYNCHRONOUS MODE This mode selected resetting SSEL ENUI register) zero. input frequency UART times baud rate. TSFT TBUF registers double-buffer data transmission. While TSFT shifting current character pin, TBUF register loaded software with next byte transmitted. When TSFT finishes transmitting current character contents TBUF transferred TSFT register Transmit Buffer Empty Flag (TBMT register) set. TBMT flag automatically reset UART when software loads character into TBUF register. There also XMTG which indicate that UART transmitting. This gets reset last frame (end last Stop bit). TBUF read/write register. RSFT RBUF registers double-buffer data being received. UART receiver continually monitors signal level detect beginning Start bit. Upon sensing this level, waits half time samples again. still low, receiver considers this valid Start bit, remaining bits character frame each sampled single time, mid-bit position. Serial data input shifted into RSFT register. Upon receiving complete character, contents RSFT register copied into RBUF register Received Buffer Full Flag (RBFL) set. RBFL automatically reset when software reads character from RBUF register. RBUF read only register. There also RCVG which high when framing error occurs goes once goes high. TBMT, XMTG, RBFL RCVG read only bits. SYNCHRONOUS MODE this mode data transferred synchronously with clock. Data transmitted rising edge received falling edge synchronous clock. This mode selected setting SSEL ENUI register. input frequency UART same baud rate. www.national.com PrintDate=1997/07/03 PrintTime=15:36:45 9973 ds012829 Rev. Proof UART Operation (Continued) DS012829-15 FIGURE Framing Formats UART INTERRUPTS UART capable generating interrupts. Interrupts generated Receive Buffer Full Transmit Buffer Empty. Both interrupts have individual interrupt vectors. bytes program memory space reserved each interrupt vector. vectors located addresses 0xEC 0xEF program memory space. interrupts individually enabled disabled using Enable Transmit Interrupt (ETI) Enable Receive Interrupt (ERI) bits ENUI register. interrupt from Transmitter pending, remains pending, long both TBMT bits set. remove this interrupt, software must either clear write TBUF register (thus clearing TBMT bit). interrupt from receiver pending, remains pending, long both RBFL bits set. remove this interrupt, software must either clear read from RBUF register (thus clearing RBFL bit). basic baud clock created from oscillator frequency through two-stage divider chain consisting 1-16 (increments 0.5) prescaler 11-bit binary counter. (Figure 14). divide factors specified through read/ write registers shown Figure Note that 11-bit Baud Rate Divisor spills over into Prescaler Select Register (PSR). cleared upon reset. shown Table Prescaler Factor corresponds CLOCK. This condition UART power down mode where UART clock turned power saving purpose. user must also turn UART clock when different baud rate chosen. correspondences between 5-bit Prescaler Select Prescaler factors shown Table There many ways calculate divisor factors, particularly effective method would achieve 1.8432 frequency coming first stage. 1.8432 prescaler output then used drive software programmable baud rate counter create clock following baud rates: 110, 134.5, 150, 300, 600, 1200, 1800, 2400, 3600, 4800, 7200, 9600, 19200 38400 (Table Other baud rates created using appropriate divisors. clock then divided provide rate serial shift registers transmitter receiver. Baud Clock Generation clock inputs transmitter receiver sections UART individually selected come either from external source (port from source selected BAUD registers. Internally, www.national.com PrintDate=1997/07/03 PrintTime=15:36:46 9973 ds012829 Rev. Proof Baud Clock Generation (Continued) DS012829-16 FIGURE UART BAUD Clock Generation DS012829-17 FIGURE UART BAUD Clock Divisor Registers TABLE Baud Rate Divisors (1.8432 Prescaler Output) Baud Rate (110.03) 134.5 (134.58) 1200 1800 2400 3600 4800 7200 9600 19200 38400 Baud Rate Divisor (N-1) 1046 Prescaler Select 00111 01000 01001 01010 01011 01100 01101 01110 01111 10000 10001 10010 10011 10100 10101 10110 10111 11000 11001 11010 11011 11100 11101 11110 11111 Prescaler Factor 10.5 11.5 12.5 13.5 14.5 15.5 Note: entries Table assume prescaler output 1.8432 MHz. asynchronous mode baud rate could high 625k. TABLE Prescaler Factors Prescaler Select 00000 00001 00010 00011 00100 00101 00110 Prescaler Factor CLOCK example, considering Asynchronous Mode clock 4.608 MHz, prescaler factor selected 4.608/1.8432 entry available Table 1.8432 prescaler output then used with proper Baud Rate Divisor (Table obtain different baud rates. baud rate 19200 e.g., entry Table value from Table www.national.com PrintDate=1997/07/03 PrintTime=15:36:47 9973 ds012829 Rev. Proof Baud Clock Generation Baud Rate Divisor) (Continued) Diagnostic Bits CHARL0 CHARL1 register provide loopback feature diagnostic testing UART. When these bits one, following occur: receiver input (RDX) internally connected transmitter output (TDX); output Transmitter Shift Register "looped back" into Receive Shift Register input. this mode, data that transmitted immediately received. This feature allows processor verify transmit receive data paths UART. Note that framing format this mode nine format; Start bit, nine data bits, 7/8, Stop bits. Parity generated verified this mode. Baud Rate 1.8432 MHz/(16 19200 divide performed because asynchronous mode, input frequency UART times baud rate. equation calculate baud rates given below. actual Baud Rate found from: Fc/(16 Where: Baud Rate frequency Baud Rate Divisor (Table Prescaler Divide Factor selected value Prescaler Select Register (Table Note: Synchronous Mode, divisor replaced two. Attention Mode UART Receiver section supports alternate mode operation, referred ATTENTION Mode. This mode operation selected ATTN ENUR register. data format transmission must also selected having nine Data bits either 7/8, Stop bits. ATTENTION mode operation intended networking device with other processors. Typically such environments messages consists device addresses, indicating which several destinations should receive them, actual data. This Mode supports scheme which addresses flagged having ninth data field ninth reset zero byte Data byte. While ATTENTION mode, UART monitors communication flow, ignores characters until address character received. Upon receiving address character, UART signals that character ready setting RBFL flag, which turn interrupts processor UART Receiver interrupts enabled. ATTN also cleared automatically this point, that data characters well address characters recognized. Software examines contents RBUF responds deciding either accept subsequent data stream leaving ATTN reset) wait until next address character seen setting ATTN again). Operation UART Transmitter affected selection this Mode. value ninth transmitted programmed setting XBIT9 appropriately. value ninth received obtained reading RBIT9. Since this located ENUR register where error flags reside, operation will reset error flags. Example: Asynchronous Mode: Crystal Frequency Desired baud rate 9600 Using above equation calculated first. 106)/(16 9600) 32.552 32.552 divided each Prescaler Factor (Table obtain value closest integer. This factor happens 6.5). 32.552/6.5 5.008 programmed value (from Table should Using above values calculated 106)/(16 6.5) 9615.384 error (9615.385 9600)/9600 0.16 Effect HALT/IDLE UART logic reinitialized when either HALT IDLE modes entered. This reinitialization sets TBMT flag resets read only bits UART control status registers. Read/Write bits remain unchanged. Transmit Buffer (TBUF) affected, Transmit Shift register (TSFT) bits one. receiver registers RBUF RSFT affected. device will exit from HALT/IDLE modes when Start character detected (L3) pin. This feature obtained using Multi-Input Wakeup scheme provided device. Before entering HALT IDLE modes user program must select Wakeup source pin. This selection done setting WKEN (Wakeup Enable) register. Wakeup trigger condition then selected high transition. This done WKEDG register (Bit one.) device halted crystal oscillator used, Wakeup signal will start chip running immediately because finite start time requirement crystal oscillator. idle timer (T0) generates fixed (256 delay ensure that oscillator indeed stabilized before allowing device execute code. user consider this delay when data transfer expected immediately after exiting HALT mode. Comparators device contains differential comparators, each with pair inputs (positive negative) output. Ports I1-I3 I4-I6 used comparators. following Port assignment: Comparator1 Comparator1 Comparator1 Comparator2 negative input positive input output negative input Comparator2 positive input Comparator2 output Comparator Select Register (CMPSL) used enable comparators, read outputs comparators internally, enable outputs comparators pins. control bits (enable output enable) result www.national.com PrintDate=1997/07/03 PrintTime=15:36:48 9973 ds012829 Rev. Proof Comparators (Continued) Interrupts device supports vectored interrupt scheme. supports total fourteen interrupt sources. following table lists possible interrupt sources, their arbitration ranking memory locations reserved interrupt vector each source. bytes program memory space reserved each interrupt source. interrupt sources except software interrupt maskable. Each maskable interrupts have Enable more Pending bit. maskable interrupt active associated enable pending bits set. interrupt active, then processor will interrupted soon ready start executing instruction except above conditions happen during Software Trap service routine. This exception described Software Trap sub-section. interruption process accomplished with INTR instruction (opcode 00), which jammed inside Instruction Register replaces opcode about executed. following steps performed every interrupt: (Global Interrupt Enable) reset. address instruction about executed pushed into stack. (Program Counter) branches address 00FF. This procedure takes cycles execute. this time, since other maskable interrupts disabled. user free whatever context switching required saving context machine stack with PUSH instructions. user would then program (Vector Interrupt Select) instruction order branch interrupt service routine highest priority interrupt enabled pending time VIS. Note that this necessarily interrupt that caused branch address location 00FF prior context switching. Vector (Note Source Software Reserved External Timer Timer Timer Reserved UART UART Timer Timer Timer Timer Port L/Wakeup Default Receive Transmit T2A/Underflow T3A/Underflow Port Edge Reserved Underflow T1A/Underflow Description INTR Instruction Address Hi-Low Byte 0yFE-0yFF 0yFC-0yFD 0yFA-0yFB 0yF8-0yF9 0yF6-0yF7 0yF4-0yF5 0yF2-0yF3 0yF0-0yF1 0yEE-0yEF 0yEC-0yED 0yEA-0yEB 0yE8-0yE9 0yE6-0yE7 0yE4-0yE5 0yE2-0yE3 0yE0-0yE1 associated with each comparator. comparator result bits (CMP1RD CMP2RD) read only bits which will read zero associated comparator enabled. Comparator Select Register cleared with reset, resulting comparators being disabled. comparators should also disabled before entering either HALT IDLE modes order save power. configuration CMPSL register follows: CMPSL REGISTER (ADDRESS X'00B7) CMPSL register contains following bits: CMP1EN Enable comparator CMP1RD Comparator result (this read only bit, which will read comparator enabled) CMP10E Selects comparator output provided that CMPIEN enable comparator CMP2EN Enable comparator CMP2RD Comparator result (this read only bit, which will read comparator enabled) CMP20E Selects comparator output provided that CMP2EN enable comparator Unused CMP20E CMP2RD CMP2EN CMP10E CMP1RD CMP1EN Unused Note that unused bits CMPSL used software flags. Comparator outputs have same spec Ports except that rise fall times symmetrical. Arbitration Ranking Highest (10) (11) (12) (13) (14) (15) (16) Lowest MICROWIRE/PLUS BUSY Note variable which represents block. vector table must located same 256-byte block except located last address block. this case, table must next block. www.national.com PrintDate=1997/07/03 PrintTime=15:36:49 9973 ds012829 Rev. Proof Interrupts (Continued) Thus, interrupt with higher rank than which caused interruption becomes active before decision which interrupt service made VIS, then interrupt with higher rank will override lower ones will acknowledged. lower priority interrupt(s) still pending, however, will cause another interrupt immediately following completion interrupt service routine associated with higher priority interrupt just serviced. This lower priority interrupt will occur immediately following RETI (Return from Interrupt) instruction interrupt service routine just completed. Inside interrupt service routine, associated pending cleared software. RETI (Return from Interrupt) instruction interrupt service routine will (Global Interrupt Enable) bit, allowing processor interrupted again another interrupt active pending. instruction looks active interrupts time executed performs indirect jump beginning service routine with highest rank. addresses different interrupt service routines, called vectors, chosen user stored table starting 01E0 (assuming that located between 00FF 01DF). vectors 15-bit wide therefore occupy locations. vector table must located same 256byte block (0y00 0yFF) except located last address block. this case, table must next block. vector table cannot inserted first 256byte block vector maskable interrupt with lowest rank located 0yE0 (Hi-Order byte) 0yE1 (Lo-Order byte) forth increasing rank number. vector maskable interrupt with highest rank located 0yFA (Hi-Order byte) 0yFB (Lo-Order byte). Software Trap highest rank vector located 0yFE 0yFF. accident, gets executed interrupt active, then (Program Counter) will branch vector located 0yE0-0yE1. WARNING Default interrupt handler routine must present. minimum, this handler should confirm that cleared (this indicates that interrupt sequence been taken), take care required housekeeping, restore context return. Some sort Warm Restart procedure should implemented. These events occur without error part system designer programmer. Note: There always possibility interrupt occurring during instruction which attempting reset other interrupt enable bit. this occurs when single cycle instruction being used reset interrupt enable bit, interrupt enable will reset interrupt still occur. This because interrupt processing started same time interrupt being reset. avoid this scenario, user should always two, three, four cycle instruction reset interrupt enable bits. Figure shows Interrupt block diagram. SOFTWARE TRAP Software Trap (ST) special kind non-maskable interrupt which occurs when INTR instruction (used acknowledge interrupts) fetched from placed inside instruction register. This happen when pointing beyond available address space when stack over-popped. When occurs, user re-initialize stack pointer recovery procedure (similar reset, necessarily containing same initialization procedures) before restarting. occurrence latched into pending bit. affected pending (not accessible user) used inhibit other interrupts direct program service routine with instruction. RPND instruction used clear software interrupt pending bit. This pending also cleared reset. highest rank among interrupts. Nothing (except another interrupt being serviced. www.national.com PrintDate=1997/07/03 PrintTime=15:36:50 9973 ds012829 Rev. Proof Interrupts (Continued) DS012829-18 FIGURE Interrupt Block Diagram WATCHDOG device contains WATCHDOG clock monitor. WATCHDOG designed detect user program getting stuck infinite loops resulting loss program control "runaway" programs. Clock Monitor used detect absence clock very slow clock below specified rate pin. WATCHDOG consists independent logic blocks: UPPER LOWER. UPPER establishes upper limit service window LOWER defines lower limit service window. Servicing WATCHDOG consists writing specific value WATCHDOG Service Register named WDSVR which memory mapped RAM. This value composed three fields, consisting 2-bit Window Select, 5-bit Data field, 1-bit Clock Monitor Select field. Table shows WDSVR register. TABLE WATCHDOG Service Register (WDSVR) Window Select Data Clock Monitor TABLE WATCHDOG Service Window Select WDSVR WDSVR Service Window (Lower-Upper Limits) 2k-8k Cycles 2k-16k Cycles 2k-32k Cycles 2k-64k Cycles Clock Monitor Clock Monitor aboard device selected deselected under program control. Clock Monitor guaranteed reject clock instruction cycle clock greater equal kHz. This equates clock input rate greater equal kHz. WATCHDOG Operation WATCHDOG Clock Monitor disabled during reset. device comes reset with WATCHDOG armed, WATCHDOG Window Select bits (bits WDSVR Register) set, Clock Monitor (bit WDSVR Register) enabled. Thus, Clock Monitor error will occur after coming reset, instruction cycle clock frequency reached minimum specified value, including case where oscillator fails start. WDSVR register written only once after reset data (bits through WDSVR Register) must match valid write. This write WDSVR register involves irrevocable choices: selection WATCHDOG service window (ii) enabling disabling Clock Monitor. Hence, first write WDSVR Register involves selecting deselecting Clock Monitor, select WATCHDOG service window match WATCHDOG data. Subsequent writes WDSVR register will compare value being written user WATCH- lower limit service window fixed 2048 instruction cycles. Bits WDSVR register allow user pick upper limit service window. Table shows four possible combinations lower upper limits WATCHDOG service window. This flexibility choosing WATCHDOG service window prevents undue burden user software. Bits WDSVR register represent 5-bit Data field. data fixed 01100. WDSVR Register Clock Monitor Select bit. www.national.com PrintDate=1997/07/03 PrintTime=15:36:51 9973 ds012829 Rev. Proof WATCHDOG Operation (Continued) WATCHDOG detector circuit inhibited during both HALT IDLE modes. CLOCK MONITOR detector circuit active during both HALT IDLE modes. Consequently, device inadvertently entering HALT mode will detected CLOCK MONITOR error (provided that CLOCK MONITOR enable option been selected program). With single-pin oscillator mask option selected CLKDLY reset, WATCHDOG service window will resume following HALT mode from where left before entering HALT mode. With crystal oscillator mask option selected, with single-pin oscillator mask option selected CLKDLY set, WATCHDOG service window will selected value from WDSVR following HALT. Consequently, WATCHDOG should serviced least 2048 instruction cycles following HALT, must serviced within selected window avoid WATCHDOG error. IDLE timer initialized with RESET. user sync IDLE counter cycle with IDLE counter (T0) interrupt monitoring T0PND flag. T0PND flag whenever thirteenth IDLE counter toggles (every 4096 instruction cycles). user responsible resetting T0PND flag. hardware WATCHDOG service occurs just device exits IDLE mode. Consequently, WATCHDOG should serviced least 2048 instruction cycles following IDLE, must serviced within selected window avoid WATCHDOG error. Following RESET, initial WATCHDOG service (where service window CLOCK MONITOR enable/ disable must selected) programmed anywhere within maximum service window (65,536 instruction cycles) initialized RESET. Note that this initial WATCHDOG service programmed within initial 2048 instruction cycles without causing WATCHDOG error. service window value data (bits through WDSVR Register. Table shows sequence events that occur. user must service WATCHDOG least once before upper limit service window expires. WATCHDOG serviced more than once every lower limit service window. user service WATCHDOG many times wished time period between lower upper limits service window. first write WDSVR Register also counted WATCHDOG service. WATCHDOG output associated with This WDOUT pin, port WDOUT active low. WDOUT high impedance state inactive state. Upon triggering WATCHDOG, logic will pull WDOUT (G1) additional tc-32 cycles after signal level WDOUT goes below lower Schmitt trigger threshold. After this delay, device will stop forcing WDOUT output low. WATCHDOG service window will restart when WDOUT goes high. recommended that user WDOUT back through resistor order pull WDOUT high. WATCHDOG service while WDOUT signal active will ignored. state WDOUT guaranteed reset, powers then WATCHDOG will time WDOUT will enter high impedance state. Clock Monitor forces upon detecting clock frequency error. Clock Monitor error will continue until clock frequency reached minimum specified value, after which output will enter high impedance TRI-STATE mode following tc-32 clock cycles. Clock Monitor generates continual Clock Monitor error oscillator fails start, fails reach minimum specified frequency. specification Clock Monitor follows: 1/tc kHz-No clock rejection. 1/tc Hz-Guaranteed clock rejection. WATCHDOG CLOCK MONITOR SUMMARY following salient points regarding WATCHDOG CLOCK MONITOR should noted: Both WATCHDOG CLOCK MONITOR detector circuits inhibited during RESET. Detection Illegal Conditions device detect various illegal conditions resulting from coding errors, transient noise, power supply voltage drops, runaway programs, etc. Reading undefined gets zeros. opcode software interrupt zero. program fetches instructions from undefined ROM, this will force software interrupt, thus signaling that illegal condition occurred. subroutine stack grows down each call (jump subroutine), interrupt, PUSH, grows each return POP. stack pointer initialized location during reset. Consequently, there more returns than calls, stack pointer will point addresses (which undefined RAM). Undefined from addresses (Segment other segments (i.e., Segments etc.) read 1's, which turn will cause program return address 7FFF Hex. This undefined location instruction fetched (all 0's) from this location will generate software interrupt signaling illegal condition. Thus, chip detect following illegal conditions: Executing from undefined Following RESET, WATCHDOG CLOCK MONITOR both enabled, with WATCHDOG having maximum service window selected. WATCHDOG service window CLOCK MONITOR enable/disable option only changed once, during initial WATCHDOG service following RESET. initial WATCHDOG service must match data value WATCHDOG Service register WDSVR order avoid WATCHDOG error. Subsequent WATCHDOG services must match three data fields WDSVR order avoid WATCHDOG errors. correct data value cannot read from WATCHDOG Service register WDSVR. attempt read this data value 01100 from WDSVR will read data value 0's. www.national.com PrintDate=1997/07/03 PrintTime=15:36:52 9973 ds012829 Rev. Proof Detection Illegal Conditions (Continued) Over "POP"ing stack having more returns than calls. When software interrupt occurs, user re-initialize stack pointer recovery procedure before restarting (this recovery program probably similar that following reset, might contain same program initialization procedures). recovery program should reset software interrupt pending using RPND instruction. MICROWIRE/PLUS MICROWIRE/PLUS serial synchronous communications interface. MICROWIRE/PLUS capability enables device interface with National Semiconductor's MICROWIRE peripherals (i.e. converters, display drivers, E2PROMs etc.) with other microcontrollers which support MICROWIRE interface. consists 8-bit serial shift register (SIO) with serial data input (SI), serial data output (SO) serial shift clock (SK). Figure shows block diagram MICROWIRE/PLUS logic. DS012829-19 FIGURE MICROWIRE/PLUS Block Diagram shift clock selected from either internal source external source. Operating MICROWIRE/PLUS arrangement with internal clock source called Master mode operation. Similarly, operating MICROWIRE/ PLUS arrangement with external shift clock called Slave mode operation. CNTRL register used configure control MICROWIRE/PLUS mode. MICROWIRE/PLUS, MSEL CNTRL register one. master mode, clock rate selected bits, SL1, CNTRL register. Table details different clock rates that selected. TABLE WATCHDOG Service Actions Data Match Don't Care Mismatch Don't Care Window Data Match Mismatch Don't Care Don't Care Clock Monitor Match Don't Care Don't Care Mismatch Valid Service: Restart Service Window Error: Generate WATCHDOG Output Error: Generate WATCHDOG Output Error: Generate WATCHDOG Output Action TABLE MICROWIRE/PLUS Master Mode Clock Select MICROWIRE/PLUS OPERATION Setting BUSY register causes MICROWIRE/PLUS start shifting data. gets reset when eight data bits have been shifted. user reset BUSY software allow less than bits shift. enabled, interrupt generated when eight data bits have been shifted. device enter MICROWIRE/PLUS mode either Master Slave. Figure shows microcontroller devices several peripherals interconnected using MICROWIRE/PLUS arrangements. Warning: register should only loaded when clock low. Loading register while clock high will result undefined data register. clock normally when shifting. Setting BUSY flag when input clock high MICROWIRE/PLUS slave mode cause current clock shift register narrow. safety, BUSY flag should only when input clock low. Where instruction cycle clock www.national.com PrintDate=1997/07/03 PrintTime=15:36:53 9973 ds012829 Rev. Proof MICROWIRE/PLUS (Continued) MICROWIRE/PLUS Master Mode Operation MICROWIRE/PLUS Master mode operation shift clock (SK) generated internally device. MICROWIRE Master always initiates data exchanges. MSEL CNTRL register must enable functions onto Port. pins must also selected outputs setting appropriate bits Port configuration register. Table summarizes settings required Master mode operation. MICROWIRE/PLUS Slave Mode Operation MICROWIRE/PLUS Slave mode operation clock generated external source. Setting MSEL CNTRL register enables functions onto Port. must selected input selected output setting resetting appropriate bits Port configuration register. Table summarizes settings required enter Slave mode operation. user must BUSY flag immediately upon entering Slave mode. This will ensure that data bits sent Master will shifted properly. After eight clock pulses BUSY flag will cleared sequence repeated. Alternate Phase Operation device allows either normal clock alternate phase clock shift data register. both modes normally low. normal mode data shifted rising edge clock data shifted falling edge clock. register shifted each falling edge clock. alternate phase operation, data shifted falling edge clock shifted rising edge clock. control flag, SKSEL, allows either normal clock alternate clock selected. Resetting SKSEL causes MICROWIRE/PLUS logic clocked from normal signal. Setting SKSEL flag selects alternate clock. SKSEL mapped into configuration bit. SKSEL flag will power reset condition, selecting normal signal. TABLE This table assumes that control flag MSEL set. (SO) (SK) TRISTATE TRISTATE Int. Int. Ext. Ext. Operation MICROWIRE/PLUS Master MICROWIRE/PLUS Master MICROWIRE/PLUS Slave MICROWIRE/PLUS Slave Config. BitConfig. Fun. Fun. DS012829-20 FIGURE MICROWIRE/PLUS Application Memory RAM, ports registers (except mapped into data memory address space. Address S/ADD 0000 006F On-Chip bytes (112 bytes) Contents Address S/ADD 0070 007F Unused Address Space (Reads Ones) Contents www.national.com PrintDate=1997/07/03 PrintTime=15:36:55 9973 ds012829 Rev. Proof Memory Address S/ADD xx80 xxAF xxB0 XXB1 xxB2 xxB3 xxB4 xxB5 xxB6 xxB7 xxB8 xxB9 xxBA xxBB xxBC xxBD xxBE xxBF xxC0 xxC1 xxC2 xxC3 xxC4 xxC5 xxC6 xxC7 xxC8 xxC9 xxCA xxCB xxCC xxCD xxCF (Continued) Contents Address S/ADD xxD0 Contents Port Data Register Port Configuration Register Port Input Pins (Read Only) Reserved Port Port Data Register Port Configuration Register Port Input Pins (Read Only) Port Input Pins (Read Only) Port Data Register Port Configuration Register Port Input Pins (Read Only) Reserved Port Port Reserved Port Reserved Control Registers Timer Autoload Register T1RB Lower Byte Timer Autoload Register T1RB Upper Byte ICNTRL Register MICROWIRE/PLUS Shift Register Timer Lower Byte Timer Upper Byte Timer Autoload Register T1RA Lower Byte Timer Autoload Register T1RA Upper Byte CNTRL Control Register Register On-Chip Mapped Registers Register Register Register Register On-Chip Bytes On-Chip Bytes On-Chip Bytes On-Chip Bytes On-Chip Bytes On-Chip Bytes On-Chip Bytes On-Chip Bytes Unused Address Space (Reads Undefined Data) Timer Lower Byte Timer Upper Byte Timer Autoload Register T3RA Lower Byte Timer Autoload Register T3RA Upper Byte Timer Autoload Register T3RB Lower Byte Timer Autoload Register T3RB Upper Byte Timer Control Register Comparator Select Register (CMPSL) UART Transmit Buffer (TBUF) UART Receive Buffer (RBUF) UART Control Status Register (ENU) UART Receive Control Status Register (ENUR) UART Interrupt Clock Source Register (ENUI) UART Baud Register (BAUD) UART Prescale Select Register (PSR) Reserved UART Timer Lower Byte Timer Upper Byte Timer Autoload Register T2RA Lower Byte Timer Autoload Register T2RA Upper Byte Timer Autoload Register T2RB Lower Byte Timer Autoload Register T2RB Upper Byte Timer Control Register WATCHDOG Service Register (Reg:WDSVR) MIWU Edge Select Register (Reg:WKEDG) MIWU Enable Register (Reg:WKEN) MIWU Pending Register (Reg:WKPND) Reserved Reserved Reserved xxD1 xxD2 xxD3 xxD4 xxD5 xxD6 xxD7 xxD8 xxD9 xxDA xxDB xxDC xxDD xxDF xxE0 xxE5 xxE6 xxE7 xxE8 xxE9 xxEA xxEB xxEC xxED xxEE xxEF xxF0 xxFC xxFD xxFE xxFF 0100-017F 0200-027F 0300-037F 0400-047F 0500-057F 0600-067F 0700-077F 0800-083F Note: Reading memory locations 0070H-007FH (Segment will return ones. Reading unused memory locations 0080H-00AFH (Segment will return undefined data. Reading memory locations from other Segments (i.e., Segment (084H-087FH), Segment etc.) will return ones. www.national.com PrintDate=1997/07/03 PrintTime=15:36:56 9973 ds012829 Rev. Proof Addressing Modes There addressing modes, operand addressing four transfer control. OPERAND ADDRESSING MODES Register Indirect This "normal" addressing mode. operand data memory addressed pointer pointer. Register Indirect (with auto post increment decrement pointer) This addressing mode used with instructions. operand data memory addressed pointer pointer. This register indirect mode that automatically post increments decrements register after executing instruction. Direct instruction contains 8-bit address field that directly points data memory operand. Immediate instruction contains 8-bit immediate field operand. Short Immediate This addressing mode used with Load Immediate instruction. instruction contains 4-bit immediate field operand. Indirect This addressing mode used with LAID instruction. contents accumulator used partial address (lower bits accessing data operand from program memory. TRANSFER CONTROL ADDRESSING MODES Relative This mode used instruction, with instruction field being added program counter program location. range from allow 1-byte relative jump implemented instruction). There "pages" when using since bits used. Absolute This mode used with instructions, with instruction field bits replacing lower bits program counter (PC). This allows jumping location current program memory segment. Absolute Long This mode used with JMPL JSRL instructions, with instruction field bits replacing entire bits program counter (PC). This allows jumping location program memory space. Indirect This mode used with instruction. contents accumulator used partial address (lower bits accessing location program memory. contents this program memory location serve partial address (lower bits jump next instruction. Note: special case Indirect Transfer Control addressing mode, where double byte vector associated with interrupt transferred from adjacent addresses program memory into program counter (PC) order jump associated interrupt service routine. Instruction Register Symbol Definition Registers 8-Bit Accumulator Register 8-Bit Address Register 8-Bit Address Register 8-Bit Segment Register 8-Bit Stack Pointer Register 15-Bit Program Counter Register Upper Bits Lower Bits Register Carry Register Half Carry Register Global Interrupt Enable Interrupt Vector Upper Byte Interrupt Vector Lower Byte Symbols Memory Indirectly Addressed Register Memory Indirectly Addressed Register Meml Direct Addressed Memory Direct Addressed Memory Direct Addressed Memory Immediate Data 8-Bit Immediate Data Register Memory: Addresses (Includes Number Loaded with Exchanged with Instruction A,Meml A,Meml with Carry Meml Meml CCarry www.national.com PrintDate=1997/07/03 PrintTime=15:36:57 9973 ds012829 Rev. Proof Instruction Instruction SUBC ANDSZ IFEQ IFEQ IFNE IFGT IFBNE DRSZ SBIT RBIT IFBIT RPND LAID DCOR SWAP IFNC PUSH JMPL Addr. Addr. Disp. A,Mem A,Meml B,Imm Mem,Imm Reg,Imm ,Imm A,Meml A,Meml A,Imm A,Meml A,Meml MD,Imm A,Meml A,Meml A,Meml #,Mem #,Mem #,Mem (Continued) (Continued) Half Carry MemI CCarry Half Carry Meml Skip next Imm) Meml Meml Compare Imm, next Compare Meml, next Meml Compare Meml, next Meml Compare Meml, next Meml next lower bits RegReg Skip bit, (bit immediate) bit, true next instruction Reset Software Interrupt Pending Flag AMem AMeml BImm RegImm Imm, AROM (PU,A) correction (follows ADC, SUBC) CA7.A0C CA7.A0C A7.A4A3.A0 true, next instruction true, next instruction SPSP SPSP bits, 32k) PC9.0i bits) +32, except Subtract with Carry Logical Logical Immed., Skip Zero Logical Logical EXclusive EQual EQual Equal Greater Than Equal Decrement Reg., Skip Zero Reset Reset PeNDing Flag EXchange with Memory EXchange with Memory LoaD with Memory LoaD with Memory LoaD with Immed. LoaD Memory Immed LoaD Register Memory Immed. EXchange with Memory EXchange with Memory LoaD with Memory LoaD with Memory LoaD Memory Immed. CLeaR INCrement DECrement Load InDirect from Decimal CORrect Rotate Right thru Rotate Left thru SWAP nibbles Reset stack into PUSH onto stack Vector Interrupt Service Routine Jump absolute Long Jump absolute Jump relative short www.national.com PrintDate=1997/07/03 PrintTime=15:36:58 9973 ds012829 Rev. Proof Instruction Instruction JSRL RETSK RETI INTR Addr. Addr (Continued) (Continued) PU,SP-2, PCii PU,SP-2, PC9.0i PLROM (PU,A) PL,PU skip next instruction ,GIE SP-2, PC0FF Jump SubRoutine Long Jump SubRoutine Jump InDirect RETurn from subroutine RETurn SKip RETurn from Interrupt Generate Interrupt OPeration Instruction Execution Time Most instructions single byte (with immediate addressing mode instructions taking bytes). Most single byte instructions take cycle time execute. Skipped instructions require number cycles skipped, where equals number bytes skipped instruction opcode. www.national.com PrintDate=1997/07/03 PrintTime=15:36:59 9973 ds012829 Rev. Proof Instruction Execution Time Bytes Cycles Instruction (Continued) following table shows number bytes cycles each instruction format byte/cycle. Arithmetic Logic Instructions Direct SUBC IFEQ IFNE IFGT IFBNE DRSZ SBIT RBIT IFBIT RPND Immed. Instructions Using CLRA INCA DECA LAID DCOR RRCA RLCA SWAPA IFNC PUSHA POPA ANDSZ Transfer Control Instructions JMPL JSRL RETSK RETI INTR Memory Transfer Instructions Register Indirect Direct Immed. Register Indirect Auto Incr. Decr. (Note (Note Mem, Reg, IFEQ Note Memory location addressed directly. www.national.com PrintDate=1997/07/03 PrintTime=15:37:00 9973 ds012829 Rev. Proof Opcode Table Upper Nibble 0F0, 0F1, 0F2, 0F3, 0F4, 0F5, 0F6, 0F7, 0F8, 0F9, DRSZ DRSZ DRSZ DRSZ DRSZ DRSZ DRSZ B,#i RETI JSRL A,Md RETSK SBIT SBIT SBIT Md,#i JMPL A,Md POPA SBIT RBIT RBIT RBIT RBIT DECA SBIT RBIT INCA SBIT RBIT B,#05 B,#04 B,#03 B,#02 B,#01 B,#00 IFNE IFEQ Md,#i IFNE A,#i IFNC SBIT RBIT B,#06 DRSZ RLCA A,#i SBIT RBIT B,#07 IFBNE IFBNE IFBNE IFBNE IFBNE IFBNE IFBNE IFBNE DRSZ A,#i IFBIT PUSHA B,#08 IFBNE DRSZ A,#i IFBIT DCORA B,#09 IFBNE DRSZ RPND A,#i IFBIT SWAPA B,#0A IFBNE DRSZ LAID A,#i IFBIT CLRA B,#0B IFBNE DRSZ IFGT A,#i IFGT IFBIT B,#0C IFBNE JP+20 x300-x3FF x300-x3FF JP+21 x400-x4FF x400-x4FF JP+22 x500-x5FF x500-x5FF JP+23 x600-x6FF x600-x6FF JP+24 x700-x7FF x700-x7FF JP+25 x800-x8FF x800-x8FF DRSZ IFEQ A,#i IFEQ IFBIT B,#0D IFBNE JP+19 x200-x2FF x200-x2FF JP+3 JP+4 JP+5 JP+6 JP+7 JP+8 JP+9 DRSZ SUBC SUBC IFBIT B,#0E IFBNE JP+18 x100-x1FF x100-x1FF JP+2 JP+26 JP+10 x900-x9FF x900-x9FF JP+27 JP+11 xA00-xAFF xA00-xAFF JP+28 JP+12 xB00-xBFF xB00-xBFF JP+29 JP+13 xC00-xCFF xC00-xCFF JP+30 JP+14 xD00-xDFF xD00-xDFF JP+31 JP+15 xE00-xEFF xE00-xEFF JP+32 JP+16 xF00-xFFF xF00-xFFF DRSZ RRCA A,#i IFBIT ANDSZ B,#0F IFBNE JP+17 INTR x000-x0FF x000-x0FF www.national.com JP-15 JP-31 JP-14 JP-30 JP-13 JP-29 JP-12 JP-28 Instruction Execution Time JP-11 JP-27 JP-10 JP-26 (Continued) JP-9 JP-25 JP-5 JP-21 0FA, JP-4 JP-20 0FB, JP-3 JP-19 0FC, JP-2 JP-18 0FD, JP-1 0FF, JP-17 0FE, JP-0 JP-16 Where, immediate data directly addressed memory location unused opcode opcode also opcode IFBIT #i,A Lower Nibble PrintDate=1997/07/03 PrintTime=15:37:02 9973 ds012829 Rev. JP-8 JP-24 JP-7 JP-23 Proof JP-6 JP-22 Mask Options mask programmable options shown below. options programmed same time pattern submission. OPTION CLOCK CONFIGURATION Crystal Oscillator (CKI/10) (CKO) clock generator output crystal/ resonator with being clock input Single-pin controlled oscillator (CKI/10) available HALT restart and/or general purpose input OPTION HALT Enable HALT mode Disable HALT mode chip driven clock input input which between MHz. output clock clock option=1 been selected). input frequency divided down produce instruction cycle clock (1/tc). Development Support Summary iceMASTERTM: IM-COP8/400-Full feature in-circuit emulation COP8 products. full COP8 Basic Feature Family device package specific probes available. COP8 Debug Module: Moderate cost in-circuit emulation development programming unit. COP8 Evaluation Programming Unit: EPUCOP888GG-low cost In-circuit simulation development programming unit. Assembler: COP8-DEV-IBMA. installable cross development Assembler, Linker, Librarian Utility Software Development Tool Kit. Compiler: COP8C. installable cross development Software Tool Kit. OTP/EPROM Programmer Support: Covering needs from engineering prototype, pilot production full production environments. IceMASTER (IM) IN-CIRCUIT EMULATION iceMASTER IM-COP8/400 full feature, based, in-circuit emulation tool developed marketed MetaLink Corporation support whole COP8 family products. National resale vendor these products. Figure configuration. iceMASTER IM-COP8/400 with device specific COP8 Probe provides rich feature developing, testing maintaining product: Real-time in-circuit emulation; full 2.4V-5.5V operation range, full DC-10 clock. Chip options programmable jumper selectable. Direct connection application board package compatible socket surface mount assembly. Full kbytes loadable programming space that overlays (replaces) on-chip EPROM. On-chip blocks used directly recreated probe necessary. Full frame synchronous trace memory. Address, instruction, unspecified, circuit connectable trace lines. Display source (e.g., source), assembly mixed. full hardware configurable break, trace trace control, pass count increment events. integrated interactive symbolic Tool debugger-supports both assembler (COFF) Compiler (.COD) linked object formats. Real time peformance profiling analysis; selectable bucket definition. Watch windows, content updated automatically each execution break. Instruction instruction memory/register changes displayed source window when single step operation. Single base unit debugger software reconfigurable support entire COP8 family; only probe personality needs change. Debugger software processor customized, reconfigured from master model file. Processor specific symbolic display registers level assignments, configured from master model file. Halt/Idle mode notification. On-line HELP customized specific processor using master model file. Includes copy COP8-DEV-IBMA assembler linker SDK. Order Information Base Unit IM-COP8/400-1 IM-COP8/400-2 iceMASTER Probe MHW-888GG40DWPC MHW-888GG44PWPC PLCC iceMASTER base unit, 110V power supply iceMASTER base unit, 220V power supply www.national.com PrintDate=1997/07/03 PrintTime=15:37:04 9973 ds012829 Rev. Proof Development Support (Continued) DS012829-21 FIGURE COP8 iceMASTER Environment IceMASTER DEBUG MODULE (DM) iceMASTER Debug Module based, combination in-circuit emulation tool COP8 based OTP/EPROM programming tool developed marketed MetaLink Corporation support whole COP8 family products. National resale vendor these products. Figure configuration. iceMASTER Debug Module moderate cost development tool. capability in-circuit emulation specific COP8 microcontroller addition serves programming tool COP8 EPROM product families. Summary features follows: Instruction instruction memory/register changes displayed when single step operation. Debugger software processor customized, reconfigured from master model file. Processor specific symbolic display registers level assignments, configured from master model file. Halt/Idle mode notification. Programming menu supports full product line programmable EPROM COP8 products. Program data taken directly from overlay RAM. Programming PLCC PLCC parts requires external programming adapters. Includes wall mount power supply On-board generator from input connection external supply supported. Requires level adjustment family programming specification (correct level provided on-screen pop-down display). On-line HELP customized specific processor using master model file. Includes copy COP8-DEV-IBMA assembler linker SDK. Real-time in-circuit emulation; full operating voltage range operation, full DC-10 clock. processor pins cabled application development board with package compatible cable socket surface mount assembly. Full kbytes loadable programming space that overlays (replaces) on-chip EPROM. On-chip blocks used directly recreated necessary. frames synchronous trace memory. display source source), assembly mixed. most recent history prior break available trace memory. Configured break points; uses INTR instruction which modestly intrusive. Software-only supported features selectable. Tool integrated interactive symbolic debugger-supports both Assembler (COFF) Compiler (.COD) linked object formats. Order Information Debug Module Unit COP8-DM/888GG Cable Adapters DM-COP8/40D DM-COP8/44P PLCC www.national.com PrintDate=1997/07/03 PrintTime=15:37:05 9973 ds012829 Rev. Proof Development Support (Continued) DS012829-22 FIGURE COP8-DM Environment COP8 ASSEMBLER/LINKER SOFTWARE DEVELOPMENT TOOL National Semiconductor offers relocateable COP8 macro cross assembler, linker, librarian utility software development tool kit. Features summarized follows: Basic Feature Family instruction "device" type. Nested macro capability. Extensive assembler directives. Supported PC/DOS platform. Generates National standard COFF output files. Integrated Linker Librarian. Integrated utilities generate code file outputs. DUMPCOFF utility. This product integrated part MetaLink tools development kit, fully supported MetaLink debugger. ordered separately bundled with MetaLink products additional cost. Order-Information Assembler SDK: COP8-DEV-IBMA Assembler installable 3.5" PC/DOS Floppy Disk Drive format. Periodic upgrades most recent version available National's Internet. COP8 COMPILER Compiler developed marketed Byte Craft Limited. COP8C compiler fully integrated development tool specifically designed support compact embedded configuration COP8 family products. Features summarized follows: ANSI wrth some restrictions extensions that optimize development COP8 embedded application. language support interrupt routines. Expert system, rule based code generation optimization. Performs consistency checks against architectural definitions target COP8 device. Generates program memory code. Supports linking compiled object COP8 assembled object formats. Global optimization linked code. Symbolic debug load format fully source level supported MetaLink debugger. SINGLE CHIP OTP/EMULATOR SUPPORT COP8 family supported single chip emulators. detailed information refer emulator specific datasheet emulator selection table below: Emulator Ordering Information Device Number Clock Option COP87L88RGV-XE Crystal/ HALT COP87L88RGN-XE rystal/ HALT INDUSTRY WIDE OTP/EPROM PROGRAMMING SUPPORT Programming support, addition MetaLink development tools, provided full range independent approved vendors meet needs from engineering laboratory full production. COP888KG PLCC COP888KG Package Emulates BITS data type extension. Register declaration #pragma with direct level definitions. www.national.com PrintDate=1997/07/03 PrintTime=15:37:07 9973 ds012829 Rev. Proof Development Support Approved List Manufacturer Microsystems Data (Continued) North America (800) 225-2102 (713) 688-4600 Fax: (713) 688-0920 (800) 426-1045 (206) 881-6444 Fax: (206) 882-1043 Europe +49-8152-4183 +49-8856-932616 +44-0734-440011 Asia +852-234-16611 +852-2710-8121 Call North America HI-LO Technology MetaLink (510) 623-8860 (800) 624-8949 (919) 430-7915 (800) 638-2423 (602) 926-0797 Fax: (602) 693-0681 Call Asia +44-1226-767404 Fax: 0-1226-370-434 +49-80 9156 96-0 Fax: 49-80 9123 +41-1-9450300 +886-2-764-0215 Fax: +886-2-756-6403 +852-737-1800 Systems General Needhams (408) 263-6667 (916) 924-8037 Fax: (916) 924-8065 +886-2-917-3005 Fax: +886-2-911-1283 AVAILABLE LITERATURE more information, please COP8 Basic Family User's Manual, Literature Number 620895, COP8 Feature Family User's Manual Literature Number 620897 National's Family 8-bit Microcontrollers COP8 Selection Guide, Literature Number 630006. DIAL-A-HELPER Dial-A-Helper service provided Microcontroller Applications group. Dial-A-Helper Electronic Information System that accessed Bulletin Board System (BBS) data modem, site Internet standard client application site Internet using standard Internet browser such Netscape Mosaic. Dial-A-Helper system provides access automated information storage retrieval system. system capabilities include MESSAGE SECTION (electronic mail, when accessed BBS) communication from Microcontroller Applications Group FILE SECTION which consists several file areas where valuable application software utilities could found. DIAL-A-HELPER Standard Modem Modem: CANADA/U.S.: (800) NSC-MICRO (800) 672-6427 EUROPE: Baud: Set-up: (+49) 0-8141-351332 14.4k Length: 8-Bit Parity: Stop Bit: Operation: None DIAL-A-HELPER nscmicro.nsc.com user:anonymous DIAL-A-HELPER WorldWide Browser ftp://nscmicro.nsc.com National Semiconductor WorldWide WorldWide http://www.national.com CUSTOMER RESPONSE CENTER Complete product information technical support available from National's customer response centers. CANADA/US: Tel: email: EUROPE: email: Deutsch Tel: English Tel: JAPAN: S.E. ASIA: Tel: Beijing Tel: Shanghai Tel: Hong Kong Tel: Korea Tel: Malaysia Tel: (800) 272-9959 support tevm2.nsc.com europe.supportnsc.com 180-530 180-532 +81-043-299-2309 (+86) 10-6856-8601 (+86) 21-6415-4092 (+852) 2737-1600 (+82) 2-3771-6909 (+60-4) 644-9061 Hrs., Days www.national.com PrintDate=1997/07/03 PrintTime=15:37:07 9973 ds012829 Rev. Proof Development Support Singapore Tel: Taiwan Tel: (Continued) AUSTRALIA: Tel: INDIA: Tel: (+61) 3-9558-9999 (+91) 80-559-9467 Book Extract (+65) 255-2226 +886-2-521-3288 www.national.com PrintDate=1997/07/03 PrintTime=15:37:08 9973 ds012829 Rev. Proof THIS PAGE IGNORED DATABOOK PrintDate=1997/07/03 PrintTime=15:37:08 9973 ds012829 Rev. Proof Physical Dimensions inches (millimeters) unless otherwise noted Molded Dual-In-Line Package Order Number COP688KG-XXX/N, COP888KG-XXX/N Package Number N40A Plastic Leaded Chip Carrier Order Number COP688KG-XXXV, COP888KG-XXX/V Package Number V44A www.national.com PrintDate=1997/07/03 PrintTime=15:37:08 9973 ds012829 Rev. Proof COP688KG/COP888KG 8-Bit Microcontroller with UART Three Multi-Function Timers LIFE SUPPORT POLICY NATIONAL'S PRODUCTS AUTHORIZED CRITICAL COMPONENTS LIFE SUPPORT DEVICES SYSTEMS WITHOUT EXPRESS WRITTEN APPROVAL PRESIDENT NATIONAL SEMICONDUCTOR CORPORATION. used herein: critical component component life support Life support devices systems devices sysdevice system whose failure perform reatems which, intended surgical implant into sonably expected cause failure life support body, support sustain life, whose faildevice system, affect safety effectiveness. perform when properly used accordance with instructions provided labeling, reasonably expected result significant injury user. National Semiconductor Corporation Americas Tel: 1-800-272-9959 Fax: 1-800-737-7018 Email: support@nsc.com National Semiconductor Europe Fax: 80-530 Email: europe.support@nsc.com Deutsch Tel: 80-530 English Tel: 80-532 Tel: 80-532 Italiano Tel: 80-534 National Semiconductor Hong Kong Ltd. 13th Floor, Straight Block, Ocean Centre, Canton Tsimshatsui, Kowloon Hong Kong Tel: (852) 2737-1600 Fax: (852) 2736-9960 National Semiconductor Japan Ltd. Tel: 81-3-5620-6175 Fax: 81-3-5620-6179 www.national.com National does assume responsibility circuitry described, circuit patent licenses implied National reserves right time without notice change said circuitry specifications. PrintDate=1997/07/03 PrintTime=15:37:09 9973 ds012829 Rev. Proof Other recent searchesSTK14EE16 - STK14EE16 STK14EE16 Datasheet PHD5N20E - PHD5N20E PHD5N20E Datasheet PD6729 - PD6729 PD6729 Datasheet MRFIC1808 - MRFIC1808 MRFIC1808 Datasheet MRFIC1808DM - MRFIC1808DM MRFIC1808DM Datasheet MF1114-02 - MF1114-02 MF1114-02 Datasheet IDT74ALVCH16374 - IDT74ALVCH16374 IDT74ALVCH16374 Datasheet BUL310FP - BUL310FP BUL310FP Datasheet
Privacy Policy | Disclaimer |