0
登录后你可以
  • 下载海量资料
  • 学习在线课程
  • 观看技术视频
  • 写文章/发帖/加入社区
会员中心
创作中心
发布
  • 发文章

  • 发资料

  • 发帖

  • 提问

  • 发视频

创作活动
ATAR862M-XXXR4-TNQ

ATAR862M-XXXR4-TNQ

  • 厂商:

    ATMEL(爱特梅尔)

  • 封装:

  • 描述:

    ATAR862M-XXXR4-TNQ - Microcontroller with UHF ASK/FSK Transmitter - ATMEL Corporation

  • 数据手册
  • 价格&库存
ATAR862M-XXXR4-TNQ 数据手册
Features • • • • • • • • Single Package Fully-integrated ROM Mask 4-bit Microcontroller with RF Transmitter Low Power Consumption in Sleep Mode (< 1 µA Typically) Maximum Output Power (10 dBm) with Low Supply Current (9.5 mA Typically) 2.0 V to 4.0 V Operation Voltage for Single Li-cell Power Supply -40°C to +125°C Operation Temperature SSO24 Package About Seven External Components Flash Controller for Application Program Available Description The ATAR862-8 is a single package triple-chip circuit. It combines a UHF ASK/FSK transmitter with a 4-bit microcontroller and a 512-bit EEPROM. It supports highly integrated solutions in car access and tire pressure monitoring applications, as well as manifold applications in the industrial and consumer segment. It is available for the frequency range of 429 MHz to 439 MHz with data rates up to 32 kbaud. For further frequency ranges such as 310 MHz to 330 MHz and 868 MHz to 928 MHz separate data sheets are available. The device contains a ROM mask version microcontroller and an additional data EEPROM. Microcontroller with UHF ASK/FSK Transmitter ATAR862-8 Preliminary Figure 1. Application Diagram ATAR862-8 Antenna Keys Microcontroller PLLTransmitter UHF ASK/FSK Receiver Microcontroller Rev. 4589B–4BMCU–02/03 1 Pin Configuration Figure 2. Pinning SSO24 XTAL VS GND ENABLE NRESET BP63/T3I BP20/NTE BP23 BP41/T2I/VMI BP42/T2O BP43/SD/INT3 VSS 1 2 3 4 5 6 7 8 9 10 11 12 24 23 22 21 20 19 18 17 16 15 14 13 ANT1 ANT2 PA_ENABLE CLK BP60/T3O OSC2 OSC1 BP50/INT6 BP52/INT1 BP53/INT1 BP40/SC/INT3 VDD Pin Description: RF Part Pin 1 Symbol CLK Function Clock output signal for microcontroller The clock output frequency is set by the crystal to fXTAL/4 Configuration VS 100 100 CLK 2 PA_ENABLE Switches on power amplifier, used for ASK modulation PA_ENABLE 50k Uref=1.1V 20 µA 3 4 ANT2 ANT1 Emitter of antenna output stage Open collector antenna output ANT1 ANT2 2 ATAR862-8 4589B–4BMCU–02/03 ATAR862-8 Pin Description: RF Part (Continued) Pin 5 Symbol XTAL Function Connection for crystal Configuration VS 1.5k 1.2k VS XTAL 182 mA 6 7 8 VS GND ENABLE Supply voltage Ground Enable input ESD protection circuitry (see Figure 8) ESD protection circuitry (see Figure 8) ENABLE 200k Pin Description: Microcontroller Part Name VDD VSS BP20 BP40 BP41 BP42 BP43 BP50 BP52 BP53 BP60 BP63 OSC1 OSC2 NRESET Type – – I/O I/O I/O I/O I/O I/O I/O I/O I/O I/O I O I/O Function Supply voltage Circuit ground Bi-directional I/O line of Port 2.0 Bi-directional I/O line of Port 4.0 Bi-directional I/O line of Port 4.1 Bi-directional I/O line of Port 4.2 Bi-directional I/O line of Port 4.3 Bi-directional I/O line of Port 5.0 Bi-directional I/O line of Port 5.2 Bi-directional I/O line of Port 5.3 Bi-directional I/O line of Port 6.0 Bi-directional I/O line of Port 6.3 Oscillator input Oscillator output Bi-directional reset pin Alternate Function – – NTE-test mode enable, see also section "Master Reset" SC-serial clock or INT3 external interrupt input VMI voltage monitor input or T2I external clock input Timer 2 T2O Timer 2 output SD serial data I/O or INT3-external interrupt input INT6 external interrupt input INT1 external interrupt input INT1 external interrupt input T3O Timer 3 output T3I Timer 3 input 4-MHz crystal input or 32-kHz crystal input or external clock input or external trimming resistor input 4-MHz crystal output or 32-kHz crystal output or external clock input – Pin-No. 13 12 7 14 9 10 11 17 16 15 20 6 18 19 5 Reset State NA NA Input Input Input Input Input Input Input Input Input Input Input Input I/O 3 4589B–4BMCU–02/03 UHF ASK/FSK Transmitter Block Features • • • • • • • • • • • Integrated PLL Loop Filter ESD Protection (4 kV HBM/200 V MM, Except Pin 2: 4 kV HBM/100 V MM) also at ANT1/ANT2 High Output Power (5.5 dBm) with Low Supply Current (8.5 mA Typically) Modulation Scheme ASK/FSK – FSK Modulation is Achieved by Connecting an Additional Capacitor between the XTAL Load Capacitor and the Opendrain Output of the Modulating Microcontroller Easy to Design-in Due to Excellent Isolation of the PLL from the PA and Power Supply Single Li-cell for Power Supply Supply Voltage 2.0 V to 4.0 V in the Temperature Range of -40°C to +85°C/+125°C Single-ended Antenna Output with High Efficient Power Amplifier CLK Output for Clocking the Microcontroller One-chip Solution with Minimum External Circuitry 125°C Operation for Tire Pressure Systems Description The PLL transmitter block has been developed for the demands of RF low-cost transmission systems, at data rates up to 32 kbaud. The transmitting frequency range is 686 MHz to 928 MHz. It can be used in both FSK and ASK systems. 4 ATAR862-8 4589B–4BMCU–02/03 ATAR862-8 Figure 3. Block Diagram ATAR862-8 Power up / down CLK f 4 f 32 ENABLE PFD VS PA_ENABLE GND CP ANT2 LF ANT1 PA PLL VCO XTO XTAL OSC2 OSC1 V DD V SS µC NRESET Brown-out protect. RESET Voltage monitor External input VMI BP10 Port 1 BP13 BP20/NTE Data direction RC Crystal oscillators oscillators External clock input UTCM Timer 1 interval- and watchdog timer Timer 2 T2I T2O SD Clock management ROM 4 K x 8 bit RAM 256 x 4 bit 8/12-bit timer with modulator SSI Serial interface SC T3O T3I 4-bit CPU core I/O bus Timer 3 8-bit timer / counter with modulator and demodulator BP22 BP23 Port 2 BP21 Data direction + alternate function Port 4 Data direction + interrupt control Port 5 Data direction + alternate function Port 6 EEPROM 32 x 16 bit BP51 INT6 BP40 BP41 BP42 BP43 BP50 INT3 VMI T2O INT3 INT6 SC T2I SD BP52 BP53 INT1 INT1 BP60 T3O BP63 T3I 5 4589B–4BMCU–02/03 General Description The fully-integrated PLL transmitter that allows particularly simple, low-cost RF miniature transmitters to be assembled. The VCO is locked to 64 ´ f X T A L , thus, a 13.5672 MHz crystal is needed for a 868.3 MHz transmitter nad a 14.2969 MHz crystal for a 915 MHz transmitter. All other PLL and VCO peripheral elements are integrated. The XTO is a series resonance oscillator so that only one capacitor together with a crystal connected in series to GND are needed as external elements. The crystal oscillator together with the PLL needs maximum < 1 ms until the PLL is locked and the CLK output is stable. A wait time of ³ 4 ms until the CLK is used for the microcontroller and the PA is switched on. The power amplifier is an open-collector output delivering a current pulse which is nearly independent from the load impedance. The delivered output power is controlled via the connected load impedance. This output configuration enables a simple matching to any kind of antenna or to 50 W. A high power efficiency of h = Pout/(IS,PA ´ VS) of 24% for the power amplifier at 868.3 MHz results when an optimized load impedance of ZLoad = (166 + j226) W is used at 3 V supply voltage. Functional Description If ENABLE = L and PA_ENABLE = L, the circuit is in standby mode consuming only a very small amount of current, so that a lithium cell used as power supply can work for several years. With ENABLE = H, the XTO, PLL and the CLK driver are switched on. If PA_ENABLE remains L, only the PLL and the XTO are running and the CLK signal is delivered to the microcontroller. The VCO locks to 64 times the XTO frequency. With ENABLE = H and PA_ENABLE = H, the PLL, XTO, CLK driver and the power amplifier are on. With PA_ENABLE, the power amplifier can be switched on and off, which is used to perform the ASK modulation. ASK Transmission The PLL transmitter block is activated by ENABLE = H. PA_ENABLE must remain L for t ³ 4 ms, then the CLK signal can be taken to clock the microcontroller and the output power can be modulated by means of pin PA_ENABLE. After transmission, PA_ENABLE is switched to L and the microcontroller switches back to internal clocking. The PLL transmitter block is switched back to standby mode with ENABLE = L. The PLL transmitter block is activated by ENABLE = H. PA_ENABLE must remain L for t ³ 4 ms, then the CLK signal can be taken to clock the microcontroller and the power amplifier is switched on with PA_ENABLE = H. The chip is then ready for FSK modulation. The microcontroller starts to switch on and off the capacitor between the XTAL load capacitor and GND with an open-drain output port, thus changing the reference frequency of the PLL. If the switch is closed, the output frequency is lower than if the switch is open. After transmission PA_ENABLE is switched to L and the microcontroller switches back to internal clocking. The PLL transmitter block is switched back to standby mode with ENABLE = L. The accuracy of the frequency deviation with XTAL pulling method is about ±25% when the following tolerances are considered. FSK Transmission 6 ATAR862-8 4589B–4BMCU–02/03 ATAR862-8 Figure 4. Tolerances of Frequency Modulation ~ VS CStray1 XTAL CStray2 CM LM C0 Crystal equivalent circuit RS C4 C5 CSwitch Using C4 = 9.2 pF ±2%, C5 = 6.8 pF ±5%, a switch port with CSwitch = 3 pF ±10%, stray capacitances on each side of the crystal of C Stray1 = C Stray2 = 1 pF ±10%, a parallel capacitance of the crystal of C0 = 3.2 pF ±10% and a crystal with CM = 13 fF ±10%, an FSK deviation of ±21.5 kHz typical with worst case tolerances of ±16.8 kHz to ±28.0 kHz results. ~ CLK Output Clock Pulse Take Over An output CLK signal is provided for a connected microcontroller. The delivered signal is CMOS compatible if the load capacitance is lower than 10 pF. The clock of the crystal oscillator can be used for clocking the microcontroller. Atmel’s M4xCx9x has the special feature of starting with an integrated RC-oscillator to switch on the PLL transmitter block with ENABLE = H, and after 4 ms to assume the clock signal of the transmission IC, so the message can be sent with crystal accuracy. The output power is set by the load impedance of the antenna. The maximum output power is achieved with a load impedance of ZLoad,opt = (166 + j226) W at 868.3 MHz. There must be a low resistive path to VS to deliver the DC current. The delivered current pulse of the power amplifier is 7.7 mA and the maximum output power is delivered to a resistive load of 475 W if the 0.53 pF output capacitance of the power amplifier is compensated by the load impedance. An optimum load impedance of: ZLoad = 475 W || j/(2 ´ p 0.53 pF) = (166 + j226) W thus results for the maximum output power of 5.5 dBm. The load impedance is defined as the impedance seen from the PLL transmitter block’s ANT1, ANT2 into the matching network. Do not confuse this large signal load impedance with a small signal input impedance delivered as input characteristic of RF amplifiers and measured from the application into the IC instead of from the IC into the application for a power amplifier. Less output power is achieved by lowering the real parallel part of 475 W where the parallel imaginary part should be kept constant. Output power measurement can be done with the circuit shown in Figure 5. Note that the component values must be changed to compensate the individual board parasitics until the PLL transmitter block has the right load impedance ZLoad,opt = (166 + j226) W. Also the damping of the cable used to measure the output power must be calibrated. Output Matching and Power Setting 7 4589B–4BMCU–02/03 Figure 5. Output Power Measurement VS C1 = 1n L1 = 10n Power meter Z = 50 W ZLopt ANT2 ~ C2 = 1.5p C3 = 2.7p Rin 50 W ANT1 Application Circuit For the supply-voltage blocking capacitor C3, a value of 68 nF/X7R is recommended (see Figure 6 and Figure 7). C1 and C2 are used to match the loop antenna to the power amplifier where C1 typically is 3.9 pF/NP0 and C2 is 1 pF/NP0; for C2 two capacitors in series should be used to achieve a better tolerance value and to have the possibility to realize the ZLoad,opt by using standard valued capacitors. C1 forms together with the pins of the PLL transmitter block and the PCB board wires a series resonance loop that suppresses the 1st harmonic, thus, the position of C1 on the PCB is important. Normally, the best suppression is achieved when C1 i s placed as close as possible to the pins ANT1 and ANT2. The loop antenna should not exceed a width of 1.5 mm, otherwise the Q-factor of the loop antenna is too high. L1 (»50 nH to 100 nH) can be printed on PCB. C4 should be selected so the XTO runs on the load resonance frequency of the crystal. Normally, a value of 12 pF results for a 15 pF load-capacitance crystal. 8 ATAR862-8 4589B–4BMCU–02/03 ~ ATAR862-8 Figure 6. ASK Application Circuit VS L1 C4 XTAL 1 XTAL XTO VCO PA 24 ANT1 C1 VS VS 2 CP C3 23 ANT2 LF C2 Loop Antenna GND 3 PFD 22 PA_ENABLE 32 PLL f 4 f Power up/down 21 CLK ENABLE 4 NRESET 5 BP63/T3I 6 BP20/NTE 7 BP23 8 BP41/T2I/VMI 9 BP42/T2O 10 BP43/SD/ INT3 BP60/T3O 20 OSC2 19 OSC1 18 BP50/INT6 S1 17 BP52/INT1 S2 16 BP53/INT1 S3 15 BP40/SC/INT3 17 VDD 13 11 VSS 12 VS 9 4589B–4BMCU–02/03 Figure 7. FSK Application Circuit VS L1 C4 XTAL 1 C5 XTAL XTO VCO PA 24 ANT1 C1 VS VS 2 CP C3 23 ANT2 LF C2 Loop Antenna GND 3 PFD 22 PA_ENABLE 32 PLL f 4 f Power up/down 21 CLK ENABLE 4 NRESET 5 BP63/T3I 6 BP20/NTE 7 BP23 8 BP41/T2I/VMI 9 BP42/T2O 10 BP43/SD/ INT3 BP60/T3O 20 OSC2 19 OSC1 18 BP50/INT6 S1 17 BP52/INT1 S2 16 BP53/INT1 S3 15 BP40/SC/INT3 17 VDD 13 11 VSS 12 VS 10 ATAR862-8 4589B–4BMCU–02/03 ATAR862-8 Figure 8. ESD Protection Circuit VS ANT1 CLK PA_ENABLE ANT2 XTAL ENABLE GND Absolute Maximum Ratings Parameters Supply voltage Power dissipation Junction temperature Storage temperature Ambient temperature Symbol VS Ptot Tj TStg Tamb -55 -55 Min. Max. 5 100 150 +125 +125 Unit V mW °C °C °C Thermal Resistance Parameters Junction ambient Symbol RthJA Value 170 Unit K/W Electrical Characteristics VS = 2.0 V to 4.0 V, Tamb = -40°C to +125°C unless otherwise specified. Typical values are given at VS = 3.0 V and Tamb = 25°C. All parameters are referred to GND (Pin 7). Parameters Supply current Test Conditions Power down, VENABLE < 0.25 V, -40°C to +85°C VPA_ENABLE < 0.25 V, -85°C to +125°C VPA_ENABLE < 0.25 V, +25°C (100% correlation tested) Power up, PA off, VS = 3 V VENABLE > 1.7 V, VPA-ENABLE < 0.25 V Power up, VS = 3.0 V VENABLE > 1.7 V, VPA-ENABLE > 1.7 V Output power VS = 3.0 V, Tamb = 25°C f = 868.3 MHz, ZLoad = (166 + j226) W Symbol Min. Typ. Max. 350 7 MSB, Bit 0 -> LSB Port 2 Control Register (P2CR) Bit 3 P2CR3 Bit 2 P2CR2 Bit 1 P2CR1 Bit 0 P2CR0 Auxiliary register address: "2"hex Reset value: 1111b Value: 1111b means all pins in input mode Code 3210 xxx1 xxx0 xx1x xx0x x1xx x0xx 1xxx 0xxx Function BP20 in input mode BP20 in output mode BP21 in input mode BP21 in output mode BP22 in input mode BP22 in output mode BP23 in input mode BP23 in output mode Bi-directional Port 5 As all other bi-directional ports, this port includes a bitwise programmable Control Register (P5CR), which allows the individual programming of each port bit as input or output. It also opens up the possibility of reading the pin condition when in output mode. This is a useful feature for self testing and for serial bus applications. The port pins can also be used as external interrupt inputs (see Figure 23 and Figure 24). The interrupts (INT1 and INT6) can be masked or independently configured to trigger on either edge. The interrupt configuration and port direction is controlled by the Port 5 Control Register (P5CR). An additional low resistance pull-up/-down transistor mask option provides an internal bus pull-up for serial bus applications. The Port 5 Data Register (P5DAT) is I/O mapped to the primary address register of address "5"h and the Port 5 Control Register (P5CR) to the corresponding auxiliary register. The P5CR is a byte-wide register and is configured by writing first the low nibble and then the high nibble (see section "Addressing Peripherals"). 35 4589B–4BMCU–02/03 Figure 31. Bi-directional Port 5 I/O Bus Switched pull-up V DD * V (Data out) I/O Bus D Q P5DATy S Master reset IN enable DD Static * pull-up * BP5y * V DD * * Static Pull-down * Mask options Switched pull-down Figure 32. Port 5 External Interrupts INT1 Data in BP52 INT6 Data in BP51 Bidir. Port IN_Enable Bidir. Port IN_Enable I/O-bus I/O-bus Data in BP53 Data in BP50 Bidir. Port IN_Enable Decoder Decoder Decoder Decoder Bidir. Port IN_Enable P5CR: P53M2 P53M1 P52M2 P52M1 P51M2 P51M1 P50M2 P50M1 Port 5 Data Register (P5DAT) Bit 3 P5DAT3 Bit 2 P5DAT2 Bit 1 P5DAT1 Bit 0 P5DAT0 Primary register address: "5"hex Reset value: 1111b Port 5 Control Register (P5CR) Byte Write Bit 3 First write cycle P51M2 Bit 7 Second write cycle P53M2 Bit 2 P51M1 Bit 6 P53M1 Auxiliary register address: "5"hex Bit 1 P50M2 Bit 5 P52M2 Bit 0 P50M1 Bit 4 P52M1 Reset value: 1111b Reset value: 1111b 36 ATAR862-8 4589B–4BMCU–02/03 ATAR862-8 Table 7. P5xM2, P5xM1 – Port 5x Interrupt Mode/Direction Code Auxiliary Address: "5"hex Code 3210 xx11 xx01 xx10 xx00 11xx 01xx 10xx 00xx Function BP50 in input mode – interrupt disabled BP50 in input mode – rising edge interrupt BP50 in input mode – falling edge interrupt BP50 in output mode – interrupt disabled BP51 in input mode – interrupt disabled BP51 in input mode – rising edge interrupt BP51 in input mode – falling edge interrupt BP51 in output mode – interrupt disabled First Write Cycle Code 3210 xx11 xx01 xx10 xx00 11xx 01xx 10xx 00xx Second Write Cycle Function BP52 in input mode – interrupt disabled BP52 in input mode – rising edge interrupt BP52 in input mode – falling edge interrupt BP52 in output mode – interrupt disabled BP53 in input mode – interrupt disabled BP53 in input mode – rising edge interrupt BP53 in input mode – falling edge interrupt BP53 in output mode – interrupt disabled Bi-directional Port 4 The bi-directional Port 4 is a bitwise configurable I/O port and provides the external pins for the Timer 2, SSI and the voltage monitor input (VMI). As a normal port, it performs in exactly the same way as bi-directional Port 2 (see Figure 25). Two additional multiplexes allow data and port direction control to be passed over to other internal modules (Timer 2, VM or SSI). The I/O-pins for SC and SD line have an additional mode to generate an SSI-interrupt. All four Port 4 pins can be individually switched by the P4CR-register. Figure 25 shows the internal interfaces to bi-directional Port 4. Figure 33. Bi-directional Port 4 and Port 6 I/O Bus Intx PxMRy V DD Static * VDD Switched pull-up * pull-up PIn POut I/O Bus D Q PxDATy S Master reset I/O Bus D * BPxy * (Direction) V DD Static pull-down S Q Switched pull-down * * PxCRy PDir * Mask options 37 4589B–4BMCU–02/03 Port 4 Data Register (P4DAT) Bit 3 P4DAT3 Bit 2 P4DAT2 Bit 1 P4DAT1 Bit 0 P4DAT0 Primary register address: "4"hex Reset value: 1111b Port 4 Control Register (P4CR) Byte Write Bit 3 First write cycle P41M2 Bit 7 Second write cycle P43M2 Bit 2 P41M1 Bit 6 P43M1 Auxiliary register address: "4"hex Bit 1 P40M2 Bit 5 P42M2 Bit 0 P40M1 Bit 4 P42M1 Reset value: 1111b Reset value: 1111b P4xM2, P4xM1 – Port 4x Interrupt mode/direction code Auxiliary Address: "4"hex First Write Cycle Code 3210 xx11 xx10 xx01 xx00 Function BP40 in input mode BP40 in output mode BP40 enable alternate function (SC for SSI) BP40 enable alternate function (falling edge interrupt input for INT3) BP41 in input mode BP41 in output mode BP41 enable alternate function (VMI for voltage monitor input) BP41 enable alternate function (T2I external clock input for Timer 2) Code 3210 xx11 xx10 xx0x 11xx Second Write Cycle Function BP42 in input mode BP42 in output mode BP42 enable alternate function (T2O for Timer 2) BP43 in input mode 11xx 10xx 01xx 10xx 01xx 00xx BP43 in output mode BP43 enable alternate function (SD for SSI) BP43 enable alternate function (falling edge interrupt input for INT3) – 00xx – Bi-directional Port 6 The bi-directional Port 6 is a bitwise configurable I/O port and provides the external pins for the Timer 3. As a normal port, it performs in exactly the same way as bi-directional Port 6 (see Figure 25). Two additional multiplexes allow data and port direction control to be passed over to other internal module (Timer 3). The I/O-pin for T3I line has an additional mode to generate a Timer 3-interrupt. All two Port 6 pins can be individually switched by the P6CR register . Figure 25 shows the internal interfaces to bi-directional Port 6. 38 ATAR862-8 4589B–4BMCU–02/03 ATAR862-8 Port 6 Data Register (P6DAT) Bit 3 P6DAT3 Bit 2 – Bit 1 – Bit 0 P6DAT0 Reset value: 1xx1b Primary register address: "6"hex Port 6 Control Register (P6CR) Bit 3 P63M2 Bit 2 P63M1 Bit 1 P60M2 Bit 0 P60M0 Auxiliary register address: "6"hex Reset value: 1111b P6xM2, P6xM1 – Port 6x Interrupt mode/direction code Auxiliary Address: "6"hex Code 3210 xx11 xx10 xx0x Function BP60 in input mode BP60 in output mode BP60 enable alternate port function (T3O for Timer 3) Code 3210 11xx 10xx 0xxx Write Cycle Function BP63 in input mode BP63 in output mode BP63 enable alternate port function (T3I for Timer 3) Universal Timer/Counter/ The Universal Timer/counter/Communication Module (UTCM) consists of three timers Communication Module (Timer 1,Timer 2, Timer 3) and a Synchronous Serial Interface (SSI). • Timer 1 is an interval timer that can be used to generate periodical interrupts and as (UTCM) prescaler for Timer 2, Timer 3, the serial interface and the watchdog function. • • • Timer 2 is an 8/12-bit timer with an external clock input (T2I) and an output (T2O). Timer 3 is an 8-bit timer/counter with its own input (T3I) and output (T3O). The SSI operates as two wire serial interface or as shift register for modulation and demodulation. The modulator and demodulator units work together with the timers and shift the data bits into or out of the shift register. There is a multitude of modes in which the timers and the serial interface can work together. 39 4589B–4BMCU–02/03 Figure 34. UTCM Block Diagram SYSCL SUBCL from clock module Timer 1 Watchdog MUX Interval / Prescaler NRST INT2 T1OUT Timer 3 Capture 3 Control Demodulator 3 Modulator 3 INT5 T3O T3I MUX 8-bit Counter 3 Compare 3/1 Compare 3/2 TOG3 Timer 2 4-bit Counter 2/1 MUX Compare 2/1 Modulator 2 I/O bus T2O POUT T2I MUX DCG Control 8-bit Counter 2/2 INT4 Compare 2/2 TOG2 SSI Receive buffer SCL MUX 8-bit shift register Transmit buffer Control INT3 SC SD Timer 1 The Timer 1 is an interval timer which can be used to generate periodical interrupts and as prescaler for Timer 2, Timer 3, the serial interface and the watchdog function. The Timer 1 consists of a programmable 14-stage divider that is driven by either SUBCL or SYSCL. The timer output signal can be used as prescaler clock or as SUBCL and as source for the Timer 1 interrupt. Because of other system requirements, the Timer 1 output T1OUT is synchronized with SYSCL. Therefore, in the power-down mode SLEEP (CPU core -> sleep and OSC-Stop -> yes), the output T1OUT is stopped (T1OUT = 0). Nevertheless, the Timer 1 can be active in SLEEP and generate Timer 1 interrupts. The interrupt is maskable via the T1IM bit and the SUBCL can be bypassed via the T1BP bit of the T1C2 register. The time interval for the timer output can be programmed via the Timer 1 control register T1C1. 40 ATAR862-8 4589B–4BMCU–02/03 ATAR862-8 This timer starts running automatically after any power-on reset! If the watchdog function is not activated, the timer can be restarted by writing into the T1C1 register with T1RM = 1. Timer 1 can also be used as a watchdog timer to prevent a system from stalling. The watchdog timer is a 3-bit counter that is supplied by a separate output of Timer 1. It generates a system reset when the 3-bit counter overflows. To avoid this, the 3-bit counter must be reset before it overflows. The application software has to accomplish this by reading the CWD register. After power-on reset the watchdog must be activated by software in the $RESET initialization routine. There are two watchdog modes, in one mode the watchdog can be switched on and off by software, in the other mode the watchdog is active and locked. This mode can only be stopped by carrying out a system reset. The watchdog timer operation mode and the time interval for the watchdog reset can be programmed via the watchdog control register (WDC). Figure 35. Timer 1 Module SYSCL SUBCL WDCL MUX CL1 Prescaler 14 bit Watchdog 4 bit NRST INT2 T1CS T1MUX T1BP T1IM T1OUT Figure 36. Timer 1 and Watchdog T1C1 T1RM T1C2 T1C1 T1C0 3 Write of the T1C1 register T1IM=0 T1MUX T1C2 T1BP T1IM Decoder MUX for interval timer T1IM=1 INT2 T1OUT RES Q1 Q2 Q3 Q4 Q5 CL1 CL Q6 Q8 Q8 Q11 Q11 Q14 SUBCL Q14 Watchdog Divider / 8 Decoder 2 WDC WDL WDR WDT1 WDT0 MUX for watchdog timer WDCL RES Read of the CWD register Divider RESET RESET (NRST) Watchdog mode control 41 4589B–4BMCU–02/03 Timer 1 Control Register 1 (T1C1) Bit 3 * T1RM Bit 2 T1C2 Bit 1 T1C1 Bit 0 T1C0 Address: "7"hex - Subaddress: "8"hex Reset value: 1111b * Bit 3 -> MSB, Bit 0 -> LSB T1RM Timer 1 Restart Mode T1RM = 0, write access without Timer 1 restart T1RM = 1, write access with Timer 1 restart Note: If WDL = 0, Timer 1 restart is impossible Timer 1 Control bit 2 Timer 1 Control bit 1 Timer 1 Control bit 0 T1C2 T1C1 T1C0 The three bits T1C[2:0] select the divider for timer 1. The resulting time interval depends on this divider and the timer 1 input clock source. The timer input can be supplied by the system clock, the 32-kHz oscillator or via the clock management. If the clock management generates the SUBCL, the selected input clock from the RC oscillator, 4-MHz oscillator or an external clock is divided by 16. Time Interval with SUBCL SUBCL/2 SUBCL/4 SUBCL/8 SUBCL/16 SUBCL/32 SUBCL/256 SUBCL/2048 SUBCL/16384 T1C2 0 0 0 0 1 1 1 1 T1C1 0 0 1 1 0 0 1 1 T1C0 0 1 0 1 0 1 0 1 Divider 2 4 8 16 32 256 2048 16384 Time Interval with SUBCL = 32 kHz 61 µs 122 µs 244 µs 488 µs 0.977 ms 7.812 ms 62.5 ms 500 ms Time Interval with SYSCL = 2/1 MHz 1 µs/2 µs 2 µs/4 µs 4 µs/8 µs 8 µs/16 µs 16 µs/32 µs 128 µs/256 µs 1024 µs/2048 µs 8192 µs/16384 µs 42 ATAR862-8 4589B–4BMCU–02/03 ATAR862-8 Timer 1 Control Register 2 (T1C2) Bit 3 * – Bit 2 T1BP Bit 1 T1CS Bit 0 T1IM Reset value: x111b Address: "7"hex - Subaddress: "9"hex * Bit 3 -> MSB, Bit 0 -> LSB T1BP Timer 1 SUBCL ByPassed T1BP = 1, TIOUT = T1MUX T1BP = 0, T1OUT = SUBCL Timer 1 input Clock Select T1CS = 1, CL1 = SUBCL (see Figure 27) T1CS = 0, CL1 = SYSCL (see Figure 27) Timer 1 Interrupt Mask T1IM = 1, disables Timer 1 interrupt T1IM = 0, enables Timer 1 interrupt T1CS T1IM Watchdog Control Register (WDC) Bit 3 * WDL Bit 2 WDR Bit 1 WDT1 Bit 0 WDT0 Address: "7"hex - Subaddress: "A"hex Reset value: 1111b * Bit 3 -> MSB, Bit 0 -> LSB WDL WatchDog Lock mode WDL = 1, the watchdog can be enabled and disabled by using the WDR-bit WDL = 0, the watchdog is enabled and locked. In this mode the WDR-bit has no effect. After the WDL-bit is cleared, the watchdog is active until a system reset or power-on reset occurs. WatchDog Run and stop mode WDR = 1, the watchdog is stopped/disabled WDR = 0, the watchdog is active/enabled WatchDog Time 1 WatchDog Time 0 WDR WDT1 WDT0 Both these bits control the time interval for the watchdog reset. Delay Time to Reset with SUBCL = 32 kHz 15.625 ms 62.5 ms 0.5 s 4s Delay Time to Reset with SYSCL = 2/1 MHz 0.256 ms/0.512 ms 1.024 ms/2.048 ms 8.2 ms/16.4 ms 65.5 ms/131 ms WDT1 0 0 1 1 WDT0 0 1 0 1 Divider 512 2048 16384 131072 43 4589B–4BMCU–02/03 Timer 2 8-/12-bit Timer for: • Interrupt, square-wave, pulse and duty cycle generation • Baud-rate generation for the internal shift register • Manchester and Biphase modulation together with the SSI • Carrier frequency generation and modulation together with the SSI Timer 2 can be used as an interval timer for interrupt generation, as signal generator or as baud-rate generator and modulator for the serial interface. It consists of a 4-bit and an 8-bit up counter stage which both have compare registers. The 4-bit counter stages of Timer 2 are cascadable as a 12-bit timer or as an 8-bit timer with 4-bit prescaler. The timer can also be configured as an 8-bit timer and a separate 4-bit prescaler. The Timer 2 input can be supplied via the system clock, the external input clock (T2I), the Timer 1 output clock, the Timer 3 output clock or the shift clock of the serial interface. The external input clock T2I is not synchronized with SYSCL. Therefore, it is possible to use Timer 2 with a higher clock speed than SYSCL. Furthermore, with that input clock the Timer 2 operates in the power-down mode SLEEP (CPU core -> sleep and OSC-Stop -> yes) as well as in the POWER-DOWN (CPU core -> sleep and OSCStop -> no). All other clock sources supplied no clock signal in SLEEP. The 4-bit counter stages of Timer 2 have an additional clock output (POUT). Its output has a modulator stage that allows the generation of pulses as well as the generation and modulation of carrier frequencies. The Timer 2 output can modulate with the shift register data output to generate Biphase- or Manchester code. If the serial interface is used to modulate a bitstream, the 4-bit stage of Timer 2 has a special task. The shift register can only handle bitstream lengths divisible by 8. For other lengths, the 4-bit counter stage can be used to stop the modulator after the right bitcount is shifted out. If the timer is used for carrier frequency modulation, the 4-bit stage works together with an additional 2-bit duty cycle generator like a 6-bit prescaler to generate carrier frequency and duty cycle. The 8-bit counter is used to enable and disable the modulator output for a programmable count of pulses. For programming the time interval, the timer has a 4-bit and an 8-bit compare register. For programming the timer function, it has four mode and control registers. The comparator output of stage 2 is controlled by a special compare mode register (T2CM). This register contains mask bits for the actions (counter reset, output toggle, timer interrupt) which can be triggered by a compare match event or the counter overflow. This architecture enables the timer function for various modes. The Timer 2 has a 4-bit compare register (T2CO1) and an 8-bit compare register (T2CO2). Both these compare registers are cascadable as a 12-bit compare register, or 8-bit compare register and 4-bit compare register. For 12-bit compare data value: m = x +1 For 8-bit compare data value: n = y +1 For 4-bit compare data value: l = z +1 0 £ x £ 4095 0 £ y £ 255 0 £ z £ 15 44 ATAR862-8 4589B–4BMCU–02/03 ATAR862-8 Figure 37. Timer 2 I/O-bus P4CR T2I T2M1 T2M2 DCGO SYSCL T1OUT TOG3 SCL CL2/1 4-bit Counter 2/1 RES OVF1 POUT CL2/2 T2O DCG 8-bit Counter 2/2 RES OVF2 TOG2 OUTPUT M2 MOUT T2C Compare 2/1 CM1 Control Compare 2/2 INT4 to Modulator 3 T2CO1 SSI POUT T2CM T2CO2 Biphase-, Manchestermodulator Timer 2 modulator output-stage SO I/O-bus SSI Control SSI Timer 2 Modes Mode 1: 12-bit Compare Counter The 4-bit stage and the 8-bit stage work together as a 12-bit compare counter. A compare match signal of the 4-bit and the 8-bit stage generates the signal for the counter reset, toggle flip-flop or interrupt. The compare action is programmable via the compare mode register (T2CM). The 4-bit counter overflow (OVF1) supplies the clock output (POUT) with clocks. The duty cycle generator (DCG) has to be bypassed in this mode. Figure 38. 12-bit Compare Counter POUT (CL2/1 /16) CL2/1 OVF2 TOG2 RES INT4 4-bit counter RES DCG 8-bit counter 4-bit compare CM1 8-bit compare CM2 Timer 2 output mode and T2OTM-bit 4-bit register T2D1, 0 8-bit register T2RM T2OTM T2IM T2CTM Mode 2: 8-bit Compare Counter with 4-bit Programmable Prescaler Figure 39. 8-bit Compare Counter DCGO POUT CL2/1 OVF2 4-bit counter RES DCG 8-bit counter RES TOG2 INT4 4-bit compare CM1 8-bit compare CM2 Timer 2 output mode and T2OTM-bit 4-bit register T2D1, 0 8-bit register T2RM T2OTM T2IM T2CTM 45 4589B–4BMCU–02/03 The 4-bit stage is used as programmable prescaler for the 8-bit counter stage. In this mode, a duty cycle stage is also available. This stage can be used as an additional 2-bit prescaler or for generating duty cycles of 25%, 33% and 50%. The 4-bit compare output (CM1) supplies the clock output (POUT) with clocks. Mode 3/4: 8-bit Compare Counter and 4-bit Programmable Prescaler Figure 40. 4-/8-bit Compare Counter DCGO T2I SYSCL CL2/2 OVF2 TOG2 DCG 8-bit counter RES INT4 CM2 Timer 2 output mode and T2OTM-bit P4CR P41M2, 1 T2D1, 0 8-bit compare 8-bit register T2RM T2OTM T2IM T2CTM TOG3 T1OUT SYSCL SCL MUX CL2/1 4-bit counter RES CM1 POUT 4-bit compare T2CS1, 0 4-bit register In these modes the 4-bit and the 8-bit counter stages work independently as a 4-bit prescaler and an 8-bit timer with an 2-bit prescaler or as a duty cycle generator. Only in the mode 3 and mode 4, can the 8-bit counter be supplied via the external clock input (T2I) which is selected via the P4CR register. The 4-bit prescaler is started via activating of mode 3 and stopped and reset in mode 4. Changing mode 3 and 4 has no effect for the 8-bit timer stage. The 4-bit stage can be used as prescaler for Timer 3, the SSI or to generate the stop signal for modulator 2 and modulator 3. Timer 2 Output Modes The signal at the timer output is generated via modulator 2. In the toggle mode, the compare match event toggles the output T2O. For high resolution duty cycle modulation 8 bits or 12 bits can be used to toggle the output. In the duty cycle burst modulator modes the DCG output is connected to T2O and switched on and off either by the toggle flipflop output or the serial data line of the SSI. Modulator 2 also has two modes to output the content of the serial interface as Biphase or Manchester code. The modulator output stage can be configured by the output control bits in the T2M2 register. The modulator is started with the start of the shift register (SIR = 0) and stopped either by carrying out a shift register stop (SIR = 1) or compare match event of stage 1 (CM1) of Timer 2. For this task, Timer 2 mode 3 must be used and the prescaler has to be supplied with the internal shift clock (SCL). 46 ATAR862-8 4589B–4BMCU–02/03 ATAR862-8 Figure 41. Timer 2 Modulator Output Stage DCGO SO TOG2 RE Biphase/ Manchester modulator Toggle S1 RES/SET Modulator3 OMSK T2M2 T2OS2, 1, 0 T2TOP M2 M2 S3 S2 T2O SSI CONTROL FE Timer 2 Output Signals Timer 2 Output Mode 1 Toggle Mode A: A Timer 2 compare match toggles the output flip-flop (M2) -> T2O Figure 42. Interrupt Timer/Square Wave Generator – the Output Toggles with Each Edge Compare Match Event Input Counter 2 T2R 0 0 0 1 2 3 4 0 1 2 3 4 0 1 2 3 4 0 1 Counter 2 CMx INT4 T2O Toggle Mode B: A Timer 2 compare match toggles the output flip-flop (M2) -> T2O Figure 43. P ulse Generator – the Timer Output Toggles with the Timer Start if the T2TS-bit Is Set Input Counter 2 T2R 0 0 0 1 2 3 4 5 6 7 4095/ 255 0 1 2 3 4 5 6 Counter 2 CMx INT4 T2O Toggle by start T2O 47 4589B–4BMCU–02/03 Toggle Mode C: A Timer 2 compare match toggles the output flip-flop (M2) -> T2O Figure 44. Pulse Generator – the Timer Toggles with Timer Overflow and Compare Match Input Counter 2 T2R 0 0 0 1 2 3 4 5 6 7 4095/ 255 0 1 2 3 4 5 6 Counter 2 CMx OVF2 INT4 T2O Timer 2 Output Mode 2 Duty Cycle Burst Generator 1: The DCG output signal (DCGO) is given to the output, and gated by the output flip-flop (M2) Figure 45. Carrier Frequency Burst Modulation with Timer 2 Toggle Flip-flop Output DCGO 1 2 0 1 2 0 1 2 3 4 5 0 1 2 0 1 2 3 4 5 6 7 8 0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 Counter 2 TOG2 M2 T2O Counter = compare register (=2) Timer 2 Output Mode 3 Duty Cycle Burst Generator 2: The DCG output signal (DCGO) is given to the output, and gated by the SSI internal data output (SO) Figure 46. Carrier Frequency Burst Modulation with the SSI Data Output DCGO 1201201201201201201201201201201201201201 Counter 2 Counter = compare register (=2) TOG2 SO T2O Bit 0 Bit 1 Bit 2 Bit 3 Bit 4 Bit 5 Bit 6 Bit 7 Bit 8 Bit 9 Bit 10 Bit 11 Bit 12 Bit 13 48 ATAR862-8 4589B–4BMCU–02/03 ATAR862-8 Timer 2 Output Mode 4 Biphase Modulator: Timer 2 Modulates the SSI Internal Data Output (SO) to Biphase Code. Figure 47. Biphase Modulation TOG2 SC 8-bit SR-Data SO T2O 0 Bit 7 0 Data: 00110101 0 1 1 0 1 0 1 Bit 0 0 1 1 0 1 0 1 Timer 2 Output Mode 5 Manchester Modulator: T imer 2 Modulates the SSI internal data output (SO) to Manchester code Figure 48. Manchester Modulation TOG2 SC 8-bit SR-Data SO T2O 0 0 Bit 7 0 0 1 1 0 1 0 1 Bit 0 1 1 0 1 0 1 Bit 0 Bit 7 Data: 00110101 Timer 2 Output Mode 7 In this mode the timer overflow defines the period and the compare register defines the duty cycle. During one period only the first compare match occurrence is used to toggle the timer output flip-flop, until the overflow all further compare match are ignored. This avoids the situation that changing the compare register causes the occurrence of several compare match during one period. The resolution at the pulse-width modulation Timer 2 mode 1 is 12-bit and all other Timer 2 modes are 8-bit. 49 4589B–4BMCU–02/03 PWM Mode: Pulse-width modulation output on Timer 2 output pin (T2O) Figure 49. PWM Modulation Input clock Counter 2/2 T2R 0 0 50 255 0 100 255 0 150 255 0 50 255 0 100 Counter 2/2 CM2 OVF2 INT4 T2O T1 T load the next compare value T2CO2=150 load load T2 T T3 T T1 T T2 T Timer 2 Registers Timer 2 has 6 control registers to configure the timer mode, the time interval, the input clock and its output function. All registers are indirectly addressed using extended addressing as described in section "Addressing Peripherals". The alternate functions of the Ports BP41 or BP42 must be selected with the Port 4 control register P4CR, if one of the Timer 2 modes require an input at T2I/BP41 or an output at T2O/BP42. Timer 2 Control Register (T2C) Bit 3 T2CS1 Bit 2 T2CS0 Bit 1 T2TS Bit 0 T2R Address: "7"hex - Subaddress: "0"hex Reset value: 0000b T2CS1 T2CS0 T2CS1 0 0 1 1 Timer 2 Clock Select bit 1 Timer 2 Clock Select bit 0 T2CS0 0 1 0 1 Input Clock (CL 2/1) of Counter Stage 2/1 System clock (SYSCL) Output signal of Timer 1 (T1OUT) Internal shift clock of SSI (SCL) Output signal of Timer 3 (TOG3) T2TS Timer 2 Toggle with Start T2TS = 0, the output flip-flop of Timer 2 is not toggled with the timer start T2TS = 1, the output flip-flop of Timer 2 is toggled when the timer is started with T2R Timer 2 Run T2R = 0, Timer 2 stop and reset T2R = 1, Timer 2 run T2R 50 ATAR862-8 4589B–4BMCU–02/03 ATAR862-8 Timer 2 Mode Register 1 (T2M1) Bit 3 T2D1 Bit 2 T2D0 Bit 1 T2MS1 Bit 0 T2MS0 Reset value: 1111b Address: "7"hex - Subaddress: "1"hex T2D1 T2D0 Timer 2 Duty cycle bit 1 Timer 2 Duty cycle bit 0 T2D1 1 1 0 0 T2D0 1 0 1 0 Function of Duty Cycle Generator (DCG) Bypassed (DCGO0) Duty cycle 1/1 (DCGO1) Duty cycle 1/2 (DCGO2) Duty cycle 1/3 (DCGO3) Additional Divider Effect /1 /2 /3 /4 T2MS1 T2MS0 Timer 2 Mode Select bit 1 Timer 2 Mode Select bit 0 Mode 1 T2MS1 1 T2MS0 1 Clock Output (POUT) 4-bit counter overflow (OVF1) Timer 2 Modes 12-bit compare counter; the DCG has to be bypassed in this mode 8-bit compare counter with 4bit programmable prescaler and duty cycle generator 8-bit compare counter clocked by SYSCL or the external clock input T2I, 4-bit prescaler run, the counter 2/1 starts after writing mode 3 8-bit compare counter clocked by SYSCL or the external clock input T2I, 4-bit prescaler stop and resets 2 1 0 4-bit compare output (CM1) 3 0 1 4-bit compare output (CM1) 4 0 0 4-bit compare output (CM1) Duty Cycle Generator The duty cycle generator generates duty cycles of 25%, 33% or 50%. The frequency at the duty cycle generator output depends on the duty cycle and the Timer 2 prescaler setting. The DCG-stage can also be used as additional programmable prescaler for Timer 2. 51 4589B–4BMCU–02/03 Figure 50. DCG Output Signals DCGIN DCGO0 DCGO1 DCGO2 DCGO3 Timer 2 Mode Register 2 (T2M2) Bit 3 T2TOP Bit 2 T2OS2 Bit 1 T2OS1 Bit 0 T2OS0 Address: "7"hex - Subaddress: "2"hex Reset value: 1111b T2TOP Timer 2 Toggle Output Preset This bit allows the programmer to preset the Timer 2 output T2O. T2TOP = 0, resets the toggle outputs with the write cycle (M2 = 0) T2TOP = 1, sets toggle outputs with the write cycle (M2 = 1) Note: If T2R = 1, no output preset is possible Timer 2 Output Select bit 2 Timer 2 Output Select bit 1 Timer 2 Output Select bit 0 T2OS2 T2OS1 T2OS0 Output Mode 1 2 T2OS2 1 1 T2OS1 1 1 T2OS0 1 0 Clock Output (POUT) Toggle mode: a Timer 2 compare match toggles the output flip-flop (M2) -> T2O Duty cycle burst generator 1: the DCG output signal (DCG0) is given to the output and gated by the output flip-flop (M2) Duty cycle burst generator 2: the DCG output signal (DCGO) is given to the output and gated by the SSI internal data output (SO) Biphase modulator: Timer 2 modulates the SSI internal data output (SO) to Biphase code Manchester modulator: Timer 2 modulates the SSI internal data output (SO) to Manchester code SSI output: T2O is used directly as SSI internal data output (SO) PWM mode: an 8/12-bit PWM mode Not allowed 3 1 0 1 4 5 6 7 8 1 0 0 0 0 0 1 1 0 0 0 1 0 1 0 If one of these output modes is used the T2O alternate function of Port 4 must also be activated. 52 ATAR862-8 4589B–4BMCU–02/03 ATAR862-8 Timer 2 Compare and Compare Mode Registers Timer 2 has two separate compare registers, T2CO1 for the 4-bit stage and T2CO2 for the 8-bit stage of Timer 2. The timer compares the contents of the compare register current counter value and if it matches it generates an output signal. Dependent on the timer mode, this signal is used to generate a timer interrupt, to toggle the output flip-flop as SSI clock or as a clock for the next counter stage. In the 12-bit timer mode, T2CO1 contains bits 0 to 3 and T2CO2 bits 4 to 11 of the 12-bit compare value. In all other modes, the two compare registers work independently as a 4- and 8-bit compare register. When asigned to the compare register a compare event will be suppressed. Timer 2 Compare Mode Register (T2CM) Bit 3 T2OTM Bit 2 T2CTM Bit 1 T2RM Bit 0 T2IM Address: "7"hex - Subaddress: "3"hex Reset value: 0000b T2OTM Timer 2 Overflow Toggle Mask bit T2OTM = 0, disable overflow toggle T2OTM = 1, enable overflow toggle, a counter overflow (OVF2) toggles output flip-flop (TOG2). If the T2OTM-bit is set, only a counter overflow can generate an interrupt except on the Timer 2 output mode 7. Timer 2 Compare Toggle Mask bit T2CTM = 0, disable compare toggle T2CTM = 1, enable compare toggle, a match of the counter with the compare register toggles output flip-flop (TOG2). In Timer 2 output mode 7 and when the T2CTM-bit is set, only a match of the counter with the compare register can generate an interrupt. Timer 2 Reset Mask bit T2RM = 0, disable counter reset T2RM = 1, enable counter reset, a match of the counter with the compare register resets the counter Timer 2 Interrupt Mask bit T2IM = 0, disable Timer 2 interrupt T2IM = 1, enable Timer 2 interrupt T2OTM 0 1 x T2CTM x x 1 Timer 2 Interrupt Source Compare match (CM2) Overflow (OVF2) Compare match (CM2) T2CTM T2RM T2IM Timer 2 Output Mode 1, 2, 3, 4, 5 and 6 1, 2, 3, 4, 5 and 6 7 Timer 2 COmpare Register 1 (T2CO1) Write cycle Bit 3 Bit 2 Bit 1 Address: "7"hex - Subaddress: "4"hex Bit 0 Reset value: 1111b In prescaler mode the clock is bypassed if the compare register T2CO1 contains 0. 53 4589B–4BMCU–02/03 Timer 2 COmpare Register 2 (T2CO2) Byte Write First write cycle Bit 3 Bit 2 Bit 1 Address: "7"hex - Subaddress: "5"hex Bit 0 Reset value: 1111b Second write cycle Bit 7 Bit 6 Bit 5 Bit 4 Reset value: 1111b Timer 3 Features • • • • • • • • • • • Two Compare Registers Capture Register Edge Sensitive Input with Zero Cross Detection Capability Trigger and Single Action Modes Output Control Modes Automatically Modulation and Demodulation Modes FSK Modulation Pulse Width Modulation (PWM) Manchester Demodulation Together with SSI Biphase Demodulation Together with SSI Pulse-width Demodulation Together with SSI Figure 51. Timer 3 TOG2 T3I T3EIM Control INT5 Capture register D NQ CL3 T3SM1 T3RM1 T3IM1 T3TM1 : T3M1 8-bit counter RES CM31 8-bit comparator Control C31 C32 CM32 TOG3 Compare register 1 NQ D T3SM2 T3RM2 T3IM2 T3TM2 : T3M2 Compare register 2 54 ATAR862-8 4589B–4BMCU–02/03 ATAR862-8 Timer 3 consists of an 8-bit up-counter with two compare registers and one capture register. The timer can be used as event counter, timer and signal generator. Its output can be programmed as modulator and demodulator for the serial interface. The two compare registers enable various modes of signal generation, modulation and demodulation. The counter can be driven by internal and external clock sources. For external clock sources, it has a programmable edge-sensitive input which can be used as counter input, capture signal input or trigger input. This timer input is synchronized with SYSCL. Therefore, in the power-down mode SLEEP (CPU core -> sleep and OSCStop -> yes), this timer input is stopped too. The counter is readable via its capture register while it is running. In capture mode, the counter value can be captured by a programmable capture event from the Timer 3 input or Timer 2 output. A special feature of this timer is the trigger- and single-action mode. In trigger mode, the counter starts counting triggered by the external signal at its input. In single-action mode, the counter counts only one time up to the programmed compare match event. These modes are very useful for modulation, demodulation, signal generation, signal measurement and phase controlling. For phase controlling, the timer input is protected against negative voltages and has zero-cross detection capability. Timer 3 has a modulator output stage and input functions for demodulation. As modulator it works together with Timer 2 or the serial interface. When the shift register is used for modulation the data shifted out of the register is encoded bitwise. In all demodulation modes, the decoded data bits are shifted automatically into the shift register. Timer/Counter Modes Timer 3 has 6 timer modes and 6 modulator/demodulator modes. The mode is set via the Timer 3 Mode Register T3M. In all these modes, the compare register and the compare-mode register belonging to it define the counter value for a compare match and the action of a compare match. A match of the current counter value with the content of one compare register triggers a counter reset, a Timer 3 interrupt or the toggling of the output flip-flop. The compare mode registers T3M1 and T3M2 contain the mask bits for enabling or disabling these actions. The counter can also be enabled to execute single actions with one or both compare registers. If this mode is set the corresponding compare match event is generated only once after the counter start. Most of the timer modes use their compare registers alternately. After the start has been activated, the first comparison is carried out via the compare register 1, the second is carried out via the compare register 2, the third is carried out again via the compare register 1 and so on. This makes it easy to generate signals with constant periods and variable duty cycle or to generate signals with variable pulse and space widths. If single-action mode is set for one compare register, the comparison is always carried out after the first cycle via the other compare register. The counter can be started and stopped via the control register T3C. This register also controls the initial level of the output before start. T3C contains the interrupt mask for a T3I input interrupt. Via the Timer 3 clock-select register, the internal or external clock source can be selected. This register selects also the active edge of the external input. An edge at the external input T3I can generate also an interrupt if the T3EIM-bit is set and the Timer 3 is stopped (T3R = 0) in the T3C-register. 55 4589B–4BMCU–02/03 Figure 52. Counter 3 Stage TOG2 T3I T3EIM Control INT5 Capture register D NQ CL3 T3SM1 T3RM1 T3IM1 T3TM1 : T3M1 8-bit counter RES CM31 8-bit comparator Control C31 C32 CM32 TOG3 Compare register 1 NQ D T3SM2 T3RM2 T3IM2 T3TM2 : T3M2 Compare register 2 The status of the timer as well as the occurrence of a compare match or an edge detect of the input signal is indicated by the status register T2ST. This allows identification of the interrupt source because all these events share only one timer interrupt. Timer 3 compares data values. The Timer 3 has two 8-bit compare registers (T3CO1, T3CO2). The compare data value can be ‘m’ for each of the Timer 3 compare registers. The compare data value for the compare registers is: m = x +1 0 £ x £ 255 Timer 3 – Mode 1: Timer/Counter The selected clock from an internal or external source increments the 8-bit counter. In this mode, the timer can be used as event counter for external clocks at T3I or as timer for generating interrupts and pulses at T3O. The counter value can be read by the software via the capture register. 56 ATAR862-8 4589B–4BMCU–02/03 ATAR862-8 Figure 53. Counter Reset with Each Compare Match T3R 0 0 0 1 2 3 0 1 2 3 4 5 0 1 2 3 0 1 2 3 Counter 3 CM31 CM32 INT5 T3O Figure 54. Counter Reset with Compare Register 2 and Toggle with Start CL3 T3R 0 0 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 Counter 3 CM31 CM32 INT5 T3O T3O Toggle by start Figure 55. Single Action of Compare Register 1 T3R 0 0 1 2 3 4 5 6 7 8 9 10 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 0 1 Counter 3 CM31 CM32 T3O Toggle by start Timer 3 – Mode 2: Timer/Counter, External Trigger Restart and External Capture (with T3I Input) The counter is driven by an internal clock source. After starting with T3R, the first edge from the external input T3I starts the counter. The following edges at T3I load the current counter value into the capture register, reset the counter and restart it. The edge can be selected by the programmable edge decoder of the timer input stage. If singleaction mode is activated for one or both compare registers the trigger signal restarts the single action. 57 4589B–4BMCU–02/03 Figure 56. Externally Triggered Counter Reset and Start Combined with Single-action Mode T3R 0 0 0 0 0 0 0 0 1 2 3 4 5 6 7 8 9 10 0 1 2 X X X 0 1 2 3 4 5 6 7 8 9 10 0 1 2 X X X X Counter 3 T3EX CM31 CM32 T3O Timer 3 – Mode 3: Timer/Counter, Internal Trigger Restart and Internal Capture (with TOG2) The counter is driven by an internal or external (T3I) clock source. The output toggle signal of Timer 2 resets the counter. The counter value before the reset is saved in the capture register. If single-action mode is activated for one or both compare registers, the trigger signal restarts the single actions. This mode can be used for frequency measurements or as event counter with time gate (see combination mode 10). Figure 57. Event Counter with Time Gate T3R T3I 0 0 1 2 3 4 5 6 7 8 9 10 11 01 2 Counter 3 TOG2 T3CPRegister Capture value = 0 3 4 012 Capture value = 11 Capture value = 4 Timer 3 – Mode 4: Timer/Counter Timer 3 – Mode 5: Timer/Counter, External Trigger Restart and External Capture (with T3I Input) The timer runs as timer/counter in mode 1, but its output T3O is used as output for the Timer 2 output signal. The Timer 3 runs as timer/counter in mode 2, but its output T3O is used as output for the Timer 2 output signal. Timer 3 Modulator/Demodulator Modes Timer 3 – Mode 6: Carrier Frequency Burst Modulation Controlled by Timer 2 Output Toggle FlipFlop (M2) The Timer 3 counter is driven by an internal or external clock source. Its compare- and compare mode registers must be programmed to generate the carrier frequency via the output toggle flip-flop. The output toggle flip-flop of Timer 2 is used to enable or disable the Timer 3 output. Timer 2 can be driven by the toggle output signal of Timer 3 or any other clock source (see combination mode 11). 58 ATAR862-8 4589B–4BMCU–02/03 ATAR862-8 Timer 3 – Mode 7: Carrier Frequency Burst Modulation Controlled by SSI Internal Output (SO) The Timer 3 counter is driven by an internal or external clock source. Its compare- and compare mode registers must be programmed to generate the carrier frequency via the output toggle flip-flop. The output (SO) of the SSI is used to enable or disable the Timer 3 output. The SSI should be supplied with the toggle signal of Timer 2 (see combination mode 12). The two compare registers are used for generating two different time intervals. The SSI internal data output (SO) selects which compare register is used for the output frequency generation. A "0" level at the SSI data output enables the compare register 1. A "1" level enables compare register 2. The compare- and compare-mode registers must be programmed to generate the two frequencies via the output toggle flip-flop. The SSI can be supplied with the toggle signal of Timer 2. The Timer 3 counter is driven by an internal or external clock source. The Timer 2 counter is driven by the Counter 3 (TOG3) (see also combination mode 13). Timer 3 – Mode 8: FSK Modulation with Shift Register Data (SO) Figure 58. FSK Modulation T3R 0123401234012340120120120120120120120123401 Counter 3 CM31 CM32 SO T3O 0 1 0 Timer 3 – Mode 9: Pulse-width Modulation with the Shift Register The two compare registers are used for generating two different time intervals. The SSI internal data output (SO) selects which compare register is used for the output pulse generation. In this mode both compare- and compare-mode registers must be programmed for generating the two pulse widths. It is also useful to enable the single-action mode for extreme duty cycles. Timer 2 is used as baudrate generator and for the trigger restart of Timer 3. The SSI must be supplied with a toggle signal of Timer 2. The counter is driven by an internal or external clock source (see combination mode 7). Figure 59. Pulse-width Modulation TOG2 SIR 0 1 0 1 SO SCO T3R Counter 3 CM31 CM32 T3O 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 3 4 5 6 7 8 9 1011121314150 1 2 3 4 5 6 7 8 9 101112131415 0 1 2 3 4 59 4589B–4BMCU–02/03 Timer 3 – Mode 10: Manchester Demodulation/ Pulse-width Demodulation For Manchester demodulation, the edge detection stage must be programmed to detect each edge at the input. These edges are evaluated by the demodulator stage. The timer stage is used to generate the shift clock for the SSI. The compare register 1 match event defines the correct moment for shifting the state from the input T3I as the decoded bit into shift register – after that the demodulator waits for the next edge to synchronize the timer by a reset for the next bit. The compare register 2 can also be used to detect a time-out error and handle it with an interrupt routine (see also combination mode 8). Figure 60. Manchester Demodulation Timer 3 mode T3I T3EX SI CM31=SCI SR-DATA 1 BIT 0 1 BIT 1 1 BIT 2 0 BIT 3 0 BIT 4 1 BIT 5 1 BIT 6 0 Synchronize 1 0 1 1 Manchester demodulation mode 1 0 0 1 1 0 Timer 3 – Mode 11: Biphase Demodulation In the Biphase demodulation mode, the timer operates like in Manchester demodulation mode. The difference is that the bits are decoded via a toggle flip-flop. This flip-flop samples the edge in the middle of the bitframe and the compare register 1 match event shifts the toggle flip-flop output into shift register (see also combined mode 9). Figure 61. Biphase Demodulation Timer 3 mode T3I T3EX Q1=SI CM31=SCI Reset Counter 3 SR-DATA 0 BIT 0 1 BIT 1 1 BIT 2 0 BIT 3 1 BIT 4 0 BIT 5 1 BIT 6 0 Synchronize 0 0 1 1 Biphase demodulation mode 0 1 0 1 0 60 ATAR862-8 4589B–4BMCU–02/03 ATAR862-8 Timer 3 – Mode 12: Timer/Counter with External Capture Mode (T3I) The counter is driven by an internal clock source and an edge at the external input T3I loads the counter value into the capture register. The edge can be selected with the programmable edge detector of the timer input stage. This mode can be used for signal and pulse measurements. Figure 62. External Capture Mode T3R T3I Counter 3 T3CPRegister 0 0 1 2 3 4 5 6 7 8 9 1011121314151617181920212223242526272829303132333435363738394041 Capture value = X Capture value = 17 Capture value = 35 Timer 3 Modulator for Carrier Frequency Burst Modulation If the output stage operates as pulse-width modulator for the shift register, the output can be stopped with stage 1 of Timer 2. For this task, the timer mode 3 must be used and the prescaler must be supplied by the internal shift clock of the shift register. The modulator can be started with the start of the shift register (SIR = 0) and stopped either by a shift register stop (SIR = 1) or compare match event of stage 1 of Timer 2. For this task, the Timer 2 must be used in mode 3 and the prescaler stage must be supplied by the internal shift clock of the shift register. Figure 63. Modulator 3 0 TOG3 Set T3 M3 1 2 T3O Res MUX T3TOP SO M2 Timer 3 Mode 6 7 9 other T3O MUX 1 MUX 2 MUX 3 MUX 0 3 SSI/ Control OMSK T3M Timer 3 Demodulator for The demodulator stage of Timer 3 can be used to decode Biphase, Manchester and Biphase, Manchester and pulse-width-coded signals. Pulse-width-modulated Figure 64. Timer 3 Demodulator 3 Signals T3M T3I Demodulator 3 T3EX Res SCI SI CM31 Counter 3 Reset Counter 3 Control 61 4589B–4BMCU–02/03 Timer 3 Registers Timer 3 Mode Register (T3M) Bit 3 T3M3 Bit 2 T3M2 Bit 1 T3M1 Bit 0 T3M0 Reset value: 1111b Address: "B"hex - Subaddress: "0"hex T3M3 T3M2 T3M1 T3M0 Timer 3 Mode select bit 3 Timer 3 Mode select bit 2 Timer 3 Mode select bit 1 Timer 3 Mode select bit 0 Mode 1 2 3 4 5 6 7 8 9 T3M3 1 1 1 1 1 1 1 1 0 T3M2 1 1 1 1 0 0 0 0 1 T3M1 1 1 0 0 1 1 0 0 1 T3M0 1 0 1 0 1 0 1 0 1 Timer 3 Modes Timer/counter with a read access Timer/counter, external capture and external trigger restart mode (T3I) Timer/counter, internal capture and internal trigger restart mode (TOG2) Timer/counter mode 1 without output (T2O -> T3O) Timer/counter mode 2 without output (T2O -> T3O) Burst modulation with Timer 2 (M2) Burst modulation with shift register (SO) FSK modulation with shift register (SO) Pulse-width modulation with shift register (SO) and Timer 2 (TOG2), internal trigger restart (SCO) -> counter reset Manchester demodulation/pulse-width demodulation (1) (T2O -> T3O) Biphase demodulation (T2O -> T3O) Timer/counter with external capture mode (T3I) Not allowed Not allowed Not allowed Not allowed 10 11 12 13 14 15 16 Note: 0 0 0 0 0 0 0 1 1 1 0 0 0 0 1 0 0 1 1 0 0 0 1 0 1 0 1 0 1. In this mode, the SSI can be used only as demodulator (8-bit NRZ rising edge). All other SSI modes are not allowed. 62 ATAR862-8 4589B–4BMCU–02/03 ATAR862-8 Timer 3 Control Register 1 (T3C) Write Bit 3 Write T3EIM Bit 2 T3TOP Bit 1 T3TS Primary register address: "C"hex - Write Bit 0 T3R Reset value: 0000b T3EIM Timer 3 Edge Interrupt Mask T3EIM = 0, disables the interrupt when an edge event for Timer 3 occurs (T3I) T3EIM = 1, enables the interrupt when an edge event for Timer 3 occurs (T3I) Timer 3 Toggle Output Preset T3TOP = 0, sets toggle output (M3) to "0" T3TOP = 1, sets toggle output (M3) to "1" Note: If T3R = 1, no output preset is possible Timer 3 Toggle with Start T3TS = 0, Timer 3 output is not toggled during the start T3TS = 1, Timer 3 output is toggled if started with T3R Timer 3 Run T3R = 0, Timer 3 stop and reset T3R = 1, Timer 3 run T3TOP T3TS T3R Timer 3 Status Register 1 (T3ST) Read Bit 3 Read --Bit 2 T3ED Bit 1 T3C2 Primary register address: "C"hex - Read Bit 0 T3C1 Reset value: x000b T3ED T3C2 T3C1 Note: Timer 3 Edge Detect This bit will be set by the edge-detect logic of Timer 3 input (T3I) Timer 3 Compare 2 This bit will be set when a match occurs between Counter 3 and T3CO2 Timer 3 Compare 1 This bit will be set when a match occurs between Counter 3 and T3CO1 The status bits T3C1, T3C2 and T3ED will be reset after a READ access to T3ST. Timer 3 Clock Select Register (T3CS) Bit 3 T3CS T3E1 Bit 2 T3E0 Bit 1 T3CS1 Address: "B"hex - Subaddress: "1"hex Bit 0 T3CS0 Reset value: 1111b T3E1 T3E0 Timer 3 Edge select bit 1 Timer 3 Edge select bit 0 T3E1 1 1 0 0 T3E0 1 0 1 0 Timer 3 Input Edge Select (T3I) – Positive edge at T3I pin Negative edge at T3I pin Each edge at T3I pin 63 4589B–4BMCU–02/03 T3CS1 Timer 3 Clock Source select bit 1 T3CS1 T3CS0 Timer 3 Clock Source select bit 0 1 1 0 0 TCS0 Counter 3 Input Signal (CL3) 1 0 1 0 System clock (SYSCL) Output signal of Timer 2 (POUT) Output signal of Timer 1 (T1OUT) External input signal from T3I edge detect Timer 3 Compare- and Compare-mode Register Timer 3 has two separate compare registers T3CO1 and T3CO2 for the 8-bit stage of Timer 3. The timer compares the content of the compare register with the current counter value. If both match, it generates a signal. This signal can be used for the counter reset, to generate a timer interrupt, for toggling the output flip-flop, as SSI clock or as clock for the next counter stage. For each compare register, a compare-mode register exists. These registers contain mask bits to enable or disable the generation of an interrupt, a counter reset, or an output toggling with the occurrence of a compare match of the corresponding compare register. The mask bits for activating the single-action mode can also be located in the compare mode registers. When assigned to the compare register a compare event will be suppressed. Address: "B"hex - Subaddress: "2"hex Bit 3 T3CM1 T3SM1 Bit 2 T3TM1 Bit 1 T3RM1 Bit 0 T3IM1 Reset value: 0000b Timer 3 Compare-Mode Register 1 (T3CM1) T3SM1 Timer 3 Single action Mask bit 1 T3SM1 = 0, disables single-action compare mode T3SM1 = 1, enables single-compare mode. After this bit is set, the compare register (T3CO1) is used until the next compare match. Timer 3 compare Toggle action Mask bit 1 T3TM1 = 0, disables compare toggle T3TM1 = 1, enables compare toggle. A match of Counter 3 with the compare register (T3CO1) toggles the output flip-flop (TOG3). Timer 3 Reset Mask bit 1 T3RM1 = 0, disables counter reset T3RM1 = 1, enables counter reset. A match of Counter 3 with the compare register (T3CO1) resets the Counter 3. Timer 3 Interrupt Mask bit 1 T3RM1 = 0, disables Timer 3 interrupt for T3CO1 register. T3RM1 = 1, enables Timer 3 interrupt for T3CO1 register. T3TM1 T3RM1 T3IM1 T3CM1 contains the mask bits for the match event of the Counter 3 compare register 1 64 ATAR862-8 4589B–4BMCU–02/03 ATAR862-8 Timer 3 Compare Mode Register 2 (T3CM2) Bit 3 T3CM2 T3SM2 Bit 2 T3TM2 Bit 1 T3RM2 Address: "B"hex - Subaddress: "3"hex Bit 0 T3IM2 Reset value: 0000b T3SM2 Timer 3 Single action Mask bit 2 T3SM2 = 0, disables single-action compare mode T3SM2 = 1, enables single-compare mode. After this bit is set, the compare register (T3CO2) is used until the next compare match. Timer 3 compare Toggle action Mask bit 2 T3TM2 = 0, disables compare toggle T3TM2 = 1, enables compare toggle. A match of Counter 3 with the compare register (T3CO2) toggles the output flip-flop (TOG3). Timer 3 Reset Mask bit 2 T3RM2 = 0, disables counter reset T3RM2 = 1, enables counter reset. A match of Counter 3 with the compare register (T3CO2) resets the Counter 3. Timer 3 Interrupt Mask bit 2 T3RM2 = 0, disables Timer 3 interrupt for T3CO2 register. T3RM2 = 1, enables Timer 3 interrupt for T3CO2 register. T3TM2 T3RM2 T3IM2 T3CM2 contains the mask bits for the match event of Counter 3 compare register 2 The compare registers and corresponding counter reset masks can be used to program the counter time intervals and the toggle masks can be used to program output signal. The single-action mask can also be used in this mode. It starts operating after the timer started with T3R. Timer 3 COmpare Register 1 (T3CO1) Byte Write Address: "B"hex - Subaddress: "4"hex High Nibble Second write cycle Bit 7 Bit 6 Bit 5 Bit 4 Reset value: 1111b Low Nibble First write cycle Bit 3 Bit 2 Bit 15 Bit 0 Reset value: 1111b Timer 3 COmpare Register 2 (T3CO2) Byte Write Address: "B"hex - Subaddress: "5"hex High Nibble Second write cycle Bit 7 Bit 6 Bit 5 Bit 4 Reset value: 1111b Low Nibble First write cycle Bit 3 Bit 2 Bit 15 Bit 0 Reset value: 1111b 65 4589B–4BMCU–02/03 Timer 3 Capture Register The counter content can be read via the capture register. There are two ways to use the capture register. In modes 1 and 4, it is possible to read the current counter value directly out of the capture register. In the capture modes 2, 3, 5 and 12, a capture event like an edge at the Timer 3 input or a signal from Timer 2 stores the current counter value into the capture register. This counter value can be read from the capture register. Timer 3 CaPture Register (T3CP) Byte Read Address: "B"hex - Subaddress: "4"hex High Nibble First read cycle Bit 7 Bit 6 Bit 5 Bit 4 Reset value: xxxxb Low Nibble Second read cycle Bit 3 Bit 2 Bit 15 Bit 0 Reset value: xxxxb Synchronous Serial Interface (SSI) SSI Features – 2- and 3-wire NRZ – 2-wire multi-chip link mode (MCL), additional internal 2-wire link for multichip packaging solutions • With Timer 2: – Biphase modulation – Manchester modulation – Pulse-width demodulation – Burst modulation • With Timer 3: – Pulse-width modulation (PWM) – FSK modulation – Biphase demodulation – Manchester demodulation – Pulse-width demodulation – Pulse position Demodulation The synchronous serial interface (SSI) can be used either for serial communication with external devices such as EEPROMs, shift registers, display drivers, other microcontrollers, or as a means for generating and capturing on-chip serial streams of data. External data communication takes place via the Port 4 (BP4),a multi-functional port which can be software configured by writing the appropriate control word into the P4CR register. The SSI can be configured in any of the following ways: 1. 2-wire external interface for bi-directional data communication with one data terminal and one shift clock. The SSI uses the Port BP43 as a bi-directional serial data line (SD) and BP40 as shift clock line (SC). 2. 3-wire external interface for simultaneous input and output of serial data, with a serial input data terminal (SI), a serial output data terminal (SO) and a shift clock (SC). The SSI uses BP40 as shift clock (SC), while the serial data input (SI) is applied to BP43 (configured in P4CR as input!). Serial output data (SO) in this case is passed through to BP42 (configured in P4CR to T2O) via the Timer 2 output stage (T2M2 configured in mode 6). SSI Peripheral Configuration 66 ATAR862-8 4589B–4BMCU–02/03 ATAR862-8 3. Timer/SSI combined modes – the SSI used together with Timer 2 or Timer 3 is capable of performing a variety of data modulation and demodulation functions (see Timer Section). The modulating data is converted by the SSI into a continuous serial stream of data which is in turn modulated in one of the timer functional blocks. Serial demodulated data can be serially captured in the SSI and read by the controller. In the Timer 3 modes 10 and 11 (demodulation modes) the SSI can only be used as demodulator. 4. Internal Multi-Chip Link pads (MCL) – the SSI can also be used as an interchip data interface for use in single package multi-chip modules or hybrids. For such applications, the SSI is provided with two dedicated pads (MCL_SD and MCL_SC) which act as a two-wire chip-to-chip link. The internal MCL can be activated by the MCL control bit. Should these MCL pads be used by the SSI, the standard SD and SC pins are not required and the corresponding Port 4 ports are available as conventional data ports. Figure 65. Block Diagram of the Synchronous Serial Interface I/O-bus Timer 2 / Timer 3 SIC1 SIC2 SISC SO Control SC SSI-Control INT3 SI SCI SC MCL_SC TOG2 POUT T1OUT SYSCL Output SO /2 Shift_CL 8-bit Shift Register MSB LSB SI MCL_SD SD STB SRB Transmit Buffer I/O-bus Receive Buffer General SSI Operation The SSI is comprised essentially of an 8-bit shift register with two associated 8-bit buffers – the receive buffer (SRB) for capturing the incoming serial data and a transmit buffer (STB) for intermediate storage of data to be serially output. Both buffers are directly accessable by software. Transferring the parallel buffer data into and out of the shift register is controlled automatically by the SSI control, so that both single byte transfers or continuous bit streams can be supported. The SSI can generate the shift clock (SC) either from one of several on-chip clock sources or accept an external clock. The external shift clock is output on, or applied to the Port BP40. Selection of an external clock source is performed by the Serial Clock Direction control bit (SCD). In the combinational modes, the required clock is selected by the corresponding timer mode. The SSI can operate in three data transfer modes – synchronous 8-bit shift mode, a 9-bit Multi-Chip Link Mode (MCL), containing 8-bit data and 1-bit acknowledge, and a corresponding 8-bit MCL mode without acknowledge. In both MCL modes the data transmission begins after a valid start condition and ends with a valid stop condition. External SSI clocking is not supported in these modes. The SSI should thus generate and has full control over the shift clock so that it can always be regarded as an MCL Bus Master device. 67 4589B–4BMCU–02/03 All directional control of the external data port used by the SSI is handled automatically and is dependent on the transmission direction set by the Serial Data Direction (SDD) control bit. This control bit defines whether the SSI is currently operating in Transmit (TX) mode or Receive (RX) mode. Serial data is organized in 8-bit telegrams which are shifted with the most significant bit first. In the 9-bit MCL mode, an additional acknowledge bit is appended to the end of the telegram for handshaking purposes (see MCL protocol). At the beginning of every telegram, the SSI control loads the transmit buffer into the shift register and proceeds immediately to shift data serially out. At the same time, incoming data is shifted into the shift register input. This incoming data is automatically loaded into the receive buffer when the complete telegram has been received. Thus, data can be simultaneously received and transmitted if required. Before data can be transferred, the SSI must first be activated. This is performed by means of the SSI reset control (SIR) bit. All further operation then depends on the data directional mode (TX/RX) and the present status of the SSI buffer registers shown by the Serial Interface Ready Status Flag (SRDY). This SRDY flag indicates the (empty/full) status of either the transmit buffer (in TX mode), or the receive buffer (in RX mode). The control logic ensures that data shifting is temporarily halted at any time, if the appropriate receive/transmit buffer is not ready (SRDY = 0). The SRDY status will then automatically be set back to ‘1’ and data shifting resumed as soon as the application software loads the new data into the transmit register (in TX mode) or frees the shift register by reading it into the receive buffer (in RX mode). A further activity status (ACT) bit indicates the present status of the serial communication. The ACT bit remains high for the duration of the serial telegram or if MCL stop or start conditions are currently being generated. Both the current SRDY and ACT status can be read in the SSI status register. To deactivate the SSI, the SIR bit must be set high. 8-bit Synchronous Mode Figure 66. 8-bit Synchronous Mode SC (Rising edge) SC (Falling edge) DATA 0 Bit 7 SD/TO2 0 Bit 7 Data: 00110101 0 1 1 0 1 0 0 1 1 0 1 0 1 Bit 0 1 Bit 0 In the 8-bit synchronous mode, the SSI can operate as either a 2- or 3-wire interface (see SSI peripheral configuration). The serial data (SD) is received or transmitted in NRZ format, synchronized to either the rising or falling edge of the shift clock (SC). The choice of clock edge is defined by the Serial Mode Control bits (SM0,SM1). It should be noted that t he transmission edge refers to the SC clock edge with which the SD changes. To avoid clock skew problems, the incoming serial input data is shifted in with the opposite edge. When used together with one of the timer modulator or demodulator stages, the SSI must be set in the 8-bit synchronous mode 1. 68 ATAR862-8 4589B–4BMCU–02/03 ATAR862-8 In RX mode, as soon as the SSI is activated (SIR = 0), 8 shift clocks are generated and the incoming serial data is shifted into the shift register. This first telegram is automatically transferred into the receive buffer and the SRDY set to 0 indicating that the receive buffer contains valid data. At the same time an interrupt (if enabled) is generated. The SSI then continues shifting in the following 8-bit telegram. If, during this time the first telegram has been read by the controller, the second telegram will also be transferred in the same way into the receive buffer and the SSI will continue clocking in the next telegram. Should, however, the first telegram not have been read (SRDY = 1), then the SSI will stop, temporarily holding the second telegram in the shift register until a certain point of time when the controller is able to service the receive buffer. In this way no data is lost or overwritten. Deactivating the SSI (SIR = 1) in mid-telegram will immediately stop the shift clock and latch the present contents of the shift register into the receive buffer. This can be used for clocking in a data telegram of less than 8 bits in length. Care should be taken to read out the final complete 8-bit data telegram of a multiple word message before deactivating the SSI (SIR = 1) and terminating the reception. After termination, the shift register contents will overwrite the receive buffer. Figure 67. Example of 8-bit Synchronous Transmit Operation SC msb SD lsb 0 msb lsb msb lsb 0 7654321 765432107654321 tx data 1 SIR tx data 2 tx data 3 SRDY ACT Interrupt (IFN = 0) Interrupt (IFN = 1) Write STB (tx data 1) Write STB (tx data 2) Write STB (tx data 3) 69 4589B–4BMCU–02/03 Figure 68. Example of 8-bit Synchronous Receive Operation SC msb SD lsb msb lsb msb lsb 7654321076543210 rx data 1 rx data 2 765432107654 rx data 3 SIR SRDY ACT Interrupt (IFN = 0) Interrupt (IFN = 1) Read SRB (rx data 1) Read SRB (rx data 2) Read SRB (rx data 3) 9-bit Shift Mode (MCL) In the 9-bit shift mode, the SSI is able to handle the MCL protocol described below. It always operates as an MCL master device, i.e., SC is always generated and output by the SSI. Both the MCL start and stop conditions are automatically generated whenever the SSI is activated or deactivated by the SIR-bit. In accordance with the MCL protocol, the output data is always changed in the clock low phase and shifted in on the high phase. Before activating the SSI (SIR = 0) and commencing an MCL dialog, the appropriate data direction for the first word must be set using the SDD control bit. The state of this bit controls the direction of the data port (BP43 or MCL_SD). Once started, the 8 data bits are, depending on the selected direction, either clocked into or out of the shift register. During the 9th clock period, the port direction is automatically switched over so that the corresponding acknowledge bit can be shifted out or read in. In transmit mode, the acknowledge bit received from the device is captured in the SSI Status Register (TACK) where it can be read by the controller. In receive mode, the state of the acknowledge bit to be returned to the device is predetermined by the SSI Status Register (RACK). Changing the directional mode (TX/RX) should not be performed during the transfer of an MCL telegram. One should wait until the end of the telegram which can be detected using the SSI interrupt (IFN = 1) or by interrogating the ACT status. Once started, a 9-bit telegram will always run to completion and will not be prematurely terminated by the SIR bit. So, if the SIR-bit is set to "1" in telegram, the SSI will complete the current transfer and terminate the dialog with an MCL stop condition. 70 ATAR862-8 4589B–4BMCU–02/03 ATAR862-8 Figure 69. Example of MCL Transmit Dialog Start SC msb SD lsb msb lsb Stop 76543210A tx data 1 76543210A tx data 2 SRDY ACT Interrupt IFN = 0) Interrupt IFN = 1) SIR SDD Write STB (tx data 1) Write STB (tx data 2) Figure 70. Example of MCL Receive Dialog Start SC msb SD lsb msb lsb Stop 76543210A tx data 1 76543210A rx data 2 SRDY ACT Interrupt (IFN = 0) Interrupt (IFN = 1) SIR SDD Write STB (tx data 1) Read SRB (rx data 2) 8-bit Pseudo MCL Mode In this mode, the SSI exhibits all the typical MCL operational features except for the acknowledge-bit which is never expected or transmitted. 71 4589B–4BMCU–02/03 MCL Bus Protocol The MCL protocol constitutes a simple 2-wire bi-directional communication highway via which devices can communicate control and data information. Although the MCL protocol can support multi-master bus configurations, the SSI in MCL mode is intended for use purely as a master controller on a single master bus system. So all reference to multiple bus control and bus contention will be omitted at this point. All data is packaged into 8-bit telegrams plus a trailing handshaking or acknowledge-bit. Normally the communication channel is opened with a so-called start condition, which initializes all devices connected to the bus. This is then followed by a data telegram, transmitted by the master controller device. This telegram usually contains an 8-bit address code to activate a single slave device connected onto the MCL bus. Each slave receives this address and compares it with its own unique address. The addressed slave device, if ready to receive data, will respond by pulling the SD line low during the 9th clock pulse. This represents a so-called MCL acknowledge. The controller detecting this affirmative acknowledge then opens a connection to the required slave. Data can then be passed back and forth by the master controller, each 8-bit telegram being acknowledged by the respective recipient. The communication is finally closed by the master device and the slave device put back into standby by applying a stop condition onto the bus. Figure 71. MCL Bus Protocol 1 (1) SC (2) (4) (4) (3) (1) SD Start condition Data valid Data change Data valid Stop condition Bus not busy (1) Both data and clock lines remain HIGH. Start data transfer (2) A HIGH to LOW transition of the SD line while the clock (SC) is HIGH defines a START condition Stop data transfer (3) A LOW to HIGH transition of the SD line while the clock (SC) is HIGH defines a STOP condition. Data valid (4) The state of the data line represents valid data when, after START condition, the data line is stable for the duration of the HIGH period of the clock signal. Acknowledge All address and data words are serially transmitted to and from the device in eight-bit words. The receiving device returns a zero on the data line during the ninth clock cycle to acknowledge word receipt. 72 ATAR862-8 4589B–4BMCU–02/03 ATAR862-8 Figure 72. MCL Bus Protocol 2 SC 1 n 8 9 SD Start 1st Bit 8th Bit ACK Stop SSI Interrupt The SSI interrupt INT3 can be generated either by an SSI buffer register status (i.e., transmit buffer empty or receive buffer full), the end of SSI data telegram or on the falling edge of the SC/SD pins on Port 4 (see P4CR). SSI interrupt selection is performed by the Interrupt FunctioN control bit (IFN). The SSI interrupt is usually used to synchronize the software control of the SSI and inform the controller of the present SSI status. The Port 4 interrupts can be used together with the SSI or, if the SSI itself is not required, as additional external interrupt sources. In either case this interrupt is capable of waking the controller out of sleep mode. To enable and select the SSI relevant interrupts use the SSI interrupt mask (SIM) and the Interrupt Function (IFN) while the Port 4 interrupts are enabled by setting appropriate control bits in P4CR register. Modulation and Demodulation If the shift register is used together with Timer 2 or Timer 3 for modulation or demodulation purposes, the 8-bit synchronous mode must be used. In this case, the unused Port 4 pins can be used as conventional bi-directional ports. The modulation and demodulation stages, if enabled, operate as soon as the SSI is activated (SIR = 0) and cease when deactivated (SIR = 1). Due to the byte-orientated data control, the SSI (when running normally) generates serial bit streams which are submultiples of 8 bits. An SSI output masking (OMSK) function permits; however, the generation of bit streams of any length. The OMSK signal is derived indirectly from the 4-bit prescaler of the Timer 2 and masks out a programmable number of unrequired trailing data bits during the shifting out of the final data word in the bit stream. The number of non-masked data bits is defined by the value pre-programmed in the prescaler compare register. To use output masking, the modulator stop mode bit (MSM) must be set to "0" before programming the final data word into the SSI transmit buffer. This in turn, enables shift clocks to the prescaler when this final word is shifted out. On reaching the compare value, the prescaler triggers the OMSK signal and all following data bits are blanked. Internal 2-wire Multi-chip Link Two additional on-chip pads (MCL_SC and MCL_SD) for the SC and the SD line can be used as chip-to-chip link for multi-chip applications. These pads can be activated by setting the MCL-bit in the SISC-register. 73 4589B–4BMCU–02/03 Figure 73. Multi-chip Link U505M SCL SDA Multi chip link MCL_SC V DD BP40/SC MCL_SD V SS BP43/SD Microcontroller BP10 BP13 Figure 74. SSI Output Masking Function CL2/1 SCL Compare 2/1 CM1 OMSK Control SC SSI-control Output TOG2 POUT T1OUT SYSCL SO /2 Shift_CL MSB 8-bit shift register SI LSB SO 4-bit counter 2/1 Timer 2 Serial Interface Registers Serial Interface Control Register 1 (SIC1) Bit 3 Bit 2 Bit 1 Bit 0 Auxiliary register address: "9"hex SIR SCD SCS1 SCS0 Reset value: 1111b SIR Serial Interface Reset SIR = 1, SSI inactive SIR = 0, SSI active Serial Clock Direction SCD = 1, SC line used as output SCD = 0, SC line used as input Note: This bit has to be set to "1" during the MCL mode and the Timer 3 mode 10 or 11 SCD SCS1 SCS0 Serial Clock source Select bit 1 Serial Clock source Select bit 0 SCS1 1 1 SCS0 1 0 1 0 Internal Clock for SSI SYSCL/2 T1OUT/2 POUT/2 TOG2/2 Note: with SCD = "0" the bits SCS1 and SCS0 are insignificant 0 0 74 ATAR862-8 4589B–4BMCU–02/03 ATAR862-8 • • • In Transmit mode (SDD = 1) shifting starts only if the transmit buffer has been loaded (SRDY = 1). Setting SIR-bit loads the contents of the shift register into the receive buffer (synchronous 8-bit mode only). In MCL modes, writing a 0 to SIR generates a start condition and writing a 1 generates a stop condition. Serial Interface Control Register 2 (SIC2) Bit 3 Bit 2 Bit 1 Bit 0 Auxiliary register address: "A"hex MSM SM1 SM0 SDD Reset value: 1111b MSM Modular Stop Mode MSM = 1, modulator stop mode disabled (output masking off) MSM = 0, modulator stop mode enabled (output masking on) - used in modulation modes for generating bit streams which are not sub–multiples of 8 bits. Serial Mode control bit 1 Serial Mode control bit 0 SM1 1 1 0 0 SM1 SM0 Mode 1 2 3 4 SM0 1 0 1 0 SSI Mode 8-bit NRZ-Data changes with the rising edge of SC 8-bit NRZ-Data changes with the falling edge of SC 9-bit two-wire MCL mode 8-bit two-wire MCL mode (no acknowledge) SDD Serial Data Direction SDD = 1, transmit mode – SD line used as output (transmit data). SRDY is set by a transmit buffer write access. SDD = 0, receive mode – SD line used as input (receive data). SRDY is set by a receive buffer read access SDD controls port directional control and defines the reset function for the SRDY-flag Note: 75 4589B–4BMCU–02/03 Serial Interface Status and Control Register (SISC) Bit 3 Bit 2 Bit 1 Bit 0 Primary register address: "A"hex Write Read MCL --- RACK TACK SIM ACT IFN SRDY Reset value: 1111b Reset value: xxxxb MCL Multi-Chip Link activation MCL = 1,multi-chip link disabled. This bit has to be set to "0" during transactions to/from EEPROM of the M44C892 MCL = 0, connects SC and SD additionally to the internal multi-chip link pads Receive ACKnowledge status/control bit for MCLmode RACK = 0, transmit acknowledge in next receive telegram RACK = 1, transmit no acknowledge in last receive telegram Transmit ACKnowledge status/control bit for MCL mode TACK = 0, acknowledge received in last transmit telegram TACK = 1, no acknowledge received in last transmit telegram Serial Interrupt Mask SIM = 1, disable interrupts SIM = 0, enable serial interrupt. An interrupt is generated. Interrupt FuNction IFN = 1, the serial interrupt is generated at the end of telegram IFN = 0, the serial interrupt is generated when the SRDY goes low (i.e., buffer becomes empty/full in transmit/receive mode) Serial interface buffer ReaDY status flag SRDY = 1, in receive mode: receive buffer empty in transmit mode: transmit buffer full SRDY = 0, in receive mode: receive buffer full in transmit mode: transmit buffer empty Transmission ACTive status flag ACT = 1, transmission is active, i.e., serial data transfer. Stop or start conditions are currently in progress. ACT = 0, transmission is inactive RACK TACK SIM IFN SRDY ACT Serial Transmit Buffer (STB) – Byte Write First write cycle Second write cycle Bit 3 Bit 7 Bit 2 Bit 6 Bit 1 Bit 5 Bit 0 Bit 4 Primary register address: "9"hex Reset value: xxxxb Reset value: xxxxb The STB is the transmit buffer of the SSI. The SSI transfers the transmit buffer into the shift register and starts shifting with the most significant bit. Serial Receive Buffer (SRB) – Byte Read First read cycle Second read cycle Bit 7 Bit 3 Bit 6 Bit 2 Bit 5 Bit 1 Bit 4 Bit 0 Primary register address: "9"hex Reset value: xxxxb Reset value: xxxxb The SRB is the receive buffer of the SSI. The shift register clocks serial data in (most significant bit first) and loads content into the receive buffer when complete telegram has been received. 76 ATAR862-8 4589B–4BMCU–02/03 ATAR862-8 Combination Modes The UTCM consists of two timers (Timer 2 and Timer 3) and a serial interface. There is a multitude of modes in which the timers and serial interface can work together. The 8-bit wide serial interface operates as shift register for modulation and demodulation. The modulator and demodulator units work together with the timers and shift the data bits into or out of the shift register. Combination Mode Timer 2 and SSI Figure 75. Combination Timer 2 and SSI I/O-bus P4CR T2I T2M1 T2M2 DCGO SYSCL T1OUT TOG3 SCL CL2/1 4-bit counter 2/1 RES OVF1 POUT CL2/2 T2O DCG 8-bit counter 2/2 RES OVF2 TOG2 Output T2C Compare 2/1 Timer 2 - control POUT CM1 Compare 2/2 INT4 MOUT Biphase-, Manchestermodulator T2CO1 TOG2 T2CM T2CO2 SO Timer 2 modulator output-stage Control I/O-bus SIC1 TOG2 POUT T1OUT SYSCL SCLI SIC2 SISC Control INT3 SO SC SSI-control MCL_SC Output SO SCL 8-bit shift register Shift_CL MSB LSB SI MCL_SD SD STB Transmit buffer I/O-bus SRB Receive buffer 77 4589B–4BMCU–02/03 Combination Mode 1: Burst Modulation SSI mode 1: Timer 2 mode 1, 2, 3 or 4: Timer 2 output mode 3: 8-bit NRZ and internal data SO output to the Timer 2 modulator stage 8-bit compare counter with 4-bit programmable prescaler and DCG Duty cycle burst generator Figure 76. Carrier Frequency Burst Modulation with the SSI Internal Data Output DCGO 1201201201201201201201201201201201201201 Counter 2 Counter = compare register (=2) TOG2 SO T2O Bit 0 Bit 1 Bit 2 Bit 3 Bit 4 Bit 5 Bit 6 Bit 7 Bit 8 Bit 9 Bit 10 Bit 11 Bit 12 Bit 13 Combination Mode 2: Biphase Modulation 1 SSI mode 1: Timer 2 mode 1, 2, 3 or 4: Timer 2 output mode 4: 8-bit shift register internal data output (SO) to the Timer 2 modulator stage 8-bit compare counter with 4-bit programmable prescaler The modulator 2 of Timer 2 modulates the SSI internal data output to Biphase code Figure 77. Biphase Modulation 1 TOG2 SC 8-bit SR-data SO T2O 0 Bit 7 0 Data: 00110101 0 1 1 0 1 0 1 Bit 0 0 1 1 0 1 0 1 78 ATAR862-8 4589B–4BMCU–02/03 ATAR862-8 Combination Mode 3: Manchester Modulation 1 SSI mode 1: Timer 2 mode 1, 2, 3 or 4: Timer 2 output mode 5: 8-bit shift register internal data output (SO) to the Timer 2 modulator stage 8-bit compare counter with 4-bit programmable prescaler The modulator 2 of Timer 2 modulates the SSI internal data output to Manchester code Figure 78. Manchester Modulation 1 TOG2 SC 8-bit SR-data SO T2O 0 0 Bit 7 0 0 1 1 0 1 0 1 Bit 0 1 1 0 1 0 1 Bit 0 Bit 7 Data: 00110101 Combination Mode 4: Manchester Modulation 2 SSI mode 1: Timer 2 mode 3: Timer 2 output mode 5: 8-bit shift register internal data output (SO) to the Timer 2 modulator stage 8-bit compare counter and 4-bit prescaler The modulator 2 of Timer 2 modulates the SSI data output to Manchester code The 4-bit stage can be used as prescaler for the SSI to generate the stop signal for modulator 2. The SSI has a special mode to supply the prescaler with the shift clock. The control output signal (OMSK) of the SSI is used as stop signal for the modulator. Figure 71 shows an example for a 12-bit Manchester telegram. Figure 79. Manchester Modulation 2 SCLI Buffer full SIR SO SC MSM Timer 2 Mode 3 SCL Counter 2/1 OMSK T2O 0 0 0 0 0 Counter 2/1 = Compare Register 2/1 (= 4) 0 0 0 0 1 2 3 4 0 1 2 3 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 79 4589B–4BMCU–02/03 Combination Mode 5: Biphase Modulation 2 SSI mode 1: Timer 2 mode 3: Timer 2 output mode 4: 8-bit shift register internal data output (SO) to the Timer 2 modulator stage 8-bit compare counter and 4-bit prescaler The modulator 2 of Timer 2 modulates the SSI data output to Biphase code The 4-bit stage can be used as prescaler for the SSI to generate the stop signal for modulator 2. The SSI has a special mode to supply the prescaler via the shift clock. The control output signal (OMSK) of the SSI is used as stop signal for the modulator. Figure 72 shows an example for a 13-bit Biphase telegram. Figure 80. Biphase Modulation SCLI Buffer full SIR SO SC MSM Timer 2 Mode 3 SCL Counter 2/1 OMSK T2O 0 0 0 0 0 Counter 2/1 = Compare Register 2/1 (= 5) 0 0 0 0 1 2 3 4 5 0 1 2 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 80 ATAR862-8 4589B–4BMCU–02/03 ATAR862-8 Combination Mode Timer 3 and SSI Figure 81. Combination Timer 3 and SSI I/O-bus T3CS T3I T3M T3EX T3I T3CP T3EX SYSCL T1OUT POUT CL3 RES Compare 3/1 Compare 3/2 Timer 3 - control CP3 CM31 RES T3C T3ST INT5 TOG3 SO Control M2 T3O Modulator 3 Demodulator 3 SC SI 8-bit counter 3 T3CO1 T3CO2 T3CM1 T3CM2 SI SC SIC1 TOG2 POUT T1OUT SYSCL SIC2 SISC Control INT3 SC MCL_SC Output SCLI SSI-control SO MSB 8-bit shift register SI LSB MCL_SD SI Shift_CL STB Transmit buffer I/O-bus SRB Receive buffer Combination Mode 6: FSK Modulation SSI mode 1: 8-bit shift register internal data output (SO) to the Timer 3 Timer 3 mode 8: FSK modulation with shift register data (SO) The two compare registers are used to generate two varied time intervals. The SSI data output selects which compare register is used for the output frequency generation. A "0" level at the SSI data output enables the compare register 1 and a "1" level enables the compare register 2. The compare and compare mode registers must be programmed to generate the two frequencies via the output toggle flip-lop. The SSI can be supplied with the toggle signal of Timer 2 or any other clock source. The Timer 3 counter is driven by an internal or external clock source. 81 4589B–4BMCU–02/03 Figure 82. FSK Modulation T3R 012340123401201201201201201201201201234012340 Counter 3 CM31 CM32 SO T3O 0 1 0 Combination Mode 7: Pulse-width Modulation (PWM) SSI mode 1: 8-bit shift register internal data output (SO) to the Timer 3 Timer 3 mode 9: Pulse-width modulation with the shift register data (SO) The two compare registers are used to generate two varied time intervals. The SSI data output selects which compare register is used for the output pulse generation. In this mode, both compare and compare mode registers must be programmed to generate the two pulse width. It is also useful to enable the single-action mode for extreme duty cycles. Timer 2 is used as baudrate generator and for the triggered restart of Timer 3. The SSI must be supplied with the toggle signal of Timer 2. The counter is driven by an internal or external clock source. Figure 83. Pulse-width Modulation TOG2 SIR 0 1 0 1 SO SCO T3R Counter 3 CM31 CM32 T3O 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 3 4 5 6 7 8 9 1011121314150 1 2 3 4 5 6 7 8 9 101112131415 0 1 2 3 4 Combination Mode 8: Manchester Demodulation/ Pulse-width Demodulation SSI mode 1: 8-bit shift register internal data input (SI) and the internal shift clock (SCI) from the Timer 3 Timer 3 mode 10: Manchester demodulation/pulse-width demodulation with Timer 3 For Manchester demodulation, the edge detection stage must be programmed to detect each edge at the input. These edges are evaluated by the demodulator stage. The timer stage is used to generate the shift clock for the SSI. A compare register 1 match event defines the correct moment for shifting the state from the input T3I as the decoded bit into shift register. After that, the demodulator waits for the next edge to synchronize the timer by a reset for the next bit. The compare register 2 can be used to detect a time error and handle it with an interrupt routine. 82 ATAR862-8 4589B–4BMCU–02/03 ATAR862-8 Before activating the demodulator mode the timer and the demodulator stage must be synchronized with the bitstream. The Manchester code timing consists of parts with the half bitlength and the complete bitlength. A synchronization routine must start the demodulator after an interval with the complete bitlength. The counter can be driven by any internal clock source. The output T3O can be used by Timer 2 in this mode. The Manchester decoder can also be used for pulse-width demodulation. The input must programmed to detect the positive edge. The demodulator and timer must be synchronized with the leading edge of the pulse. After that a counter match with the compare register 1 shifts the state at the input T3I into the shift register. The next positive edge at the input restarts the timer. Figure 84. Manchester Demodulation Timer 3 mode T3I T3EX SI CM31=SCI SR-DATA 1 Bit 7 1 Bit 6 1 Bit 5 0 Bit 4 0 Bit 3 1 Bit 2 1 Bit 1 0 Bit 0 Synchronize 1 0 1 1 Manchester demodulation mode 1 0 0 1 1 0 Combination Mode 9: Biphase Demodulation SSI mode 1: 8-bit shift register internal data input (SI) and the internal shift clock (SCI) from the Timer 3 Timer 3 mode 11: Biphase demodulation with Timer 3 In the Biphase demodulation mode the timer works like in the Manchester demodulation mode. The difference is that the bits are decoded with the toggle flip-flop. This flip-flop samples the edge in the middle of the bitframe and the compare register 1 match event shifts the toggle flip-flop output into shift register. Before activating the demodulation the timer and the demodulation stage must be synchronized with the bitstream. The Biphase code timing consists of parts with the half bitlength and the complete bitlength. The synchronization routine must start the demodulator after an interval with the complete bitlength. The counter can be driven by any internal clock source and the output T3O can be used by Timer 2 in this mode. 83 4589B–4BMCU–02/03 Figure 85. Biphase Demodulation Timer 3 mode T3I T3EX Q1=SI CM31=SCI Reset Counter 3 SR-DATA 0 Bit 7 1 Bit 6 1 Bit 5 0 Bit 4 1 Bit 3 0 Bit 2 1 Bit 1 0 Bit 0 Synchronize 0 0 1 1 Biphase demodulation mode 0 1 0 1 0 Combination Mode Timer 2 and Timer 3 Figure 86. Combination Timer 3 and Timer 2 I/O-bus T3CS T3I T3M T3EX T3I T3CP T3EX SYSCL T1OUT POUT CL3 SCI Demodulator 3 SI CP3 CM31 RES T3C T3ST INT5 TOG3 SO Control 8-bit counter 3 RES Compare 3/1 Compare 3/2 Timer 3 - control TOG2 T3CO1 T3CO2 T3CM1 T3CM2 I/O-bus T3O Modulator 3 M2 SSI T2I P4CR T2M1 DCGO T2M2 TOG3 SYSCL T1OUT SCL T2O CL2/1 4-bit counter 2/1 RES OVF1 CL2/2 POUT DCG 8-bit counter 2/2 RES OVF2 TOG2 OUTPUT MOUT M2 INT4 Biphase-, Manchestermodulator SO T2C Compare 2/1 CM1 Timer 2 - control POUT Compare 2/2 T2CO1 I/O-bus SSI T2CM T2CO2 Timer 2 modulator 2 output-stage SSI Control (RE, FE, SCO, OMSK) 84 ATAR862-8 4589B–4BMCU–02/03 ATAR862-8 Combination Mode 10: Frequency Measurement or Event Counter with Time Gate Timer 2 mode 1/2: 12-bit compare counter/8-bit compare counter and 4-bit prescaler Timer 2 output mode 1/6: Timer 2 compare match toggles (TOG2) to the Timer 3 Timer 3 mode 3: Timer/Counter; internal trigger restart and internal capture (with Timer 2 TOG2-signal) The counter is driven by an external (T3I) clock source. The output signal (TOG2) of Timer 2 resets the counter. The counter value before reset is saved in the capture register. If single-action mode is activated for one or both compare registers, the trigger signal restarts also the single actions. This mode can be used for frequency measurements or as event counter with time gate. Figure 87. Frequency Measurement T3R T3I Counter 3 0 0 1 2 3 4 5 6 7 8 9 10 11121314151617 0 1 2 3 4 5 6 7 8 9 101112131415161718 0 1 2 3 4 5 TOG2 T3CPRegister Capture value = 0 Capture value = 17 Capt. value = 18 Figure 88. Event Counter with Time Gate T3R T3I Counter 3 TOG2 T3CPRegister Capture value = 0 Capture value = 11 Cap. val. = 4 0 0 1 2 3 4 5 6 7 8 9 10 11 01 2 3 4 012 Combination Mode 11: Burst Modulation 1 Timer 2 mode 1/2: 12-bit compare counter/8-bit compare counter and 4-bit prescaler Timer 2 output mode 1/6: Timer 2 compare match toggles the output flip-flop (M2) to the Timer 3 Timer 3 mode 6: Carrier frequency burst modulation controlled by Timer 2 output (M2) The Timer 3 counter is driven by an internal or external clock source. Its compare and compare mode registers must be programmed to generate the carrier frequency with the output toggle flip-flop. The output toggle flip-flop (M2) of Timer 2 is used to enable and disable the Timer 3 output. The Timer 2 can be driven by the toggle output signal of Timer 3 (TOG3) or any other clock source. 85 4589B–4BMCU–02/03 Figure 89. Burst Modulation 1 CL3 Counter 3 CM1 CM2 TOG3 M3 Counter 2/2 TOG2 M2 T3O 3 0 1 2 3 3 0 1 2 3 0 1 01 2 34 5 01 0 12 3 4 5 0 10 1 23 4 50 1 01 5 0 1 01 50 1 01 501 01 5 01 01 501 01 5 01 01 5 01 01 5 01 01 5 01 01 86 ATAR862-8 4589B–4BMCU–02/03 ATAR862-8 Combination Mode Timer 2, Timer 3 and SSI Figure 90. Combination Timer 2, Timer 3 and SSI I/O-bus T3CS T3I T3M T3EX T3I T3CP T3EX SYSCL T1OUT POUT CP3 CM31 RES CL3 SCI Demodulator 3 SI 8-bit Counter 3 T3C T3ST INT5 TOG3 SO Control RES Compare 3/1 Compare 3/2 T3O Modulator 3 Timer 3 - control M2 TOG2 T3CO1 T3CO2 T3CM1 T3CM2 I/O-bus SSI P4CR T2I T2M1 DCGO T2M2 TOG3 SYSCL T1OUT SCL T2C T2O CL2/1 4-bit Counter 2/1 RES OVF1 CL2/2 POUT DCG 8-bit Counter 2/2 RES OVF2 TOG2 OUTPUT MOUT M2 Compare 2/1 CM1 T2CO1 Timer 2 - control POUT T2CM Compare 2/2 INT4 T2CO2 SO Control Biphase-, Manchestermodulator I/O-bus SIC1 TOG2 Control SIC2 SISC (RE, FE, SCO, OMSK) Timer 2 modulator 2 output-stage INT3 SCLI SC MCL_SC POUT T1OUT SYSCL SSI-control SO Output SI Shift_CL MSB SCL MCL_SD SI 8-bit shift register LSB STB Transmit buffer I/O-bus SRB Receive buffer 87 4589B–4BMCU–02/03 Combination Mode 12: Burst Modulation 2 SSI mode 1: Timer 2 output mode 2: 8-bit shift register internal data output (SO) to the Timer 3 8-bit compare counter and 4-bit prescaler Timer 2 output mode 1/6: Timer 2 compare match toggles (TOG2) to the SSI Timer 3 mode 7: Carrier frequency burst modulation controlled by the internal output (SO) of SSI The Timer 3 counter is driven by an internal or external clock source. Its compare and compare mode registers must be programmed to generate the carrier frequency with the output toggle flip-flop (M3). The internal data output (SO) of the SSI is used to enable and disable the Timer 3 output. The SSI can be supplied with the toggle signal of Timer 2. Figure 91. Burst Modulation 2 CL3 Counter 3 CM31 CM32 TOG3 M3 Counter 2/2 TOG2 SO T3O 3 0 1 2 3 3 0 1 2 3 0 1 01 2 34 5 01 0 12 3 45 0 10 1 23 4 50 1 01 5 0 1 01 5 0 1 01 5 01 01 5 0 1 01 501 01 5 01 01 501 01 501 01 5 0 1 01 Combination Mode 13: FSK Modulation SSI mode 1: Timer 2 output mode 3: 8-bit shift register internal data output (SO) to the Timer 3 8-bit compare counter and 4-bit prescaler Timer 2 output mode 1/6: Timer 2 4-bit compare match signal (POUT) to the SSI Timer 3 mode 8: FSK modulation with shift register data output (SO) The two compare registers are used to generate two different time intervals. The SSI data output selects which compare register is used for the output frequency generation. A "0" level at the SSI data output enables the compare register 1 and a "1" level enables the compare register 2. The compare- and compare mode registers must be programmed to generate the two frequencies via the output toggle flip-flop. The SSI can be supplied with the toggle signal of Timer 2 or any other clock source. The Timer 3 counter is driven by an internal or external clock source. 88 ATAR862-8 4589B–4BMCU–02/03 ATAR862-8 Figure 92. FSK Modulation T3R 0123401234012340120120120120120120120123401 Counter 3 CM31 CM32 SO T3O 0 1 0 Microcontroller Block The microcontroller block is a multichip device which offers a combination of a MARC4based microcontroller and a serial E2PROM data memory in a single package. A microcontroller is used and as serial E2PROM the U505M. Two internal lines can be used as chip-to-chip link in a single package. The maximum internal data communication frequency between the microcontroller block and the U505M over the chip link (MCL_SC and MCL_SD) is fSC_MCL = 500 kHz. The microcontroller and the EEPROM portions of this multi-chip device are equivalent to their respective individual component chips, except for the electrical specification. Internal 2-wire Multi-chip Link Two additional on-chip pads (MCL_SC and MCL_SD) for the SC and the SD line can be used as chip-to-chip link for multi-chip applications. These pads can be activated by setting the MCL-bit in the SISC-register. Figure 93. Link between the Microcontroller Block and U505M U505M SCL SDA Multi chip link MCL_SC V DD BP40/SC MCL_SD V SS BP43/SD Microcontroller BP10 BP13 U505M EEPROM The U505M is a 512-bit EEPROM internally organized as 32 x 16-bits. The programming voltage as well as the write-cycle timing is generated on-chip. The U505M features a serial interface allowing operation on a simple two-wire bus with an MCL protocol. Its low power consumption makes it well suited for battery applications. 89 4589B–4BMCU–02/03 Figure 94. Block Diagram EEPROM Timing control HV-generator V DD V SS Address control EEPROM 32 x 16 Mode control 16-bit read/write buffer SCL I/O control SDA 8-bit data register Serial Interface The U505M has a two-wire serial interface (TWI) to the microcontroller for read and write accesses to the EEPROM. The U505M is considered to be a slave in all these applications. That means, the controller has to be the master that initiates the data transfer and provides the clock for transmit and receive operations. The serial interface is controlled by the microcontroller block which generates the serial clock and controls the access via the SCL-line and SDA-line. SCL is used to clock the data into and out of the device. SDA is a bi-directional line that is used to transfer data into and out of the device. The following protocol is used for the data transfers. Serial Protocol • • • • • Data states on the SDA-line changing only while SCL is low. Changes on the SDA-line while SCL is high are interpreted as START or STOP condition. A START condition is defined as high to low transition on the SDA-line while the SCL-line is high. A STOP condition is defined as low to high transition on the SDA-line while the SCLline is high. Each data transfer must be initialized with a START condition and terminated with a STOP condition. The START condition wakes the device from standby mode and the STOP condition returns the device to standby mode. A receiving device generates an acknowledge (A) after the reception of each byte. This requires an additional clock pulse, generated by the master. If the reception was successful the receiving master or slave device pulls down the SDA-line during that clock cycle. If an acknowledge is not detected (N) by the interface in transmit mode, it will terminate further data transmissions and go into receive mode. A master device must finish its read operation by a non-acknowledge and then send a stop condition to bring the device into a known state. • 90 ATAR862-8 4589B–4BMCU–02/03 ATAR862-8 Figure 95. MCL Protocol SCL SDA Stand Start by condition Data valid Data/ Data change acknowledge valid Stop Standcondition by • • Before the START condition and after the STOP condition the device is in standby mode and the SDA line is switched as input with pull-up resistor. The control byte that follows the START condition determines the following operation. It consists of the 5-bit row address, 2 mode control bits and the READ/NWRITE bit that is used to control the direction of the following transfer. A "0" defines a write access and a "1" a read access. Control Byte Format EEPROM Address Start A4 A3 A2 A1 A0 Mode Control Bits C1 C0 Read/ NWrite R/NW Ackn Start Control byte Ackn Data byte Ackn Data byte Ackn Stop EEPROM The EEPROM has a size of 512 bits and is organized as 32 x 16-bit matrix. To read and write data to and from the EEPROM the serial interface must be used. The interface supports one and two byte write accesses and one to n-byte read accesses to the EEPROM. The operating modes of the EEPROM are defined via the control byte. The control byte contains the row address, the mode control bits and the read/not-write bit that is used to control the direction of the following transfer. A "0" defines a write access and a "1" a read access. The five address bits select one of the 32 rows of the EEPROM memory to be accessed. For all accesses the complete 16-bit word of the selected row is loaded into a buffer. The buffer must be read or overwritten via the serial interface. The two mode control bits C1 and C2 define in which order the accesses to the buffer are performed: High byte – low byte or low byte – high byte. The EEPROM also supports autoincrement and autodecrement read operations. After sending the start address with the corresponding mode, consecutive memory cells can be read row by row without transmission of the row addresses. Two special control bytes enable the complete initialization of EEPROM with "0" or with "1". EEPROM – Operating Modes 91 4589B–4BMCU–02/03 Write Operations The EEPROM permits 8-bit and 16-bit write operations. A write access starts with the START condition followed by a write control byte and one or two data bytes from the master. It is completed via the STOP condition from the master after the acknowledge cycle. The programming cycle consists of an erase cycle (write "zeros") and the write cycle (write "ones"). Both cycles together take about 10 ms. Acknowledge Polling If the EEPROM is busy with an internal write cycle, all inputs are disabled and the EEPROM will not acknowledge until the write cycle is finished. This can be used to detect the end of the write cycle. The master must perform acknowledge polling by sending a start condition followed by the control byte. If the device is still busy with the write cycle, it will not return an acknowledge and the master has to generate a stop condition or perform further acknowledge polling sequences. If the cycle is complete, it returns an acknowledge and the master can proceed with the next read or write cycle. Write One Data Byte Start Control byte A Data byte 1 A Stop Write Two Data Bytes Start Control byte A Data byte 1 A Data byte 2 A Stop Write Control Byte Only Start Control byte A Stop Write Control Bytes MSB LSB A2 A1 A0 C1 0 C0 1 R/NW 0 Write low byte first A4 A3 Row address Byte order LB(R) HB(R) MSB LSB A2 A1 A0 C1 1 C0 0 R/NW 0 Write high byte first A4 A3 Row address Byte order HB(R) LB(R) A -> acknowledge; HB -> high byte; LB -> low byte; R -> row address Read Operations The EEPROM allows byte-, word- and current address read operations. The read operations are initiated in the same way as write operations. Every read access is initiated by sending the START condition followed by the control byte which contains the address and the read mode. When the device has received a read command, it returns an acknowledge, loads the addressed word into the read/write buffer and sends the selected data byte to the master. The master has to acknowledge the received byte if it wants to proceed the read operation. If two bytes are read out from the buffer the device increments respectively decrements the word address automatically and loads the buffer with the next word. The read mode bits determines if the low or high byte is read first from the buffer and if the word address is incremented or decremented for the next 92 ATAR862-8 4589B–4BMCU–02/03 ATAR862-8 read access. If the memory address limit is reached, the data word address will roll over and the sequential read will continue. The master can terminate the read operation after every byte by not responding with an acknowledge (N) and by issuing a stop condition. Read One Data Byte Start Control byte A Data byte 1 N Stop Read Two Data Bytes Start Control byte A Data byte 1 A Data byte 2 N Stop Read n Data Bytes Start Control byte A Data byte 1 A Data byte 2 A – Data byte n N Stop Read Control Bytes MSB LSB A2 A1 A0 C1 0 C0 1 R/NW 1 Read low byte first, address increment A4 A3 Row address Byte order LB(R) HB(R) LB(R+1) HB(R+1) --- LB(R+n) HB(R+n) MSB LSB A2 A1 A0 C1 1 C0 0 R/NW 1 Read high byte first, address decrement A4 A3 Row address Byte order HB(R) LB(R) HB(R-1) LB(R-1) --- HB(R-n) LB(R-n) A -> acknowledge, N -> no acknowledge; HB -> high byte; LB -> low byte, R -> row address Initialization After a Reset Condition The EEPROM with the serial interface has its own reset circuitry. In systems with microcontrollers that have their own reset circuitry for power-on reset, watchdog reset or brown-out reset, it may be necessary to bring the U505M into a known state independent of its internal reset. This is performed by writing: Start Control byte A Data byte 1 N Stop to the serial interface. If the U505M acknowledges this sequence it is in a defined state. Maybe it is necessary to perform this sequence twice. 93 4589B–4BMCU–02/03 Absolute Maximum Ratings Voltages are given relative to VSS Parameters Supply voltage Input voltage (on any pin) Output short circuit duration Operating temperature range Storage temperature range Soldering temperature (t £ 10 s) Note: Symbol VDD VIN tshort Tamb Tstg Tsld Value -0.3 to +4.0 VSS -0.3 £ VIN £ VDD +0.3 Indefinite -40 to +125 -40 to +130 260 Unit V V s °C °C °C Stresses greater than those listed under absolute maximum ratings may cause permanent damage to the device. This is a stress rating only and functional operation of the device at any condition above those indicated in the operational section of this specification is not implied. Exposure to absolute maximum rating condition for an extended period may affect device reliability. All inputs and outputs are protected against high electrostatic voltages or electric fields. However, precautions to minimize the build-up of electrostatic charges during handling are recommended. Reliability of operation is enhanced if unused inputs are connected to an appropriate logic voltage level (e.g., VDD). Thermal Resistance Parameter Thermal resistance (SSO20) Symbol RthJA Value 140 Unit K/W DC Operating Characteristics VSS = 0 V, Tamb = -40°C to +125°C unless otherwise specified. Parameters Power Supply Operating voltage at VDD Active current CPU active Power down current (CPU sleep, RC oscillator active, 4-MHz quartz oscillator active) Sleep current (CPU sleep, 32-kHz quartz oscillator active 4-MHz quartz oscillator inactive) Sleep current (CPU sleep, 32-kHz quartz oscillator inactive 4-MHz quartz oscillator inactive) Pin capacitance fSYSCL = 1 MHz VDD = 1.8 V VDD = 3.0 V fSYSCL = 1 MHz VDD = 1.8 V VDD = 3.0 V VDD = 1.8 V VDD = 3.0 V VDD VPOR 200 300 40 70 0.4 0.6 4.0 V Test Conditions Symbol Min. Typ. Max. Unit IDD 450 µA µA µA µA µA µA IPD 180 ISleep 2.3 VDD = 1.8 V VDD = 3.0 V ISleep 0.1 0.3 1.5 µA µA Any pin to VSS CL 7 10 pF 94 ATAR862-8 4589B–4BMCU–02/03 ATAR862-8 DC Operating Characteristics (Continued) VSS = 0 V, Tamb = -40°C to +125°C unless otherwise specified. Parameters Power-on Reset Threshold Voltage POR threshold voltage POR threshold voltage POR hysteresis BOT = 1 BOT = 0 VPOR VPOR VPOR VDD > VM, VMS = 1 VDD < VM, VMS = 0 VDD > VM, VMS = 1 VDD < VM, VMS = 0 VDD > VM, VMS = 1 VDD < VM, VMS = 0 VDD = 3 V, VMS = 1 VDD = 3 V, VMS = 0 VDD = 1.8 to 6.5 V VDD = 1.8 to 6.5 V VDD = 2.0 V, VDD = 3.0 V, VIL= VSS VDD = 2.0 V, VDD = 3.0 V, VIH = VDD VDD = 2.0 V VDD = 3.0 V, VIL= VSS VDD = 2.0 V VDD = 3.0 V, VIH= VDD VIL= VSS VIH= VDD VOL = 0.2 ´ VDD VDD = 2.0 V VDD = 3.0 V VOH = 0.8 ´ VDD VDD = 2.0 V VDD = 3.0 V VMThh VMThh VMThm VMThm VMThl VMThl VVMI VVMI VIL VIH IIL IIH IIL IIH IIL IIH IOL 0.5 2 -0.5 -2 1.2 5 -1.2 -5 1.2 VSS 0.8 ´ VDD -1.4 -7 1.4 7 -14 -60 14 60 -4 -20 4 20 -50 -160 50 160 1.97 2.36 2.75 1.6 1.85 1.7 2.0 50 3.0 3.0 2.6 2.6 2.2 2.2 1.3 1.3 0.2 ´ VDD VDD -12 -40 12 40 -100 -320 100 320 100 100 2.5 8 -2.5 -8 1.4 2.4 2.8 3.25 1.8 2.15 V V mV V V V V V V V V V V µA µA µA µA µA µA µA µA nA nA mA mA mA mA Test Conditions Symbol Min. Typ. Max. Unit Voltage Monitor Threshold Voltage VM high threshold voltage VM high threshold voltage VM middle threshold voltage VM middle threshold voltage VM low threshold voltage VM low threshold voltage External Input Voltage VMI VMI All Bi-directional Ports Input voltage LOW Input voltage HIGH Input LOW current (switched pull-up) Input HIGH current (switched pull-down) Input LOW current (static pull-up) Input LOW current (static pull-down) Input leakage current Input leakage current Output LOW current Output HIGH current IOH Note: The Pin BP20/NTE has a static pull-up resistor during the reset-phase of the microcontroller. 95 4589B–4BMCU–02/03 AC Characteristics Supply Voltage VDD = 2.0 V to 4.0 V, VSS = 0 V, Tamb = 25°C unless otherwise specified. Parameters Operation Cycle Time System clock cycle VDD = 2.0 V to 4.0 V Tamb = -40°C to +125°C VDD = 2.4 V to 4.0 V Tamb = -40°C to +125°C tSYSCL tSYSCL 500 250 4000 4000 ns ns Test Conditions Symbol Min. Typ. Max. Unit Timer 2 input Timing Pin T2I Timer 2 input clock Timer 2 input LOW time Timer 2 input HIGH time Rise/fall time < 10 ns Rise/fall time < 10 ns fT2I tT2IL tT2IH fT3I Rise/fall time < 10 ns Rise/fall time < 10 ns Rise/fall time < 10 ns Rise/fall time < 10 ns Rise/fall time < 10 ns Rise/fall time < 10 ns Rise/fall time < 10 ns VDD > VPOR tT3IL tT3IH tIRL tIRH fEXSCL fEXSCL tIH tPOR fRcOut1 VDD = 2.0 V to 4.0 V Tamb = -40°C to +105°C Rext = 170 kW VDD = 2.0 V to 4.0 V Tamb = -40°C to +105°C Df/f 2 tSYSCL 2 tSYSCL 100 100 0.5 0.02 0.1 1.5 3.8 ±50 5 4 4 100 100 SYSCL/2 5 MHz ns ns MHz ns ns ns ns MHz MHz µs ms MHz % Timer 3 Input Timing Pin T3I Timer 3 input clock Timer 3 input LOW time Timer 3 input HIGH time Interrupt Request Input Timing Interrupt request LOW time Interrupt request HIGH time External System Clock EXSCL at OSC1, ECM = EN EXSCL at OSC1, ECM = DI Input HIGH time Reset Timing Power-on reset time RC Oscillator 1 Frequency Stability RC Oscillator 2 – External Resistor Frequency Stability Stabilization time fRcOut2 Df/f tS fX tSQ Df/f CIN/COUT programmable in steps of 2 pF CIN COUT -10 0 0 4 5 10 20 20 4 ±15 10 MHz % µs MHz ms ppm pF pF 4-MHz Crystal Oscillator (Operating Range VDD = 2.2 V to 4.0 V) Frequency Start-up time Stability Integrated input/output capacitances (mask programmable) 96 ATAR862-8 4589B–4BMCU–02/03 ATAR862-8 AC Characteristics (Continued) Supply Voltage VDD = 2.0 V to 4.0 V, VSS = 0 V, Tamb = 25°C unless otherwise specified. Parameters Frequency Start-up time Stability Integrated input/output capacitances (mask programmable) CIN/COUT programmable in steps of 2 pF Test Conditions Symbol fX tSQ Df/f CIN COUT fX RS C0 C1 fX RS C0 C1 IWR Min. Typ. 32.768 0.5 Max. Unit kHz s 32-kHz Crystal Oscillator (Operating Range VDD = 2.0 V to 4.0 V) -10 0 0 32.768 30 1.5 3 4.0 40 1.4 3 600 500,000 50,000 1,000,000 100,000 10 20 20 ppm pF pF kHz External 32-kHz Crystal Parameters Crystal frequency Serial resistance Static capacitance Dynamic capacitance 50 kW pF fF MHz 150 3 W pF fF 1300 µA Cycles Cycles 12 ms Years Years 0.2 0.2 100 500 ms ms kHz External 4-MHz Crystal Parameters Crystal frequency Serial resistance Static capacitance Dynamic capacitance EEPROM Operating current during erase/write cycle Endurance Data erase/write cycle time Data retention time Tamb = 105°C Power-up to read operation Power-up to write operation Erase-/write cycles Tamb = 105°C For 16-bit access ED ED tDEW tDR tDR tPUR tPUW fSC_MCL 9 100 1 Serial Interface SCL clock frequency Crystal Characteristics Figure 96. Crystal Equivalent Circuit L Equivalent circuit OSCIN SCLIN OSCOUT SCLOUT C1 RS C0 97 4589B–4BMCU–02/03 Ordering Information Please select the option settings from the list below and insert ROM CRC. Output Port 1 BP10 [ ] CMOS [ ] Open drain [N] [ ] Open drain [P] BP13 [ ] CMOS [ ] Open drain [N] [ ] Open drain [P] [ [ [ [ [ [ [ [ ] ] ] ] ] ] ] ] Switched pull-up Switched pull-down Static pull-up Static pull-down Switched pull-up Switched pull-down Static pull-up Static pull-down Input Port 5 Output BP50 [ ] CMOS [ ] Open drain [N] [ ] Open drain [P] BP51 [ ] CMOS [ ] Open drain [N] [ ] Open drain [P] BP52 [ ] CMOS [ ] Open drain [N] [ ] Open drain [P] BP53 [ ] CMOS [ ] Open drain [N] [ ] Open drain [P] [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] Input Switched pull-up Switched pull-down Static pull-up Static pull-down Switched pull-up Switched pull-down Static pull-up Static pull-down Switched pull-up Switched pull-down Static pull-up Static pull-down Switched pull-up Switched pull-down Static pull-up Static pull-down Switched pull-up Switched pull-down Static pull-up Static pull-down Switched pull-up Switched pull-down Static pull-up Static pull-down Port 2 BP20 [ ] CMOS [ ] Open drain [N] [ ] Open drain [P] BP21 [ ] CMOS [ ] Open drain [N] [ ] Open drain [P] BP22 [ ] CMOS [ ] Open drain [N] [ ] Open drain [P] BP23 [ ] CMOS [ ] Open drain [N] [ ] Open drain [P] [ ] Switched pull-up [ ] Switched pull-down [ ] Static pull-up [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] Switched pull-up Switched pull-down Static pull-up Static pull-down Switched pull-up Switched pull-down Static pull-up Static pull-down Switched pull-up Switched pull-down Static pull-up Static pull-down Switched pull-up Switched pull-down Static pull-up Static pull-down Switched pull-up Switched pull-down Static pull-up Static pull-down Switched pull-up Switched pull-down Static pull-up Static pull-down Switched pull-up Switched pull-down Static pull-up Static pull-down Port 6 BP60 [ ] CMOS [ ] Open drain [N] [ ] Open drain [P] BP63 [ ] CMOS [ ] Open drain [N] [ ] Open drain [P] Port 4 BP40 [ ] CMOS [ ] Open drain [N] [ ] Open drain [P] BP41 [ ] CMOS [ ] Open drain [N] [ ] Open drain [P] BP42 [ ] CMOS [ ] Open drain [N] [ ] Open drain [P] BP43 [ ] CMOS [ ] Open drain [N] [ ] Open drain [P] OSC1 [ ] No integrated capacitance [ ] Internal capacitance (0 to 20 pF) [ _____pF] OSC2 [ ] No integrated capacitance [ ] Internal capacitance (0 to 20 pF) [ _____pF] Clock Used [ [ [ [ ] ] ] ] External resistor External clock 32-kHz crystal 4-MHz crystal ECM (External Clock Monitor) [ ] Enable [ ] Disable File: _____________________ . HEX Aproval Date: _________________ CRC: ____________________ . HEX Signature: _________________________ 98 ATAR862-8 4589B–4BMCU–02/03 ATAR862-8 Ordering Information Extended Type Number ATAR862M-xxxR4-TNQ Package SSO24 Remarks 429 MHz to 439 MHz Package Information Package SSO24 Dimensions in mm 8.05 7.80 5.7 5.3 4.5 4.3 1.30 0.25 0.65 7.15 24 13 0.15 0.05 0.15 6.6 6.3 technical drawings according to DIN specifications 1 12 99 4589B–4BMCU–02/03 Table of Contents Features ................................................................................................. 1 Description ............................................................................................ 1 Pin Configuration .................................................................................. 2 Pin Description: RF Part ...................................................................... 2 Pin Description: Microcontroller Part ................................................. 3 UHF ASK/FSK Transmitter Block ........................................................ 4 Features ................................................................................................. 4 Description ............................................................................................ 4 General Description .............................................................................. 6 Functional Description ......................................................................... 6 ASK Transmission ................................................................................................6 FSK Transmission ................................................................................................6 CLK Output ...........................................................................................................7 Clock Pulse Take Over ...................................................................................7 Output Matching and Power Setting ...............................................................7 Application Circuit .................................................................................................8 Absolute Maximum Ratings ............................................................... 11 Thermal Resistance ............................................................................ 11 Electrical Characteristics ................................................................... 11 Microcontroller Block ......................................................................... 13 Features ............................................................................................... 13 Description .......................................................................................... 13 Introduction ......................................................................................... 14 MARC4 Architecture General Description ........................................ 14 Components of MARC4 Core ............................................................ 14 ROM ...................................................................................................................15 RAM ....................................................................................................................15 Expression Stack ..........................................................................................15 100 ATAR862-8 4589B–4BMCU–02/03 ATAR862-8 Return Stack .................................................................................................15 Registers .............................................................................................................16 Program Counter (PC) ..................................................................................16 RAM Address Registers ................................................................................17 Expression Stack Pointer (SP) ......................................................................17 Return Stack Pointer (RP) ............................................................................17 RAM Address Registers (X and Y) ...............................................................17 Top of Stack (TOS) .......................................................................................17 Condition Code Register (CCR) ....................................................................17 Carry/Borrow (C) ...........................................................................................17 Branch (B) .....................................................................................................17 Interrupt Enable (I) ........................................................................................17 ALU .....................................................................................................................18 I/O Bus ................................................................................................................18 Instruction Set .....................................................................................................18 Interrupt Structure ...............................................................................................18 Interrupt Processing ......................................................................................19 Interrupt Latency ...........................................................................................19 Software Interrupts .............................................................................................20 Hardware Interrupts ............................................................................................20 Master Reset ....................................................................................... 21 Power-on Reset and Brown-out Detection .........................................................21 Watchdog Reset ...........................................................................................22 External Clock Supervisor .............................................................................22 Voltage Monitor ................................................................................... 22 Voltage Monitor Control/ Status Register ......................................................23 Clock Generation ................................................................................ 24 Clock Module ......................................................................................................24 Oscillator Circuits and External Clock Input Stage .............................................25 RC-oscillator 1 Fully Integrated .....................................................................25 External Input Clock ......................................................................................26 RC-oscillator 2 with External Trimming Resistor ...........................................26 4-MHz Oscillator ...........................................................................................27 32-kHz Oscillator ...........................................................................................27 Clock Management .............................................................................................28 Clock Management Register (CM) ................................................................28 System Configuration Register (SC) .............................................................29 Power-down Modes ............................................................................ 29 Peripheral Modules ............................................................................. 30 Addressing Peripherals .......................................................................................30 101 4589B–4BMCU–02/03 Bi-directional Ports ............................................................................. 33 Bi-directional Port 1 ............................................................................................33 Bi-directional Port 2 ............................................................................................34 Port 2 Data Register (P2DAT) ......................................................................35 Port 2 Control Register (P2CR) ....................................................................35 Bi-directional Port 5 ............................................................................................35 Port 5 Data Register (P5DAT) ......................................................................36 Port 5 Control Register (P5CR) Byte Write ...................................................36 Bi-directional Port 4 ............................................................................................37 Port 4 Data Register (P4DAT) ......................................................................38 Port 4 Control Register (P4CR) Byte Write ...................................................38 Bi-directional Port 6 ............................................................................................38 Port 6 Data Register (P6DAT) ......................................................................39 Port 6 Control Register (P6CR) ....................................................................39 Universal Timer/Counter/ Communication Module (UTCM) ...............................39 Timer 1 ................................................................................................................40 Timer 1 Control Register 1 (T1C1) ................................................................42 Timer 1 Control Register 2 (T1C2) ................................................................43 Watchdog Control Register (WDC) ...............................................................43 Timer 2 ................................................................................................................44 Timer 2 Modes ....................................................................................................45 Mode 1: 12-bit Compare Counter .................................................................45 Mode 2: 8-bit Compare Counter with 4-bit Programmable Prescaler ...........45 Mode 3/4: 8-bit Compare Counter and 4-bit Programmable Prescaler .........46 Timer 2 Output Modes ........................................................................................46 Timer 2 Output Signals .......................................................................................47 Timer 2 Output Mode 1 .................................................................................47 Timer 2 Output Mode 2 .................................................................................48 Timer 2 Output Mode 3 .................................................................................48 Timer 2 Output Mode 4 .................................................................................49 Timer 2 Output Mode 5 .................................................................................49 Timer 2 Output Mode 7 .................................................................................49 Timer 2 Registers ...............................................................................................50 Timer 2 Control Register (T2C) .....................................................................50 Timer 2 Mode Register 1 (T2M1) ..................................................................51 Duty Cycle Generator ...................................................................................51 Timer 2 Mode Register 2 (T2M2) ..................................................................52 Timer 2 Compare and Compare Mode Registers .........................................53 Timer 2 Compare Mode Register (T2CM) ....................................................53 Timer 2 COmpare Register 1 (T2CO1) .........................................................53 Timer 2 COmpare Register 2 (T2CO2) Byte Write .......................................54 Timer 3 ................................................................................................. 54 Features ........................................................................................................54 Timer/Counter Modes .........................................................................................55 Timer 3 – Mode 1: Timer/Counter .................................................................56 102 ATAR862-8 4589B–4BMCU–02/03 ATAR862-8 Timer 3 – Mode 2: Timer/Counter, External Trigger Restart and External Capture (with T3I Input) .....................................................57 Timer 3 – Mode 3: Timer/Counter, Internal Trigger Restart and Internal Capture (with TOG2) .........................................................58 Timer 3 – Mode 4: Timer/Counter .................................................................58 Timer 3 – Mode 5: Timer/Counter, External Trigger Restart and External Capture (with T3I Input) .....................................................58 Timer 3 Modulator/Demodulator Modes .............................................................58 Timer 3 – Mode 6: Carrier Frequency Burst Modulation Controlled by Timer 2 Output Toggle Flip-Flop (M2) ...............................58 Timer 3 – Mode 7: Carrier Frequency Burst Modulation Controlled by SSI Internal Output (SO) ...................................................59 Timer 3 – Mode 8: FSK Modulation with Shift Register Data (SO) ...............59 Timer 3 – Mode 9: Pulse-width Modulation with the Shift Register ...............59 Timer 3 – Mode 10: Manchester Demodulation/ Pulse-width Demodulation 60 Timer 3 – Mode 11: Biphase Demodulation ..................................................60 Timer 3 – Mode 12: Timer/Counter with External Capture Mode (T3I) .........61 Timer 3 Modulator for Carrier Frequency Burst Modulation ...............................61 Timer 3 Demodulator for Biphase, Manchester and Pulse-width-modulated Signals ....................................................................................................61 Timer 3 Registers ...............................................................................................62 Timer 3 Mode Register (T3M) .......................................................................62 Timer 3 Control Register 1 (T3C) Write ........................................................63 Timer 3 Status Register 1 (T3ST) Read .......................................................63 Timer 3 Clock Select Register (T3CS) ..........................................................63 Timer 3 Compare- and Compare-mode Register .........................................64 Timer 3 Compare-Mode Register 1 (T3CM1) ...............................................64 Timer 3 Compare Mode Register 2 (T3CM2) ...............................................65 Timer 3 COmpare Register 1 (T3CO1) Byte Write .......................................65 Timer 3 COmpare Register 2 (T3CO2) Byte Write .......................................65 Timer 3 Capture Register ...................................................................................66 Timer 3 CaPture Register (T3CP) Byte Read ...............................................66 Synchronous Serial Interface (SSI) ....................................................................66 SSI Peripheral Configuration ........................................................................66 General SSI Operation ..................................................................................67 8-bit Synchronous Mode ...............................................................................68 9-bit Shift Mode (MCL) ..................................................................................70 8-bit Pseudo MCL Mode ...............................................................................71 MCL Bus Protocol .........................................................................................72 SSI Interrupt ..................................................................................................73 Modulation and Demodulation ......................................................................73 Internal 2-wire Multi-chip Link .......................................................................73 Serial Interface Registers ...................................................................................74 Serial Interface Control Register 1 (SIC1) ....................................................74 Serial Interface Control Register 2 (SIC2) ....................................................75 Serial Interface Status and Control Register (SISC) .....................................76 Serial Transmit Buffer (STB) – Byte Write ....................................................76 103 4589B–4BMCU–02/03 Serial Receive Buffer (SRB) – Byte Read .....................................................76 Combination Modes ........................................................................... 77 Combination Mode Timer 2 and SSI ...................................................................77 Combination Mode 1: Burst Modulation ........................................................78 Combination Mode 2: Biphase Modulation 1 ................................................78 Combination Mode 3: Manchester Modulation 1 ..........................................79 Combination Mode 4: Manchester Modulation 2 ..........................................79 Combination Mode 5: Biphase Modulation 2 ................................................80 Combination Mode Timer 3 and SSI ...................................................................81 Combination Mode 6: FSK Modulation .........................................................81 Combination Mode 7: Pulse-width Modulation (PWM) .................................82 Combination Mode 8: Manchester Demodulation/Pulse-width Demodulation ...............................................................82 Combination Mode 9: Biphase Demodulation ...............................................83 Combination Mode Timer 2 and Timer 3 ............................................................84 Combination Mode 10: Frequency Measurement or Event Counter with Time Gate ....................................................................85 Combination Mode 11: Burst Modulation 1 ...................................................85 Combination Mode Timer 2, Timer 3 and SSI ....................................................87 Combination Mode 12: Burst Modulation 2 ...................................................88 Combination Mode 13: FSK Modulation .......................................................88 Microcontroller Block ......................................................................... 89 Internal 2-wire Multi-chip Link .......................................................................89 U505M EEPROM ................................................................................................89 Serial Interface ....................................................................................................90 Serial Protocol ...............................................................................................90 Control Byte Format ......................................................................................91 EEPROM ............................................................................................................91 EEPROM – Operating Modes .......................................................................91 Write Operations ...........................................................................................92 Acknowledge Polling .....................................................................................92 Write One Data Byte .....................................................................................92 Write Two Data Bytes ...................................................................................92 Write Control Byte Only ................................................................................92 Write Control Bytes .......................................................................................92 Read Operations ...........................................................................................92 Read One Data Byte .....................................................................................93 Read Two Data Bytes ...................................................................................93 Read n Data Bytes ........................................................................................93 Read Control Bytes .......................................................................................93 Initialization After a Reset Condition ...................................................................93 Absolute Maximum Ratings ............................................................... 94 104 ATAR862-8 4589B–4BMCU–02/03 ATAR862-8 Thermal Resistance ............................................................................ 94 DC Operating Characteristics ............................................................ 94 AC Characteristics .............................................................................. 96 Crystal Characteristics ....................................................................... 97 Ordering Information .......................................................................... 98 Ordering Information .......................................................................... 99 Package Information ......................................................................... 99 Table of Contents ............................................................................. 100 105 4589B–4BMCU–02/03 Atmel Headquarters Corporate Headquarters 2325 Orchard Parkway San Jose, CA 95131 TEL 1(408) 441-0311 FAX 1(408) 487-2600 Atmel Operations Memory 2325 Orchard Parkway San Jose, CA 95131 TEL 1(408) 441-0311 FAX 1(408) 436-4314 RF/Automotive Theresienstrasse 2 Postfach 3535 74025 Heilbronn, Germany TEL (49) 71-31-67-0 FAX (49) 71-31-67-2340 1150 East Cheyenne Mtn. Blvd. Colorado Springs, CO 80906 TEL 1(719) 576-3300 FAX 1(719) 540-1759 Europe Atmel Sarl Route des Arsenaux 41 Case Postale 80 CH-1705 Fribourg Switzerland TEL (41) 26-426-5555 FAX (41) 26-426-5500 Microcontrollers 2325 Orchard Parkway San Jose, CA 95131 TEL 1(408) 441-0311 FAX 1(408) 436-4314 La Chantrerie BP 70602 44306 Nantes Cedex 3, France TEL (33) 2-40-18-18-18 FAX (33) 2-40-18-19-60 Biometrics/Imaging/Hi-Rel MPU/ High Speed Converters/RF Datacom Avenue de Rochepleine BP 123 38521 Saint-Egreve Cedex, France TEL (33) 4-76-58-30-00 FAX (33) 4-76-58-34-80 Asia Room 1219 Chinachem Golden Plaza 77 Mody Road Tsimhatsui East Kowloon Hong Kong TEL (852) 2721-9778 FAX (852) 2722-1369 ASIC/ASSP/Smart Cards Zone Industrielle 13106 Rousset Cedex, France TEL (33) 4-42-53-60-00 FAX (33) 4-42-53-60-01 1150 East Cheyenne Mtn. Blvd. Colorado Springs, CO 80906 TEL 1(719) 576-3300 FAX 1(719) 540-1759 Scottish Enterprise Technology Park Maxwell Building East Kilbride G75 0QR, Scotland TEL (44) 1355-803-000 FAX (44) 1355-242-743 Japan 9F, Tonetsu Shinkawa Bldg. 1-24-8 Shinkawa Chuo-ku, Tokyo 104-0033 Japan TEL (81) 3-3523-3551 FAX (81) 3-3523-7581 e-mail literature@atmel.com Web Site http://www.atmel.com © Atmel Corporation 2003. Atmel Corporation makes no warranty for the use of its products, other than those expressly contained in the Company’s standard warranty which is detailed in Atmel’s Terms and Conditions located on the Company’s web site. The Company assumes no responsibility for any errors which may appear in this document, reserves the right to change devices or specifications detailed herein at any time without notice, and does not make any commitment to update the information contained herein. No licenses to patents or other intellectual property of Atmel are granted by the Company in connection with the sale of Atmel products, expressly or by implication. Atmel’s products are not authorized for use as critical components in life support devices or systems. Atmel ® is the registered trademark of Atmel. Other terms and product names may be the trademarks of others. Printed on recycled paper. 4589B–4BMCU–02/03 xM
ATAR862M-XXXR4-TNQ 价格&库存

很抱歉,暂时无法提供与“ATAR862M-XXXR4-TNQ”相匹配的价格&库存,您可以联系我们找货

免费人工找货