ST72321Rx ST72321ARx ST72321Jx 64/44-pin 8-bit MCU with 32 to 60K Flash/ROM, ADC, five timers, SPI, SCI, I2C interface Features ■ ■ ■ ■ ■ Memories – 32K to 60K dual voltage High Density Flash (HDFlash) or ROM with read-out protection capability.
Table of Contents 1 DESCRIPTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2 PIN DESCRIPTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 3 REGISTER & MEMORY MAP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 4 FLASH PROGRAM MEMORY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table of Contents 8.4 ACTIVE-HALT AND HALT MODES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 8.4.1 ACTIVE-HALT MODE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.4.2 HALT MODE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 I/O PORTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table of Contents 10.5.3 General Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.5.4 Clock Phase and Clock Polarity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.5.5 Error Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.5.6 Low Power Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.5.
Table of Contents 12.2.1 Voltage Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12.2.2 Current Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12.2.3 Thermal Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12.3 OPERATING CONDITIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table of Contents 14.1 FLASH OPTION BYTES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 14.2 DEVICE ORDERING INFORMATION AND TRANSFER OF CUSTOMER CODE . . . . . 177 14.3 DEVELOPMENT TOOLS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181 14.3.1 Starter kits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14.3.
ST72321Rx ST72321ARx ST72321Jx 1 DESCRIPTION The ST72F321 Flash and ST72321 ROM devices are members of the ST7 microcontroller family designed for mid-range applications. All devices are based on a common industrystandard 8-bit core, featuring an enhanced instruction set and are available with Flash or ROM program memory. The ST7 family architecture offers both power and flexibility to software developers, enabling the design of highly efficient and compact application code.
ST72321Rx ST72321ARx ST72321Jx 2 PIN DESCRIPTION PE3 PE2 PE1 / RDI PE0 / TDO VDD_2 OSC1 OSC2 VSS_2 TLI EVD RESET VPP / ICCSEL PA7 (HS) / SCLI PA6 (HS) / SDAI PA5 (HS) PA4 (HS) Figure 2.
ST72321Rx ST72321ARx ST72321Jx PE0 / TDO VDD_2 OSC1 OSC2 VSS_2 RESET VPP / ICCSEL PA7 (HS)/ SCLI PA6 (HS) / SDAI PA5 (HS) PA4 (HS) Figure 3.
ST72321Rx ST72321ARx ST72321Jx PIN DESCRIPTION (Cont’d) For external pin connection guidelines, refer to See “ELECTRICAL CHARACTERISTICS” on page 138. Legend / Abbreviations for Table 2 : Type: I = input, O = output, S = supply Input level: A = Dedicated analog input In/Output level: C = CMOS 0.3VDD/0.7VDD CT= CMOS 0.3VDD/0.7VDD with input trigger TT= TTL 0.
ST72321Rx ST72321ARx ST72321Jx Pin n° - VDD_3 S Digital Main Supply Voltage 24 - - VSS_3 S Digital Ground Voltage 25 15 3 PF0/MCO/AIN8 I/O CT 26 16 4 PF1 (HS)/BEEP 27 17 - PF2 (HS) I/O CT I/O CT 28 - - PF3/OCMP2_A/AIN9 I/O CT X X 29 18 5 PF4/OCMP1_A/ AIN10 I/O CT X 30 - - PF5/ICAP2_A/AIN11 I/O CT 31 19 6 PF6 (HS)/ICAP1_A I/O CT 32 20 7 PF7 (HS)/EXTCLK_A I/O CT 33 21 - VDD_0 S Digital Main Supply Voltage 34 22 - VSS_0 S Digital Ground Voltage 35
ST72321Rx ST72321ARx ST72321Jx 48 33 49 34 - VDD_1 - VSS_1 17 PA4 (HS) HS X ei0 PP 16 PA3 (HS) ei0 Main function Output (after reset) OD 32 X int 31 I/O CT I/O CT Input wpu 46 47 PA2 Port float - Output LQFP32 - Input LQFP44 45 Pin Name Type LQFP64 Level ana Pin n° X X Port A2 X X Port A3 S Alternate function Digital Main Supply Voltage S Digital Ground Voltage I/O CT HS X X X X Port A4 X X X Port A5 50 35 PA5 (HS) I/O CT HS X 51 36 18 PA
ST72321Rx ST72321ARx ST72321Jx ISTICS for more details. 3. OSC1 and OSC2 pins connect a crystal/ceramic resonator, or an external source to the on-chip oscillator; see Section 1 DESCRIPTION and Section 12.5 CLOCK AND TIMING CHARACTERISTICS for more details. 4. On the chip, each I/O port may have up to 8 pads: – ads that are not bonded to external pins are forced by hardware in input pull-up configuration after reset.
ST72321Rx ST72321ARx ST72321Jx 3 REGISTER & MEMORY MAP As shown in Figure 4, the MCU is capable of addressing 64K bytes of memories and I/O registers. The available memory locations consist of 128 bytes of register locations, up to 2Kbytes of RAM and up to 60Kbytes of user program memory. The RAM space includes up to 256 bytes for the stack from 0100h to 01FFh. The highest address bytes contain the user reset and interrupt vectors. IMPORTANT: Memory locations marked as “Reserved” must never be accessed.
ST72321Rx ST72321ARx ST72321Jx Table 3.
ST72321Rx ST72321ARx ST72321Jx Address Block 002Ah WATCHDOG 002Bh 002Ch 002Dh MCC Register Label WDGCR Watchdog Control Register SICSR System Integrity Control/Status Register MCCSR MCCBCR Main Clock Control / Status Register Main Clock Controller: Beep Control Register 002Eh to 0030h 0031h 0032h 0033h 0034h 0035h 0036h 0037h 0038h 0039h 003Ah 003Bh 003Ch 003Dh 003Eh 003Fh 0050h 0051h 0052h 0053h 0054h 0055h 0056h 0057h 16/193 Reset Status 7Fh Remarks R/W 000x 000x b R/W 00h 00h R/W R/W
ST72321Rx ST72321ARx ST72321Jx Address Block Register Label 0058h to 006Fh 0070h 0071h 0072h 007Bh 007Ch 007Dh Reset Status Remarks Reserved Area (24 Bytes) ADC 0073h 0074h 0075h 0076h 0077h 0078h 0079h 007Ah Register Name PWM ART ADCCSR ADCDRH ADCDRL Control/Status Register Data High Register Data Low Register 00h 00h 00h R/W Read Only Read Only PWMDCR3 PWMDCR2 PWMDCR1 PWMDCR0 PWMCR ARTCSR ARTCAR ARTARR ARTICCSR ARTICR1 ARTICR2 PWM AR Timer Duty Cycle Register 3 PWM AR Timer Duty Cycle Re
ST72321Rx ST72321ARx ST72321Jx 4 FLASH PROGRAM MEMORY 4.1 Introduction The ST7 dual voltage High Density Flash (HDFlash) is a non-volatile memory that can be electrically erased as a single block or by individual sectors and programmed on a Byte-by-Byte basis using an external VPP supply. The HDFlash devices can be programmed and erased off-board (plugged in a programming tool) or on-board using ICP (In-Circuit Programming) or IAP (In-Application Programming).
ST72321Rx ST72321ARx ST72321Jx FLASH PROGRAM MEMORY (Cont’d) – – – – ICCCLK: ICC output serial clock pin ICCDATA: ICC input/output serial data pin ICCSEL/VPP: programming voltage OSC1(or OSCIN): main clock input for external source (optional) – VDD: application board power supply (optional, see Figure 6, Note 3) 4.4 ICC Interface ICC needs a minimum of 4 and up to 6 pins to be connected to the programming tool (see Figure 6).
ST72321Rx ST72321ARx ST72321Jx FLASH PROGRAM MEMORY (Cont’d) 4.5 ICP (In-Circuit Programming) To perform ICP the microcontroller must be switched to ICC (In-Circuit Communication) mode by an external controller or programming tool. Depending on the ICP code downloaded in RAM, Flash memory programming can be fully customized (number of bytes to program, program locations, or selection serial communication interface for downloading).
ST72321Rx ST72321ARx ST72321Jx 5 CENTRAL PROCESSING UNIT 5.1 INTRODUCTION 5.3 CPU REGISTERS This CPU has a full 8-bit architecture and contains six internal registers allowing efficient 8-bit data manipulation. The six CPU registers shown in Figure 1 are not present in the memory mapping and are accessed by specific instructions. Accumulator (A) The Accumulator is an 8-bit general purpose register used to hold operands and the results of the arithmetic and logic calculations and to manipulate data.
ST72321Rx ST72321ARx ST72321Jx CENTRAL PROCESSING UNIT (Cont’d) Condition Code Register (CC) Read/Write Reset Value: 111x1xxx Bit 1 = Z Zero. 7 1 0 1 I1 H I0 N Z C The 8-bit Condition Code register contains the interrupt masks and four flags representative of the result of the instruction just executed. This register can also be handled by the PUSH and POP instructions. These bits can be individually tested and/or controlled by specific instructions.
ST72321Rx ST72321ARx ST72321Jx CENTRAL PROCESSING UNIT (Cont’d) Stack Pointer (SP) Read/Write Reset Value: 01 FFh 15 0 8 0 0 0 0 0 0 7 SP7 1 0 SP6 SP5 SP4 SP3 SP2 SP1 SP0 The Stack Pointer is a 16-bit register which is always pointing to the next free location in the stack. It is then decremented after data has been pushed onto the stack and incremented before data is popped from the stack (see Figure 2). Since the stack is 256 bytes deep, the 8 most significant bits are forced by hardware.
ST72321Rx ST72321ARx ST72321Jx 6 SUPPLY, RESET AND CLOCK MANAGEMENT 6.1 PHASE LOCKED LOOP The device includes a range of utility features for securing the application in critical situations (for example in case of a power brown-out), and reducing the number of external components. An overview is shown in Figure 11. For more details, refer to dedicated parametric section.
ST72321Rx ST72321ARx ST72321Jx 6.2 MULTI-OSCILLATOR (MO) Table 5. ST7 Clock Sources External Clock Hardware Configuration Crystal/Ceramic Resonators External Clock Source In this external clock mode, a clock signal (square, sinus or triangle) with ~50% duty cycle has to drive the OSC1 pin while the OSC2 pin is tied to ground. Crystal/Ceramic Oscillators This family of oscillators has the advantage of producing a very accurate rate on the main clock of the ST7.
ST72321Rx ST72321ARx ST72321Jx 6.3 RESET SEQUENCE MANAGER (RSM) 6.3.1 Introduction The reset sequence manager includes three RESET sources as shown in Figure 13: ■ External RESET source pulse ■ Internal LVD RESET (Low Voltage Detection) ■ Internal WATCHDOG RESET These sources act on the RESET pin and it is always kept low during the delay phase. The RESET service routine vector is fixed at addresses FFFEh-FFFFh in the ST7 memory map.
ST72321Rx ST72321ARx ST72321Jx RESET SEQUENCE MANAGER (Cont’d) The RESET pin is an asynchronous signal which plays a major role in EMS performance. In a noisy environment, it is recommended to follow the guidelines mentioned in the electrical characteristics section. If the external RESET pulse is shorter than tw(RSTL)out (see short ext. Reset in Figure 14), the signal on the RESET pin may be stretched. Otherwise the delay will not be applied (see long ext. Reset in Figure 14).
ST72321Rx ST72321ARx ST72321Jx 6.4 SYSTEM INTEGRITY MANAGEMENT (SI) The System Integrity Management block contains the Low Voltage Detector (LVD), Auxiliary Voltage Detector (AVD) functions. It is managed by the SICSR register. 6.4.1 Low Voltage Detector (LVD) The Low Voltage Detector function (LVD) generates a static reset when the VDD supply voltage is below a VIT- reference value. This means that it secures the power-up as well as the power-down keeping the ST7 in reset.
ST72321Rx ST72321ARx ST72321Jx SYSTEM INTEGRITY MANAGEMENT (Cont’d) 6.4.2 Auxiliary Voltage Detector (AVD) The Voltage Detector function (AVD) is based on an analog comparison between a VIT-(AVD) and VIT+(AVD) reference value and the VDD main supply or the external EVD pin voltage level (VEVD). The VIT- reference value for falling voltage is lower than the VIT+ reference value for rising voltage in order to avoid parasitic detection (hysteresis).
ST72321Rx ST72321ARx ST72321Jx SYSTEM INTEGRITY MANAGEMENT (Cont’d) 6.4.2.2 Monitoring a Voltage on the EVD pin This mode is selected by setting the AVDS bit in the SICSR register. The AVD circuitry can generate an interrupt when the AVDIE bit of the SICSR register is set. This interrupt is generated on the rising and falling edges of the comparator output.
ST72321Rx ST72321ARx ST72321Jx SYSTEM INTEGRITY MANAGEMENT (Cont’d) 6.4.4 Register Description SYSTEM INTEGRITY (SI) CONTROL/STATUS REGISTER (SICSR) Read/Write set) and cleared by software (writing zero). See WDGRF flag description for more details. When Reset Value: 000x 000x (00h) the LVD is disabled by OPTION BYTE, the LVDRF bit value is undefined. 7 0 AVD S AVD IE AVD F LVD RF 0 0 0 WDG RF Bit 7 = AVDS Voltage Detection selection This bit is set and cleared by software.
ST72321Rx ST72321ARx ST72321Jx 7 INTERRUPTS 7.
ST72321Rx ST72321ARx ST72321Jx INTERRUPTS (Cont’d) Servicing Pending Interrupts As several interrupts can be pending at the same time, the interrupt to be taken into account is determined by the following two-step process: – the highest software priority interrupt is serviced, – if several interrupts have the same software priority then the interrupt with the highest hardware priority is serviced first. Figure 19 describes this decision process. Figure 19.
ST72321Rx ST72321ARx ST72321Jx INTERRUPTS (Cont’d) 7.3 INTERRUPTS AND LOW POWER MODES 7.4 CONCURRENT & NESTED MANAGEMENT All interrupts allow the processor to exit the WAIT low power mode. On the contrary, only external and other specified interrupts allow the processor to exit from the HALT modes (see column “Exit from HALT” in “Interrupt Mapping” table).
ST72321Rx ST72321ARx ST72321Jx INTERRUPTS (Cont’d) INTERRUPT SOFTWARE PRIORITY REGISTERS (ISPRX) Read/Write (bit 7:4 of ISPR3 are read only) Reset Value: 1111 1111 (FFh) 7.
ST72321Rx ST72321ARx ST72321Jx INTERRUPTS (Cont’d) Table 7.
ST72321Rx ST72321ARx ST72321Jx INTERRUPTS (Cont’d) Table 8. Interrupt Mapping N° Source Block RESET TRAP Register Label Description Reset N/A Software interrupt 0 TLI 1 MCC/RTC 2 ei0 External interrupt port A3..0 3 ei1 External interrupt port F2..0 4 ei2 External interrupt port B3..0 5 ei3 External interrupt port B7..
ST72321Rx ST72321ARx ST72321Jx INTERRUPTS (Cont’d) Figure 22. External Interrupt Control bits PORT A [3:0] INTERRUPTS PAOR.3 PADDR.3 EICR IS20 IS21 SENSITIVITY PA3 CONTROL IPA BIT PORT F [2:0] INTERRUPTS IS21 SENSITIVITY PF2 CONTROL PORT B [3:0] INTERRUPTS PBOR.3 PBDDR.3 IS10 SENSITIVITY IPB BIT PB7 38/193 ei1 INTERRUPT SOURCE IS11 CONTROL PBOR.7 PBDDR.7 PF2 PF1 PF0 EICR PB3 PORT B [7:4] INTERRUPTS ei0 INTERRUPT SOURCE EICR IS20 PFOR.2 PFDDR.
ST72321Rx ST72321ARx ST72321Jx 7.7 EXTERNAL INTERRUPT CONTROL REGISTER (EICR) Read/Write Reset Value: 0000 0000 (00h) - ei0 (port A3..0) External Interrupt Sensitivity 7 IS11 0 IS10 IPB IS21 IS20 IPA TLIS TLIE Bit 7:6 = IS1[1:0] ei2 and ei3 sensitivity The interrupt sensitivity, defined using the IS1[1:0] bits, is applied to the following external interrupts: - ei2 (port B3..
ST72321Rx ST72321ARx ST72321Jx INTERRUPTS (Cont’d) Table 9. Nested Interrupts Register Map and Reset Values Address (Hex.
ST72321Rx ST72321ARx ST72321Jx 8 POWER SAVING MODES 8.1 INTRODUCTION 8.2 SLOW MODE To give a large measure of flexibility to the application in terms of power consumption, four main power saving modes are implemented in the ST7 (see Figure 23): SLOW, WAIT (SLOW WAIT), ACTIVE HALT and HALT. After a RESET the normal operating mode is selected by default (RUN mode).
ST72321Rx ST72321ARx ST72321Jx POWER SAVING MODES (Cont’d) 8.3 WAIT MODE WAIT mode places the MCU in a low power consumption mode by stopping the CPU. This power saving mode is selected by calling the ‘WFI’ instruction. All peripherals remain active. During WAIT mode, the I[1:0] bits of the CC register are forced to ‘10’, to enable all interrupts. All other registers and memory remain unchanged.
ST72321Rx ST72321ARx ST72321Jx POWER SAVING MODES (Cont’d) 8.4 ACTIVE-HALT AND HALT MODES ACTIVE-HALT and HALT modes are the two lowest power consumption modes of the MCU. They are both entered by executing the ‘HALT’ instruction. The decision to enter either in ACTIVE-HALT or HALT mode is given by the MCC/RTC interrupt enable flag (OIE bit in MCCSR register). MCCSR OIE bit lay depending on option byte). Otherwise, the ST7 enters HALT mode for the remaining tDELAY period. Figure 26.
ST72321Rx ST72321ARx ST72321Jx POWER SAVING MODES (Cont’d) 8.4.2 HALT MODE The HALT mode is the lowest power consumption mode of the MCU. It is entered by executing the ‘HALT’ instruction when the OIE bit of the Main Clock Controller Status register (MCCSR) is cleared (see section 10.2 on page 57 for more details on the MCCSR register). The MCU can exit HALT mode on reception of either a specific interrupt (see Table 8, “Interrupt Mapping,” on page 37) or a RESET.
ST72321Rx ST72321ARx ST72321Jx POWER SAVING MODES (Cont’d) 8.4.2.1 Halt Mode Recommendations – Make sure that an external event is available to wake up the microcontroller from Halt mode. – When using an external interrupt to wake up the microcontroller, reinitialize the corresponding I/O as “Input Pull-up with Interrupt” before executing the HALT instruction. The main reason for this is that the I/O may be wrongly configured due to external interference or by an unforeseen logical condition.
ST72321Rx ST72321ARx ST72321Jx 9 I/O PORTS 9.1 INTRODUCTION The I/O ports offer different functional modes: – transfer of data through digital inputs and outputs and for specific pins: – external interrupt generation – alternate signal input/output for the on-chip peripherals. An I/O port contains up to 8 pins. Each pin can be programmed independently as digital input (with or without interrupt generation) or digital output. 9.
ST72321Rx ST72321ARx ST72321Jx I/O PORTS (Cont’d) Figure 30. I/O Port General Block Diagram ALTERNATE OUTPUT REGISTER ACCESS 1 VDD 0 P-BUFFER (see table below) ALTERNATE ENABLE PULL-UP (see table below) DR VDD DDR PULL-UP CONDITION DATA BUS OR PAD If implemented OR SEL N-BUFFER DIODES (see table below) DDR SEL DR SEL ANALOG INPUT CMOS SCHMITT TRIGGER 1 0 ALTERNATE INPUT EXTERNAL INTERRUPT SOURCE (eix) Table 10.
ST72321Rx ST72321ARx ST72321Jx I/O PORTS (Cont’d) Table 11.
ST72321Rx ST72321ARx ST72321Jx I/O PORTS (Cont’d) CAUTION: The alternate function must not be activated as long as the pin is configured as input with interrupt, in order to avoid generating spurious interrupts. Analog alternate function When the pin is used as an ADC input, the I/O must be configured as floating input. The analog multiplexer (controlled by the ADC registers) switches the analog voltage present on the selected pin to the common analog rail which is connected to the ADC input.
ST72321Rx ST72321ARx ST72321Jx I/O PORTS (Cont’d) 9.5.1 I/O Port Implementation The I/O port register configurations are summarised as follows.
ST72321Rx ST72321ARx ST72321Jx I/O PORTS (Cont’d) Table 13. I/O Port Register Map and Reset Values Address (Hex.
ST72321Rx ST72321ARx ST72321Jx 10 ON-CHIP PERIPHERALS 10.1 WATCHDOG TIMER (WDG) 10.1.1 Introduction The Watchdog timer is used to detect the occurrence of a software fault, usually generated by external interference or by unforeseen logical conditions, which causes the application program to abandon its normal sequence. The Watchdog circuit generates an MCU reset on expiry of a programmed time period, unless the program refreshes the counter’s contents before the T6 bit becomes cleared. 10.1.
ST72321Rx ST72321ARx ST72321Jx WATCHDOG TIMER (Cont’d) 10.1.4 How to Program the Watchdog Timeout Figure 2 shows the linear relationship between the 6-bit value to be loaded in the Watchdog Counter (CNT) and the resulting timeout duration in milliseconds. This can be used for a quick calculation without taking the timing variations into account. If more precision is needed, use the formulae in Figure 3.
ST72321Rx ST72321ARx ST72321Jx WATCHDOG TIMER (Cont’d) Figure 34. Exact Timeout Duration (tmin and tmax) WHERE: tmin0 = (LSB + 128) x 64 x tOSC2 tmax0 = 16384 x tOSC2 tOSC2 = 125ns if fOSC2=8 MHz CNT = Value of T[5:0] bits in the WDGCR register (6 bits) MSB and LSB are values from the table below depending on the timebase selected by the TB[1:0] bits in the MCCSR register TB1 Bit TB0 Bit (MCCSR Reg.) (MCCSR Reg.
ST72321Rx ST72321ARx ST72321Jx WATCHDOG TIMER (Cont’d) 10.1.5 Low Power Modes Mode SLOW WAIT Description No effect on Watchdog. No effect on Watchdog. OIE bit in MCCSR register WDGHALT bit in Option Byte 0 0 0 1 1 x HALT No Watchdog reset is generated. The MCU enters Halt mode. The Watchdog counter is decremented once and then stops counting and is no longer able to generate a watchdog reset until the MCU receives an external interrupt or a reset.
ST72321Rx ST72321ARx ST72321Jx Table 14. Watchdog Timer Register Map and Reset Values Address (Hex.
ST72321Rx ST72321ARx ST72321Jx 10.2 MAIN CLOCK CONTROLLER WITH REAL TIME CLOCK AND BEEPER (MCC/RTC) The Main Clock Controller consists of three different functions: ■ a programmable CPU clock prescaler ■ a clock-out signal to supply external devices ■ a real time clock timer with interrupt capability Each function can be used independently and simultaneously. 10.2.1 Programmable CPU Clock Prescaler The programmable CPU clock prescaler supplies the clock for the ST7 CPU and its internal peripherals.
ST72321Rx ST72321ARx ST72321Jx MAIN CLOCK CONTROLLER WITH REAL TIME CLOCK (Cont’d) 10.2.5 Low Power Modes Bit 6:5 = CP[1:0] CPU clock prescaler Mode Description These bits select the CPU clock prescaler which is No effect on MCC/RTC peripheral. applied in the different slow modes. Their action is WAIT MCC/RTC interrupt cause the device to exit conditioned by the setting of the SMS bit. These from WAIT mode.
ST72321Rx ST72321ARx ST72321Jx MAIN CLOCK CONTROLLER WITH REAL TIME CLOCK (Cont’d) MCC BEEP CONTROL REGISTER (MCCBCR) Bit 0 = OIF Oscillator interrupt flag This bit is set by hardware and cleared by software Read/Write reading the MCCSR register. It indicates when set Reset Value: 0000 0000 (00h) that the main oscillator has reached the selected elapsed time (TB1:0).
ST72321Rx ST72321ARx ST72321Jx 10.3 PWM AUTO-RELOAD TIMER (ART) 10.3.1 Introduction The Pulse Width Modulated Auto-Reload Timer on-chip peripheral consists of an 8-bit auto reload counter with compare/capture capabilities and of a 7-bit prescaler clock source.
ST72321Rx ST72321ARx ST72321Jx ON-CHIP PERIPHERALS (Cont’d) 10.3.2 Functional Description Counter The free running 8-bit counter is fed by the output of the prescaler, and is incremented on every rising edge of the clock signal. It is possible to read or write the contents of the counter on the fly by reading or writing the Counter Access register (ARTCAR). When a counter overflow occurs, the counter is automatically reloaded with the contents of the ARTARR register (the prescaler is not affected).
ST72321Rx ST72321ARx ST72321Jx ON-CHIP PERIPHERALS (Cont’d) Independent PWM signal generation This mode allows up to four Pulse Width Modulated signals to be generated on the PWMx output pins with minimum core processing overhead. This function is stopped during HALT mode. Each PWMx output signal can be selected independently using the corresponding OEx bit in the PWM Control register (PWMCR). When this bit is set, the corresponding I/O pin is configured as output push-pull alternate function.
ST72321Rx ST72321ARx ST72321Jx ON-CHIP PERIPHERALS (Cont’d) Output compare and Time base interrupt On overflow, the OVF flag of the ARTCSR register is set and an overflow interrupt request is generated if the overflow interrupt enable bit, OIE, in the ARTCSR register, is set. The OVF flag must be reset by the user software. This interrupt can be used as a time base in the application.
ST72321Rx ST72321ARx ST72321Jx ON-CHIP PERIPHERALS (Cont’d) Input capture function This mode allows the measurement of external signal pulse widths through ARTICRx registers. Each input capture can generate an interrupt independently on a selected input signal transition. This event is flagged by a set of the corresponding CFx bits of the Input Capture Control/Status register (ARTICCSR). These input capture interrupts are enabled through the CIEx bits of the ARTICCSR register.
ST72321Rx ST72321ARx ST72321Jx ON-CHIP PERIPHERALS (Cont’d) 10.3.3 Register Description 0: New transition not yet reached 1: Transition reached CONTROL / STATUS REGISTER (ARTCSR) Read/Write Reset Value: 0000 0000 (00h) 7 EXCL 0 CC2 CC1 CC0 TCE FCRL OIE COUNTER ACCESS REGISTER (ARTCAR) Read/Write Reset Value: 0000 0000 (00h) OVF 7 Bit 7 = EXCL External Clock This bit is set and cleared by software. It selects the input clock for the 7-bit prescaler. 0: CPU clock. 1: External clock.
ST72321Rx ST72321ARx ST72321Jx ON-CHIP PERIPHERALS (Cont’d) PWM CONTROL REGISTER (PWMCR) Read/Write Reset Value: 0000 0000 (00h) DUTY CYCLE REGISTERS (PWMDCRx) Read/Write Reset Value: 0000 0000 (00h) 7 OE3 OE2 OE1 OE0 OP3 OP2 OP1 0 7 OP0 DC7 Bit 7:4 = OE[3:0] PWM Output Enable These bits are set and cleared by software. They enable or disable the PWM output channels independently acting on the corresponding I/O pin. 0: PWM output disabled. 1: PWM output enabled.
ST72321Rx ST72321ARx ST72321Jx ON-CHIP PERIPHERALS (Cont’d) INPUT CAPTURE CONTROL / STATUS REGISTER (ARTICCSR) Read/Write Reset Value: 0000 0000 (00h) INPUT CAPTURE REGISTERS (ARTICRx) Read only Reset Value: 0000 0000 (00h) 7 7 IC7 0 0 0 0 CS2 CS1 CIE2 CIE1 CF2 IC6 IC5 IC4 IC3 IC2 IC1 IC0 CF1 Bit 7:6 = Reserved, always read as 0. Bit 5:4 = CS[2:1] Capture Sensitivity These bits are set and cleared by software.
ST72321Rx ST72321ARx ST72321Jx PWM AUTO-RELOAD TIMER (Cont’d) Table 16. PWM Auto-Reload Timer Register Map and Reset Values Address (Hex.
ST72321Rx ST72321ARx ST72321Jx 10.4 16-BIT TIMER 10.4.1 Introduction The timer consists of a 16-bit free-running counter driven by a programmable prescaler. It may be used for a variety of purposes, including pulse length measurement of up to two input signals (input capture) or generation of up to two output waveforms (output compare and PWM). Pulse lengths and waveform periods can be modulated from a few microseconds to several milliseconds using the timer prescaler and the CPU clock prescaler.
ST72321Rx ST72321ARx ST72321Jx 16-BIT TIMER (Cont’d) Figure 42.
ST72321Rx ST72321ARx ST72321Jx 16-BIT TIMER (Cont’d) 16-bit read sequence: (from either the Counter Register or the Alternate Counter Register). Beginning of the sequence At t0 Read MS Byte LS Byte is buffered Other instructions Read At t0 +Δt LS Byte Returns the buffered LS Byte value at t0 Sequence completed The user must read the MS Byte first, then the LS Byte value is buffered automatically.
ST72321Rx ST72321ARx ST72321Jx 16-BIT TIMER (Cont’d) Figure 43. Counter Timing Diagram, Internal Clock Divided by 2 CPU CLOCK INTERNAL RESET TIMER CLOCK COUNTER REGISTER FFFD FFFE FFFF 0000 0001 0002 0003 TIMER OVERFLOW FLAG (TOF) Figure 44. Counter Timing Diagram, Internal Clock Divided by 4 CPU CLOCK INTERNAL RESET TIMER CLOCK COUNTER REGISTER FFFC FFFD 0000 0001 TIMER OVERFLOW FLAG (TOF) Figure 45.
ST72321Rx ST72321ARx ST72321Jx 16-BIT TIMER (Cont’d) 10.4.3.3 Input Capture In this section, the index, i, may be 1 or 2 because there are two input capture functions in the 16-bit timer. The two 16-bit input capture registers (IC1R and IC2R) are used to latch the value of the free running counter after a transition is detected on the ICAPi pin (see Figure 5). ICiR MS Byte ICiHR LS Byte ICiLR ICiR register is a read-only register.
ST72321Rx ST72321ARx ST72321Jx 16-BIT TIMER (Cont’d) Figure 46. Input Capture Block Diagram ICAP1 pin ICAP2 pin (Control Register 1) CR1 EDGE DETECT CIRCUIT2 EDGE DETECT CIRCUIT1 ICIE IEDG1 (Status Register) SR IC2R Register IC1R Register ICF1 ICF2 0 16-BIT FREE RUNNING COUNTER CC1 CC0 IEDG2 Figure 47. Input Capture Timing Diagram TIMER CLOCK FF01 FF02 FF03 ICAPi PIN ICAPi FLAG ICAPi REGISTER Note: The rising edge is the active edge.
ST72321Rx ST72321ARx ST72321Jx 16-BIT TIMER (Cont’d) 10.4.3.4 Output Compare In this section, the index, i, may be 1 or 2 because there are two output compare functions in the 16bit timer. This function can be used to control an output waveform or indicate when a period of time has elapsed.
ST72321Rx ST72321ARx ST72321Jx 16-BIT TIMER (Cont’d) Notes: 1. After a processor write cycle to the OCiHR register, the output compare function is inhibited until the OCiLR register is also written. 2. If the OCiE bit is not set, the OCMPi pin is a general I/O port and the OLVLi bit will not appear when a match is found but an interrupt could be generated if the OCIE bit is set. 3.
ST72321Rx ST72321ARx ST72321Jx 16-BIT TIMER (Cont’d) Figure 49. Output Compare Timing Diagram, fTIMER = fCPU/2 INTERNAL CPU CLOCK TIMER CLOCK COUNTER REGISTER 2ECF 2ED0 OUTPUT COMPARE REGISTER i (OCRi) 2ED1 2ED2 2ED3 2ED4 2ED3 OUTPUT COMPARE FLAG i (OCFi) OCMPi PIN (OLVLi = 1) Figure 50.
ST72321Rx ST72321ARx ST72321Jx 16-BIT TIMER (Cont’d) 10.4.3.5 One Pulse Mode One Pulse mode enables the generation of a pulse when an external event occurs. This mode is selected via the OPM bit in the CR2 register. The One Pulse mode uses the Input Capture1 function and the Output Compare1 function. Procedure: To use One Pulse mode: 1. Load the OC1R register with the value corresponding to the length of the pulse (see the formula in the opposite column). 2.
ST72321Rx ST72321ARx ST72321Jx 16-BIT TIMER (Cont’d) Figure 51. One Pulse Mode Timing Example COUNTER 2ED3 01F8 IC1R 01F8 FFFC FFFD FFFE 2ED0 2ED1 2ED2 FFFC FFFD 2ED3 ICAP1 OLVL2 OCMP1 OLVL1 OLVL2 compare1 Note: IEDG1 = 1, OC1R = 2ED0h, OLVL1 = 0, OLVL2 = 1 Figure 52.
ST72321Rx ST72321ARx ST72321Jx 16-BIT TIMER (Cont’d) 10.4.3.6 Pulse Width Modulation Mode Pulse Width Modulation (PWM) mode enables the generation of a signal with a frequency and pulse length determined by the value of the OC1R and OC2R registers. Pulse Width Modulation mode uses the complete Output Compare 1 function plus the OC2R register, and so this functionality can not be used when PWM mode is activated. In PWM mode, double buffering is implemented on the output compare registers.
ST72321Rx ST72321ARx ST72321Jx 16-BIT TIMER (Cont’d) 10.4.4 Low Power Modes Mode WAIT HALT Description No effect on 16-bit Timer. Timer interrupts cause the device to exit from WAIT mode. 16-bit Timer registers are frozen. In HALT mode, the counter stops counting until Halt mode is exited. Counting resumes from the previous count when the MCU is woken up by an interrupt with “exit from HALT mode” capability or from the counter reset value when the MCU is woken up by a RESET.
ST72321Rx ST72321ARx ST72321Jx 16-BIT TIMER (Cont’d) 10.4.7 Register Description Each Timer is associated with three control and status registers, and with six pairs of data registers (16-bit values) relating to the two input captures, the two output compares, the counter and the alternate counter. CONTROL REGISTER 1 (CR1) Read/Write Reset Value: 0000 0000 (00h) 7 0 Bit 4 = FOLV2 Forced Output Compare 2. This bit is set and cleared by software. 0: No effect on the OCMP2 pin.
ST72321Rx ST72321ARx ST72321Jx 16-BIT TIMER (Cont’d) CONTROL REGISTER 2 (CR2) Read/Write Reset Value: 0000 0000 (00h) 7 0 OC1E OC2E OPM PWM CC1 CC0 IEDG2 EXEDG Bit 7 = OC1E Output Compare 1 Pin Enable. This bit is used only to output the signal from the timer on the OCMP1 pin (OLV1 in Output Compare mode, both OLV1 and OLV2 in PWM and one-pulse mode). Whatever the value of the OC1E bit, the Output Compare 1 function of the timer remains active.
ST72321Rx ST72321ARx ST72321Jx 16-BIT TIMER (Cont’d) CONTROL/STATUS REGISTER (CSR) Read/Write (bits 7:3 read only) Reset Value: xxxx x0xx (xxh) Note: Reading or writing the ACLR register does not clear TOF. 7 ICF1 0 OCF1 TOF ICF2 OCF2 TIMD 0 0 Bit 7 = ICF1 Input Capture Flag 1. 0: No input capture (reset value). 1: An input capture has occurred on the ICAP1 pin or the counter has reached the OC2R value in PWM mode.
ST72321Rx ST72321ARx ST72321Jx 16-BIT TIMER (Cont’d) INPUT CAPTURE 1 HIGH REGISTER (IC1HR) Read Only Reset Value: Undefined This is an 8-bit read only register that contains the high part of the counter value (transferred by the input capture 1 event). OUTPUT COMPARE 1 HIGH REGISTER (OC1HR) Read/Write Reset Value: 1000 0000 (80h) This is an 8-bit register that contains the high part of the value to be compared to the CHR register.
ST72321Rx ST72321ARx ST72321Jx 16-BIT TIMER (Cont’d) OUTPUT COMPARE 2 HIGH REGISTER (OC2HR) Read/Write Reset Value: 1000 0000 (80h) This is an 8-bit register that contains the high part of the value to be compared to the CHR register. ALTERNATE COUNTER HIGH REGISTER (ACHR) Read Only Reset Value: 1111 1111 (FFh) This is an 8-bit register that contains the high part of the counter value.
ST72321Rx ST72321ARx ST72321Jx 16-BIT TIMER (Cont’d) Table 18. 16-Bit Timer Register Map and Reset Values Address (Hex.
ST72321Rx ST72321ARx ST72321Jx 10.5 SERIAL PERIPHERAL INTERFACE (SPI) 10.5.1 Introduction The Serial Peripheral Interface (SPI) allows fullduplex, synchronous, serial communication with external devices. An SPI system may consist of a master and one or more slaves however the SPI interface can not be a master in a multi-master system. 10.5.
ST72321Rx ST72321ARx ST72321Jx SERIAL PERIPHERAL INTERFACE (Cont’d) – SS: Slave select: This input signal acts as a ‘chip select’ to let the SPI master communicate with slaves individually and to avoid contention on the data lines. Slave SS inputs can be driven by standard I/O ports on the master MCU. 10.5.3.1 Functional Description A basic example of interconnections between a single master and a single slave is illustrated in Figure 54.
ST72321Rx ST72321ARx ST72321Jx SERIAL PERIPHERAL INTERFACE (Cont’d) 10.5.3.2 Slave Select Management As an alternative to using the SS pin to control the Slave Select signal, the application can choose to manage the Slave Select signal by software. This is configured by the SSM bit in the SPICSR register (see Figure 56) In software management, the external SS pin is free for other application uses and the internal SS signal level is driven by writing to the SSI bit in the SPICSR register.
ST72321Rx ST72321ARx ST72321Jx SERIAL PERIPHERAL INTERFACE (Cont’d) 10.5.3.3 Master Mode Operation In master mode, the serial clock is output on the SCK pin. The clock frequency, polarity and phase are configured by software (refer to the description of the SPICSR register). Note: The idle state of SCK must correspond to the polarity selected in the SPICSR register (by pulling up SCK if CPOL=1 or pulling down SCK if CPOL=0).
ST72321Rx ST72321ARx ST72321Jx SERIAL PERIPHERAL INTERFACE (Cont’d) 10.5.4 Clock Phase and Clock Polarity Four possible timing relationships may be chosen by software, using the CPOL and CPHA bits (See Figure 57). Note: The idle state of SCK must correspond to the polarity selected in the SPICSR register (by pulling up SCK if CPOL=1 or pulling down SCK if CPOL=0).
ST72321Rx ST72321ARx ST72321Jx SERIAL PERIPHERAL INTERFACE (Cont’d) 10.5.5 Error Flags 10.5.5.1 Master Mode Fault (MODF) Master mode fault occurs when the master device has its SS pin pulled low. When a Master mode fault occurs: – The MODF bit is set and an SPI interrupt request is generated if the SPIE bit is set. – The SPE bit is reset. This blocks all output from the device and disables the SPI peripheral. – The MSTR bit is reset, thus forcing the device into slave mode.
ST72321Rx ST72321ARx ST72321Jx SERIAL PERIPHERAL INTERFACE (Cont’d) 10.5.5.4 Single Master Systems A typical single master system may be configured, using an MCU as the master and four MCUs as slaves (see Figure 59). The master device selects the individual slave devices by using four pins of a parallel port to control the four SS pins of the slave devices. The SS pins are pulled high during reset since the master device ports will be forced to be inputs at that time, thus disabling the slave devices.
ST72321Rx ST72321ARx ST72321Jx SERIAL PERIPHERAL INTERFACE (Cont’d) 10.5.6 Low Power Modes Mode WAIT HALT Description No effect on SPI. SPI interrupt events cause the device to exit from WAIT mode. SPI registers are frozen. In HALT mode, the SPI is inactive. SPI operation resumes when the MCU is woken up by an interrupt with “exit from HALT mode” capability. The data received is subsequently read from the SPIDR register when the software is running (interrupt vector fetching).
ST72321Rx ST72321ARx ST72321Jx SERIAL PERIPHERAL INTERFACE (Cont’d) 10.5.8 Register Description CONTROL REGISTER (SPICR) Read/Write Reset Value: 0000 xxxx (0xh) 7 SPIE 0 SPE SPR2 MSTR CPOL CPHA SPR1 SPR0 Bit 7 = SPIE Serial Peripheral Interrupt Enable. This bit is set and cleared by software. 0: Interrupt is inhibited 1: An SPI interrupt is generated whenever SPIF=1, MODF=1 or OVR=1 in the SPICSR register Bit 6 = SPE Serial Peripheral Output Enable. This bit is set and cleared by software.
ST72321Rx ST72321ARx ST72321Jx SERIAL PERIPHERAL INTERFACE (Cont’d) CONTROL/STATUS REGISTER (SPICSR) Read/Write (some bits Read Only) Reset Value: 0000 0000 (00h) 7 SPIF Bit 3 = Reserved, must be kept cleared. 0 WCOL OVR MODF - SOD SSM SSI Bit 7 = SPIF Serial Peripheral Data Transfer Flag (Read only). This bit is set by hardware when a transfer has been completed. An interrupt is generated if SPIE=1 in the SPICR register.
ST72321Rx ST72321ARx ST72321Jx SERIAL PERIPHERAL INTERFACE (Cont’d) Table 20. SPI Register Map and Reset Values Address (Hex.
ST72321Rx ST72321ARx ST72321Jx 10.6 SERIAL COMMUNICATIONS INTERFACE (SCI) 10.6.1 Introduction The Serial Communications Interface (SCI) offers a flexible means of full-duplex data exchange with external equipment requiring an industry standard NRZ asynchronous serial data format. The SCI offers a very wide range of baud rates using two baud rate generator systems. 10.6.
ST72321Rx ST72321ARx ST72321Jx SERIAL COMMUNICATIONS INTERFACE (Cont’d) Figure 60.
ST72321Rx ST72321ARx ST72321Jx SERIAL COMMUNICATIONS INTERFACE (Cont’d) 10.6.4 Functional Description The block diagram of the Serial Control Interface, is shown in Figure 1. It contains six dedicated registers: – Two control registers (SCICR1 & SCICR2) – A status register (SCISR) – A baud rate register (SCIBRR) – An extended prescaler receiver register (SCIERPR) – An extended prescaler transmitter register (SCIETPR) Refer to the register descriptions in Section 0.1.7 for the definitions of each bit. 10.
ST72321Rx ST72321ARx ST72321Jx SERIAL COMMUNICATIONS INTERFACE (Cont’d) 10.6.4.2 Transmitter The transmitter can send data words of either 8 or 9 bits depending on the M bit status. When the M bit is set, word length is 9 bits and the 9th bit (the MSB) has to be stored in the T8 bit in the SCICR1 register. Character Transmission During an SCI transmission, data shifts out least significant bit first on the TDO pin.
ST72321Rx ST72321ARx ST72321Jx SERIAL COMMUNICATIONS INTERFACE (Cont’d) 10.6.4.3 Receiver The SCI can receive data words of either 8 or 9 bits. When the M bit is set, word length is 9 bits and the MSB is stored in the R8 bit in the SCICR1 register. Character reception During a SCI reception, data shifts in least significant bit first through the RDI pin. In this mode, the SCIDR register consists or a buffer (RDR) between the internal bus and the received shift register (see Figure 1.).
ST72321Rx ST72321ARx ST72321Jx SERIAL COMMUNICATIONS INTERFACE (Cont’d) Figure 62.
ST72321Rx ST72321ARx ST72321Jx SERIAL COMMUNICATIONS INTERFACE (Cont’d) Framing Error A framing error is detected when: – The stop bit is not recognized on reception at the expected time, following either a de-synchronization or excessive noise. – A break is received. When the framing error is detected: – the FE bit is set by hardware – Data is transferred from the Shift register to the SCIDR register. – No interrupt is generated.
ST72321Rx ST72321ARx ST72321Jx SERIAL COMMUNICATIONS INTERFACE (Cont’d) 10.6.4.7 Parity Control Parity control (generation of parity bit in transmission and parity checking in reception) can be enabled by setting the PCE bit in the SCICR1 register. Depending on the frame length defined by the M bit, the possible SCI frame formats are as listed in Table 1. Table 21.
ST72321Rx ST72321ARx ST72321Jx SERIAL COMMUNICATIONS INTERFACE (Cont’d) 10.6.4.9 Clock Deviation Causes The causes which contribute to the total deviation are: – DTRA: Deviation due to transmitter error (Local oscillator error of the transmitter or the transmitter is transmitting at a different baud rate). – DQUANT: Error due to the baud rate quantization of the receiver.
ST72321Rx ST72321ARx ST72321Jx SERIAL COMMUNICATIONS INTERFACE (Cont’d) 10.6.5 Low Power Modes 10.6.6 Interrupts The SCI interrupt events are connected to the Mode Description same interrupt vector. No effect on SCI. These events generate an interrupt if the correWAIT SCI interrupts cause the device to exit from sponding Enable Control Bit is set and the interWait mode. rupt mask in the CC register is reset (RIM instrucSCI registers are frozen. tion).
ST72321Rx ST72321ARx ST72321Jx SERIAL COMMUNICATIONS INTERFACE (Cont’d) 10.6.7 Register Description Note: The IDLE bit is not set again until the RDRF bit has been set itself (that is, a new idle line ocSTATUS REGISTER (SCISR) curs). Read Only Reset Value: 1100 0000 (C0h) Bit 3 = OR Overrun error. 7 0 This bit is set by hardware when the word currently being received in the shift register is ready to be TDRE TC RDRF IDLE OR NF FE PE transferred into the RDR register while RDRF = 1.
ST72321Rx ST72321ARx ST72321Jx SERIAL COMMUNICATIONS INTERFACE (Cont’d) CONTROL REGISTER 1 (SCICR1) Read/Write Bit 3 = WAKE Wake-Up method. This bit determines the SCI Wake-Up method, it is Reset Value: x000 0000 (x0h) set or cleared by software. 0: Idle Line 7 0 1: Address Mark R8 T8 SCID M WAKE PCE PS PIE Bit 7 = R8 Receive data bit 8. This bit is used to store the 9th bit of the received word when M = 1. Bit 6 = T8 Transmit data bit 8.
ST72321Rx ST72321ARx ST72321Jx SERIAL COMMUNICATIONS INTERFACE (Cont’d) CONTROL REGISTER 2 (SCICR2) Notes: Read/Write – During transmission, a “0” pulse on the TE bit (“0” followed by “1”) sends a preamble (idle line) Reset Value: 0000 0000 (00h) after the current word. 7 0 – When TE is set there is a 1 bit-time delay before the transmission starts. TIE TCIE RIE ILIE TE RE RWU SBK CAUTION: The TDO pin is free for general purpose I/O only when the TE and RE bits are both cleared (or if TE is never set).
ST72321Rx ST72321ARx ST72321Jx SERIAL COMMUNICATIONS INTERFACE (Cont’d) DATA REGISTER (SCIDR) Read/Write Reset Value: Undefined Contains the Received or Transmitted data character, depending on whether it is read from or written to. 7 0 DR7 DR6 DR5 DR4 DR3 DR2 DR1 DR0 The Data register performs a double function (read and write) since it is composed of two registers, one for transmission (TDR) and one for reception (RDR).
ST72321Rx ST72321ARx ST72321Jx SERIAL COMMUNICATIONS INTERFACE (Cont’d) EXTENDED RECEIVE PRESCALER DIVISION REGISTER (SCIERPR) Read/Write Reset Value: 0000 0000 (00h) Allows setting of the Extended Prescaler rate division factor for the receive circuit. 7 0 EXTENDED TRANSMIT PRESCALER DIVISION REGISTER (SCIETPR) Read/Write Reset Value:0000 0000 (00h) Allows setting of the External Prescaler rate division factor for the transmit circuit.
ST72321Rx ST72321ARx ST72321Jx SERIAL COMMUNICATION INTERFACE (Cont’d) Table 23. SCI Register Map and Reset Values Address (Hex.
ST72321Rx ST72321ARx ST72321Jx 10.7 I2C BUS INTERFACE (I2C) 10.7.1 Introduction The I2C Bus Interface serves as an interface between the microcontroller and the serial I2C bus. It provides both multimaster and slave functions, and controls all I2C bus-specific sequencing, protocol, arbitration and timing. It supports fast I2C mode (400kHz). 10.7.2 Main Features 2 ■ Parallel-bus/I C protocol converter ■ Multi-master capability ■ 7-bit/10-bit Addressing ■ SMBus V1.
ST72321Rx ST72321ARx ST72321Jx I2C BUS INTERFACE (Cont’d) Acknowledge may be enabled and disabled by software. The I2C interface address and/or general call address can be selected by software. The speed of the I2C interface may be selected between Standard (up to 100KHz) and Fast I2C (up to 400KHz). SDA/SCL Line Control Transmitter mode: the interface holds the clock line low before transmission to wait for the microcontroller to write the byte in the Data Register.
ST72321Rx ST72321ARx ST72321Jx I2C BUS INTERFACE (Cont’d) 10.7.4 Functional Description Refer to the CR, SR1 and SR2 registers in Section 10.7.7. for the bit definitions. By default the I2C interface operates in Slave mode (M/SL bit is cleared) except when it initiates a transmit or receive sequence. First the interface frequency must be configured using the FRi bits in the OAR2 register. 10.7.4.
ST72321Rx ST72321ARx ST72321Jx I2C INTERFACE (Cont’d) How to release the SDA / SCL lines Set and subsequently clear the STOP bit while BTF is set. The SDA/SCL lines are released after the transfer of the current byte. SMBus Compatibility ST7 I2C is compatible with SMBus V1.1 protocol. It supports all SMBus adressing modes, SMBus bus protocols and CRC-8 packet error checking. Refer to AN1713: SMBus Slave Driver For ST7 I2C Peripheral. 10.7.4.
ST72321Rx ST72321ARx ST72321Jx I2C BUS INTERFACE (Cont’d) Master Transmitter Following the address transmission and after SR1 register has been read, the master sends bytes from the DR register to the SDA line via the internal shift register. The master waits for a read of the SR1 register followed by a write in the DR register, holding the SCL line low (see Figure 66 Transfer sequencing EV8).
ST72321Rx ST72321ARx ST72321Jx I2C BUS INTERFACE (Cont’d) Figure 66. Transfer Sequencing 7-bit Slave receiver: S Address A Data1 A Data2 EV1 A EV2 EV2 ..... DataN A P EV2 EV4 7-bit Slave transmitter: S Address A Data1 A EV1 EV3 Data2 A EV3 EV3 DataN ..... NA P EV3-1 EV4 7-bit Master receiver: S Address A EV5 Data1 A EV6 Data2 A EV7 EV7 DataN ..... NA P EV7 7-bit Master transmitter: S Address A EV5 Data1 A EV6 EV8 Data2 A EV8 DataN .....
ST72321Rx ST72321ARx ST72321Jx I2C BUS INTERFACE (Cont’d) 10.7.5 Low Power Modes Mode WAIT HALT Description No effect on I2C interface. I2C interrupts cause the device to exit from WAIT mode. I2C registers are frozen. In HALT mode, the I2C interface is inactive and does not acknowledge data on the bus. The I2C interface resumes operation when the MCU is woken up by an interrupt with “exit from HALT mode” capability. 10.7.6 Interrupts Figure 67.
ST72321Rx ST72321ARx ST72321Jx I2C BUS INTERFACE (Cont’d) 10.7.7 Register Description I2C CONTROL REGISTER (CR) Read / Write Reset Value: 0000 0000 (00h) – In slave mode: 0: No start generation 1: Start generation when the bus is free 7 0 0 0 PE ENGC START ACK STOP ITE Bit 2 = ACK Acknowledge enable. This bit is set and cleared by software. It is also cleared by hardware when the interface is disabled (PE=0).
ST72321Rx ST72321ARx ST72321Jx I2C BUS INTERFACE (Cont’d) I2C STATUS REGISTER 1 (SR1) Read Only Reset Value: 0000 0000 (00h) 1: Data byte transmitted 7 EVF 0 ADD10 TRA BUSY BTF ADSL M/SL SB Bit 7 = EVF Event flag. This bit is set by hardware as soon as an event occurs. It is cleared by software reading SR2 register in case of error event or as described in Figure 66. It is also cleared by hardware when the interface is disabled (PE=0).
ST72321Rx ST72321ARx ST72321Jx I2C BUS INTERFACE (Cont’d) Bit 1 = M/SL Master/Slave. This bit is set by hardware as soon as the interface is in Master mode (writing START=1). It is cleared by hardware after detecting a Stop condition on the bus or a loss of arbitration (ARLO=1). It is also cleared when the interface is disabled (PE=0). 0: Slave mode 1: Master mode Bit 0 = SB Start bit (Master mode). This bit is set by hardware as soon as the Start condition is generated (following a write START=1).
ST72321Rx ST72321ARx ST72321Jx I2C BUS INTERFACE (Cont’d) I2C CLOCK CONTROL REGISTER (CCR) Read / Write Reset Value: 0000 0000 (00h) 7 FM/SM CC6 CC5 CC4 CC3 CC2 CC1 I2C DATA REGISTER (DR) Read / Write Reset Value: 0000 0000 (00h) 0 7 CC0 D7 Bit 7 = FM/SM Fast/Standard I2C mode. This bit is set and cleared by software. It is not cleared when the interface is disabled (PE=0). 0: Standard I2C mode 1: Fast I2C mode Bit 6:0 = CC[6:0] 7-bit clock divider.
ST72321Rx ST72321ARx ST72321Jx I2C BUS INTERFACE (Cont’d) I2C OWN ADDRESS REGISTER (OAR1) Read / Write Reset Value: 0000 0000 (00h) 7 ADD7 ADD6 ADD5 ADD4 ADD3 ADD2 ADD1 I2C OWN ADDRESS REGISTER (OAR2) Read / Write Reset Value: 0100 0000 (40h) 0 7 ADD0 FR1 7-bit Addressing Mode Bit 7:1 = ADD[7:1] Interface address. These bits define the I2C bus address of the interface. They are not cleared when the interface is disabled (PE=0). 0 FR0 0 0 0 ADD9 ADD8 0 Bit 7:6 = FR[1:0] Frequency bits.
ST72321Rx ST72321ARx ST72321Jx I²C BUS INTERFACE (Cont’d) Table 24. I2C Register Map and Reset Values Address (Hex.
ST72321Rx ST72321ARx ST72321Jx 10.8 10-BIT A/D CONVERTER (ADC) 10.8.1 Introduction The on-chip Analog to Digital Converter (ADC) peripheral is a 10-bit, successive approximation converter with internal sample and hold circuitry. This peripheral has up to 16 multiplexed analog input channels (refer to device pin out description) that allow the peripheral to convert the analog voltage levels from up to 16 different sources. The result of the conversion is stored in a 10-bit Data Register.
ST72321Rx ST72321ARx ST72321Jx 10-BIT A/D CONVERTER (ADC) (Cont’d) 10.8.3 Functional Description The conversion is monotonic, meaning that the result never decreases if the analog input does not and never increases if the analog input does not. If the input voltage (VAIN) is greater than VAREF (high-level voltage reference) then the conversion result is FFh in the ADCDRH register and 03h in the ADCDRL register (without overflow indication).
ST72321Rx ST72321ARx ST72321Jx 10-BIT A/D CONVERTER (ADC) (Cont’d) 10.8.6 Register Description CONTROL/STATUS REGISTER (ADCCSR) Read/Write (Except bit 7 read only) Reset Value: 0000 0000 (00h) 7 EOC SPEED ADON Bit 3:0 = CH[3:0] Channel Selection These bits are set and cleared by software. They select the analog input to convert. 0 0 CH3 CH2 CH1 CH0 Bit 7 = EOC End of Conversion This bit is set by hardware.
ST72321Rx ST72321ARx ST72321Jx 10-BIT A/D CONVERTER (Cont’d) Table 25. ADC Register Map and Reset Values Address (Hex.
ST72321Rx ST72321ARx ST72321Jx 11 INSTRUCTION SET 11.
ST72321Rx ST72321ARx ST72321Jx INSTRUCTION SET OVERVIEW (Cont’d) 11.1.1 Inherent All Inherent instructions consist of a single byte. The opcode fully specifies all the required information for the CPU to process the operation.
ST72321Rx ST72321ARx ST72321Jx INSTRUCTION SET OVERVIEW (Cont’d) 11.1.6 Indirect Indexed (Short, Long) This is a combination of indirect and short indexed addressing modes. The operand is referenced by its memory address, which is defined by the unsigned addition of an index register value (X or Y) with a pointer value located in memory. The pointer address follows the opcode.
ST72321Rx ST72321ARx ST72321Jx INSTRUCTION SET OVERVIEW (Cont’d) 11.2 INSTRUCTION GROUPS The ST7 family devices use an Instruction Set consisting of 63 instructions.
ST72321Rx ST72321ARx ST72321Jx INSTRUCTION SET OVERVIEW (Cont’d) Mnemo Description Function/Example Dst Src I1 H I0 N Z C ADC Add with Carry A=A+M+C A M H N Z C ADD Addition A=A+M A M H N Z C AND Logical And A=A.M A M N Z BCP Bit compare A, Memory tst (A .
ST72321Rx ST72321ARx ST72321Jx INSTRUCTION SET OVERVIEW (Cont’d) Mnemo Description Function/Example Dst Src JRULE Jump if (C + Z = 1) Unsigned <= LD Load MUL dst <= src reg, M M, reg Multiply X,A = X * A A, X, Y X, Y, A NEG Negate (2's compl) neg $10 reg, M NOP No Operation OR OR operation A=A+M A M POP Pop from the Stack pop reg reg M pop CC CC M PUSH Push onto the Stack push Y M reg, CC RCF Reset carry flag C=0 RET Subroutine Return RIM Enable Interrupts I
ST72321Rx ST72321ARx ST72321Jx 12 ELECTRICAL CHARACTERISTICS 12.1 PARAMETER CONDITIONS Unless otherwise specified, all voltages are referred to VSS. 12.1.1 Minimum and Maximum values Unless otherwise specified the minimum and maximum values are guaranteed in the worst conditions of ambient temperature, supply voltage and frequencies by tests in production on 100% of the devices with an ambient temperature at TA=25°C and TA=TAmax (given by the selected temperature range).
ST72321Rx ST72321ARx ST72321Jx 12.2 ABSOLUTE MAXIMUM RATINGS Stresses above those listed as “absolute maximum ratings” may cause permanent damage to the device. This is a stress rating only and functional operation of the device under these condi12.2.1 Voltage Characteristics Symbol tions is not implied. Exposure to maximum rating conditions for extended periods may affect device reliability. Ratings Maximum value VDD - VSS Supply voltage 6.
ST72321Rx ST72321ARx ST72321Jx 12.2.3 Thermal Characteristics Symbol TSTG TJ Ratings Storage temperature range Value Unit -65 to +150 °C Maximum junction temperature (see Section 13.2 THERMAL CHARACTERISTICS) 12.3 OPERATING CONDITIONS 12.3.1 General Operating Conditions Symbol Parameter Conditions fCPU Internal clock frequency VDD Standard voltage range (except Flash Write/Erase) Operating Voltage for Flash Write/Erase TA Ambient temperature range Min Max Unit 0 8 MHz 3.8 5.
ST72321Rx ST72321ARx ST72321Jx OPERATING CONDITIONS (Cont’d) 12.3.2 Operating Conditions with Low Voltage Detector (LVD) Subject to general operating conditions for VDD, fCPU, and TA. Symbol VIT+(LVD) Reset release threshold (VDD rise) VIT-(LVD) Reset generation threshold (VDD fall) Vhys(LVD) Conditions Min Typ Max VD level = High in option byte 4.01) 4.2 4.5 VD level = Med. in option byte2) 3.551) VD level = Low in option byte2) 2.951) 3.75 3.15 4.01) 3.
ST72321Rx ST72321ARx ST72321Jx 12.4 SUPPLY CURRENT CHARACTERISTICS The following current consumption specified for the ST7 functional operating modes over temperature range does not take into account the clock source current consumption. To get the total device consumption, the two current values must be added (except for HALT mode for which the clock is stopped). 12.4.1 CURRENT CONSUMPTION Symbol IDD Parameter Conditions Max 1) Typ Max 1) 1.3 2.0 3.6 7.1 3.0 5.0 8.0 15.0 1.3 2.0 3.6 7.1 2.0 3.
ST72321Rx ST72321ARx ST72321Jx SUPPLY CURRENT CHARACTERISTICS (Cont’d) 12.4.1.1 Power Consumption vs fCPU: Flash Devices Figure 72. Typical IDD in RUN mode Figure 74. Typical IDD in WAIT mode 8 7 5 4 Idd (mA) 6 Idd (mA) 8MHz 4MHz 2MHz 1MHz 6 8MHz 4MHz 2MHz 1MHz 9 5 4 3 2 3 2 1 1 0 0 3.2 3.6 4 4.4 4.8 5.2 3.2 5.5 3.6 4 5.5 500kHz 1.20 500kHz 250kHz 1.00 125kHz 62.5kHz 0.80 250kHz 125kHz 62.5kHz ) ( 0.80 Idd (mA) 5.2 Figure 75. Typ. IDD in SLOW-WAIT mode Figure 73.
ST72321Rx ST72321ARx ST72321Jx SUPPLY CURRENT CHARACTERISTICS (Cont’d) 12.4.2 Supply and Clock Managers The previous current consumption specified for the ST7 functional operating modes over temperature range does not take into account the clock source current consumption. To get the total device consumption, the two current values must be added (except for HALT mode). Symbol Parameter Conditions IDD(RCINT) Supply current of internal RC oscillator Typ Max Unit 625 see section 12.5.
ST72321Rx ST72321ARx ST72321Jx SUPPLY CURRENT CHARACTERISTICS (Cont’d) 12.4.3 On-Chip Peripherals Measured on LQFP64 generic board TA = 25°C fCPU=4MHz. Symbol Typ Unit IDD(TIM) 16-bit Timer supply current 1) Parameter Conditions VDD=5.0V 50 μA IDD(ART) ART PWM supply current2) VDD=5.0V 75 μA IDD(SPI) SPI supply current 3) VDD=5.0V 400 μA IDD(SCI) SCI supply current 4) VDD=5.0V 400 μA IDD(I2C) I2C supply current 5) VDD=5.
ST72321Rx ST72321ARx ST72321Jx 12.5 CLOCK AND TIMING CHARACTERISTICS Subject to general operating conditions for VDD, fCPU, and TA. 12.5.1 General Timings Symbol tc(INST) tv(IT) Parameter Conditions Instruction cycle time Interrupt reaction time tv(IT) = Δtc(INST) + 10 fCPU=8MHz 2) fCPU=8MHz Min Typ 1) Max Unit 2 3 12 tCPU 250 375 1500 ns 10 22 tCPU 1.25 2.75 μs Max Unit 12.5.
ST72321Rx ST72321ARx ST72321Jx CLOCK AND TIMING CHARACTERISTICS (Cont’d) 12.5.3 Crystal and Ceramic Resonator Oscillators The ST7 internal clock can be supplied with four different Crystal/Ceramic resonator oscillators. All the information given in this paragraph is based on characterization results with specified typical external components.
ST72321Rx ST72321ARx ST72321Jx Figure 77. Typical Application with a Crystal or Ceramic Resonator Figure 78.
ST72321Rx ST72321ARx ST72321Jx CLOCK AND TIMING CHARACTERISTICS (Cont’d) Murata Supplier fOSC Typical Ceramic Resonators1) (MHz) Reference2) Recommended OSCRANGE Option bit configuration 2 CSTCC2M00G56A-R0 MP Mode3) 4 CSTCR4M00G55B-R0 MS Mode 8 CSTCE8M00G55A-R0 HS Mode 16 CSTCE16M0G53A-R0 HS Mode Notes: 1. Resonator characteristics given by the ceramic resonator manufacturer. 2.
ST72321Rx ST72321ARx ST72321Jx CLOCK CHARACTERISTICS (Cont’d) 12.5.4 RC Oscillators Symbol fOSC (RCINT) Parameter Conditions Internal RC oscillator frequency TA=25°C, VDD=5V See Figure 79 Figure 79. Typical fOSC(RCINT) vs TA fOSC(RCINT) (MHz) Vdd = 5V Vdd = 5.5V 3.6 3.4 3.2 3 -45 0 25 TA(°C) 150/193 70 Typ Max Unit 2 3.5 5.6 MHz Note: To reduce disturbance to the RC oscillator, it is recommended to place decoupling capacitors between VDD and VSS as shown in Figure 99 4 3.
ST72321Rx ST72321ARx ST72321Jx CLOCK CHARACTERISTICS (Cont’d) Note: 1. Data based on characterization results. 12.5.5 PLL Characteristics Symbol fOSC Δ fCPU/ fCPU Parameter Conditions PLL input frequency range Instantaneous PLL jitter 1) Min Typ 2 Max Unit 4 MHz % fOSC = 4 MHz. 1.0 2.5 fOSC = 2 MHz. 2.5 4.0 Note: 1. Data characterized but not tested.
ST72321Rx ST72321ARx ST72321Jx 12.6 MEMORY CHARACTERISTICS 12.6.1 RAM and Hardware Registers Symbol VRM Parameter Data retention mode 1) Conditions HALT mode (or RESET) Min Typ Max 1.6 Unit V 12.6.
ST72321Rx ST72321ARx ST72321Jx 12.7 EMC CHARACTERISTICS Susceptibility tests are performed on a sample basis during product characterization. 12.7.1 Functional EMS (Electro Magnetic Susceptibility) Based on a simple running application on the product (toggling 2 LEDs through I/O ports), the product is stressed by two electro magnetic events until a failure occurs (indicated by the LEDs).
ST72321Rx ST72321ARx ST72321Jx EMC CHARACTERISTICS (Cont’d) 12.7.2 Electro Magnetic Interference (EMI) Based on a simple application running on the product (toggling 2 LEDs through the I/O ports), the product is monitored in terms of emission. This emission test is in line with the norm SAE J 1752/ 3 which specifies the board and the loading of each pin. Symbol SEMI SEMI SEMI Parameter Peak level Peak level Peak level Conditions Monitored Frequency Band 8/4MHz 16/8MHz 0.
ST72321Rx ST72321ARx ST72321Jx EMC CHARACTERISTICS (Cont’d) 12.7.3 Absolute Maximum Ratings (Electrical Sensitivity) Based on two different tests (ESD and LU) using specific measurement methods, the product is stressed in order to determine its performance in terms of electrical sensitivity. For more details, refer to the application note AN1181. 12.7.3.
ST72321Rx ST72321ARx ST72321Jx 12.8 I/O PORT PIN CHARACTERISTICS 12.8.1 General Characteristics Subject to general operating conditions for VDD, fOSC, and TA unless otherwise specified. Symbol Parameter VIL Input low level voltage VIH Input high level voltage 1) Vhys IINJ(PIN)3) Conditions Min Typ 1) Schmitt trigger voltage hysteresis 0.7xVDD V 2) 0.
ST72321Rx ST72321ARx ST72321Jx I/O PORT PIN CHARACTERISTICS (Cont’d) 12.8.2 Output Driving Current Subject to general operating conditions for VDD, fCPU, and TA unless otherwise specified. Symbol Parameter Conditions VOL 1) Output low level voltage for a high sink I/O pin when 4 pins are sunk at same time (see Figure 84 and Figure 86) VDD=5V Output low level voltage for a standard I/O pin when 8 pins are sunk at same time (see Figure 83) Figure 83. Typical VOL at VDD=5V (standard) IIO=+5mA 1.
ST72321Rx ST72321ARx ST72321Jx I/O PORT PIN CHARACTERISTICS (Cont’d) Figure 86. Typical VOL vs. VDD (standard) 1 0.45 Ta= -4 5°C 0.9 Ta= 95°C Ta=2 5°C Ta=9 5°C 0.35 Ta= 140 °C 0.7 Vol(V) at Iio=2mA V ol(V ) at Iio=5m A 0.8 Ta=-4 5°C 0.4 Ta= 25°C 0.6 0.5 0.4 0.3 Ta=1 40°C 0.3 0.25 0.2 0.15 0.2 0.1 0.1 0.05 0 2 2.5 3 3.5 4 4.5 5 5.5 0 6 2 Vdd(V ) 2.5 3 3.5 4 4.5 5 5.5 6 Vdd(V) Figure 87. Typical VOL vs. VDD (high-sink) 1 .6 0 .6 Ta = 140 °C 1 .4 0 .
ST72321Rx ST72321ARx ST72321Jx 12.9 CONTROL PIN CHARACTERISTICS 12.9.1 Asynchronous RESET Pin Subject to general operating conditions for VDD, fCPU, and TA unless otherwise specified. Symbol Parameter Conditions VIL Input low level voltage VIH Input high level voltage 1) Vhys Schmitt trigger voltage hysteresis 2) VOL Output low level voltage 3) IIO RON Min Typ 1) 0.16xVDD 0.85xVDD 2.5 VDD=5V IIO=+2mA 0.
ST72321Rx ST72321ARx ST72321Jx CONTROL PIN CHARACTERISTICS (Cont’d) Figure 89. RESET pin protection when LVD is enabled.1)2)3)4) VDD Required Optional (note 3) ST72XXX RON EXTERNAL RESET INTERNAL RESET Filter 0.01μF 1MΩ PULSE GENERATOR WATCHDOG LVD RESET Figure 90. RESET pin protection when LVD is disabled.1) VDD ST72XXX RON USER EXTERNAL RESET CIRCUIT INTERNAL RESET Filter 0.01μF PULSE GENERATOR WATCHDOG Required Note 1: – The reset network protects the device against parasitic resets.
ST72321Rx ST72321ARx ST72321Jx CONTROL PIN CHARACTERISTICS (Cont’d) 12.9.2 ICCSEL/VPP Pin Subject to general operating conditions for VDD, fCPU, and TA unless otherwise specified. Symbol Min Max1 VSS 0.2 ROM versions VSS 0.3xVDD Parameter Conditions VIL Input low level voltage 1) FLASH versions VIH Input high level voltage 1) FLASH versions VDD-0.1 12.6 ROM versions 0.7xVDD VDD IL Input leakage current VIN=VSS ±1 Unit V μA Figure 91.
ST72321Rx ST72321ARx ST72321Jx 12.10 TIMER PERIPHERAL CHARACTERISTICS Subject to general operating conditions for VDD, fOSC, and TA unless otherwise specified. Refer to I/O port characteristics for more details on the input/output alternate function characteristics (output compare, input capture, external clock, PWM output...). 12.10.
ST72321Rx ST72321ARx ST72321Jx 12.11 COMMUNICATION INTERFACE CHARACTERISTICS 12.11.1 SPI - Serial Peripheral Interface Subject to general operating conditions for VDD, fCPU, and TA unless otherwise specified. Symbol fSCK 1/tc(SCK) tr(SCK) tf(SCK) Refer to I/O port characteristics for more details on the input/output alternate function characteristics (SS, SCK, MOSI, MISO). Parameter Conditions SPI clock frequency Min Max Master fCPU=8MHz fCPU/128 0.
ST72321Rx ST72321ARx ST72321Jx COMMUNICATION INTERFACE CHARACTERISTICS (Cont’d) Figure 93. SPI Slave Timing Diagram with CPHA=11) SS INPUT SCK INPUT tsu(SS) tc(SCK) th(SS) CPHA=1 CPOL=0 CPHA=1 CPOL=1 tw(SCKH) tw(SCKL) ta(SO) MISO OUTPUT see note 2 tv(SO) th(SO) MSB OUT HZ tsu(SI) BIT6 OUT LSB OUT tdis(SO) see note 2 th(SI) MSB IN MOSI INPUT tr(SCK) tf(SCK) BIT1 IN LSB IN Figure 94.
ST72321Rx ST72321ARx ST72321Jx COMMUNICATION INTERFACE CHARACTERISTICS (Cont’d) 12.11.2 I2C - Inter IC Control Interface Subject to general operating conditions for VDD, fCPU, and TA unless otherwise specified. Symbol Refer to I/O port characteristics for more details on the input/output alternate function characteristics (SDAI and SCLI). The ST7 I2C interface meets the requirements of the Standard I2C communication protocol described in the following table.
ST72321Rx ST72321ARx ST72321Jx COMMUNICATION INTERFACE CHARACTERISTICS (Cont’d) The following table gives the values to be written in the I2CCCR register to obtain the required I2C SCL line frequency. Table 28. SCL Frequency Table I2CCCR Value fSCL (kHz) 400 300 200 100 50 20 fCPU=4 MHz. VDD = 4.1 V RP=3.3kΩ RP=4.7kΩ NA NA NA NA 83h 83h 10h 10h 24h 24h 5Fh 5Fh VDD = 5 V RP=3.3kΩ RP=4.7kΩ NA NA NA NA 83h 83h 10h 10h 24h 24h 5Fh 5Fh fCPU=8 MHz. VDD = 4.1 V VDD = 5 V RP=3.3kΩ RP=4.7kΩ RP=3.3kΩ RP=4.
ST72321Rx ST72321ARx ST72321Jx 12.12 10-BIT ADC CHARACTERISTICS Subject to general operating conditions for VDD, fCPU, and TA unless otherwise specified. Symbol fADC VAREF Parameter Conditions ADC clock frequency 0.7*VDD ≤ VAREF ≤ VDD Analog reference voltage 1) VAIN Conversion voltage range RAIN External input impedance CAIN External capacitor on analog input fAIN Variation freq. of analog input signal Min Max Unit 0.4 Typ 2 MHz 3.
ST72321Rx ST72321ARx ST72321Jx ADC CHARACTERISTICS (Cont’d) Figure 96. RAIN max. vs fADC with CAIN=0pF1) Figure 97. Recommended CAIN & RAIN values.2) 45 1000 Cain 10 nF 2 MHz 35 30 1 MHz 25 Cain 22 nF 100 Max. R AIN (Kohm) Max. R AIN (Kohm) 40 20 15 10 Cain 47 nF 10 1 5 0 0.1 0 10 30 70 0.01 0.1 CPARASITIC (pF) 1 10 fAIN(KHz) Figure 98. Typical A/D Converter Application VDD RAIN AINx ST72XXX VT 0.6V 2kΩ(max) VAIN CAIN VT 0.
ST72321Rx ST72321ARx ST72321Jx ADC CHARACTERISTICS (Cont’d) 12.12.1 Analog Power Supply and Reference Pins Depending on the MCU pin count, the package may feature separate VAREF and VSSA analog power supply pins. These pins supply power to the A/D converter cell and function as the high and low reference voltages for the conversion. Separation of the digital and analog power pins allow board designers to improve A/D performance.
ST72321Rx ST72321ARx ST72321Jx 10-BIT ADC CHARACTERISTICS (Cont’d) 12.12.3 ADC Accuracy Conditions: VDD=5V 1) Symbol |ET| |EO| |EG| Typ Max2) 3 4 2 3 0.5 3 CPU in run mode @ fADC 2 MHz. 1 2 CPU in run mode @ fADC 2 MHz. 1 2 Parameter Total unadjusted error Offset error Gain Error Conditions 1) 1) 1) |ED| Differential linearity error |EL| Integral linearity error 1) 1) Unit LSB Notes: 1. ADC Accuracy vs.
ST72321Rx ST72321ARx ST72321Jx 13 PACKAGE CHARACTERISTICS 13.1 PACKAGE MECHANICAL DATA Figure 101. 64-Pin Low Profile Quad Flat Package (14x14) D A D1 A2 Dim. Min Typ A A1 E1 E L Max Min Typ Max 1.60 0.0630 0.15 0.0020 0.0059 A1 0.05 A2 1.35 1.40 1.45 0.0531 0.0551 0.0571 b 0.30 0.37 0.45 0.0118 0.0146 0.0177 c 0.09 b e inches1) mm 0.20 0.0035 0.0079 D 16.00 0.6299 D1 14.00 0.5512 E 16.00 0.6299 E1 14.00 0.5512 e 0.80 0.0315 θ 0° 3.5° L 0.45 0.
ST72321Rx ST72321ARx ST72321Jx PACKAGE MECHANICAL DATA (Cont’d) Figure 103. 44-Pin Low Profile Quad Flat Package A A2 D D1 b e E1 E L Typ h Max Min Typ Max 1.60 0.0630 0.15 0.0020 0.0059 A1 0.05 A2 1.35 1.40 1.45 0.0531 0.0551 0.0571 b 0.30 0.37 0.45 0.0118 0.0146 0.0177 C 0.09 0.20 0.0035 0.0079 D 12.00 0.4724 D1 10.00 0.3937 E 12.00 0.4724 E1 10.00 0.3937 e c L1 Min A A1 inches1) mm Dim. 0.80 θ 0° 3.5° L 0.45 0.60 L1 0.0315 7° 0° 3.5° 7° 0.
ST72321Rx ST72321ARx ST72321Jx 13.2 THERMAL CHARACTERISTICS Symbol RthJA PD TJmax Ratings Value Unit Package thermal resistance (junction to ambient) LQFP64 14x14 LQFP64 10x10 LQFP44 10x10 47 50 52 °C/W Power dissipation 1) 500 mW 150 °C Maximum junction temperature 2) Notes: 1. The maximum chip-junction temperature is based on technology characteristics. 2. The maximum power dissipation is obtained from the formula PD = (TJ -TA) / RthJA.
ST72321Rx ST72321ARx ST72321Jx 13.3 SOLDERING AND GLUEABILITY INFORMATION Refer to JEDEC specification JSTD020D for a description of the recommended reflow oven profile for these packages. In order to meet environmental requirements, ST offers this device in different grades of ECOPACK® packages, depending on their level of environmental compliance. ECOPACK® specifica- 174/193 tions, grade definitions and product status are available at: www.st.com. ECOPACK® is an ST trademark.
ST72321Rx ST72321ARx ST72321Jx 14 ST72321 DEVICE CONFIGURATION AND ORDERING INFORMATION Each device is available for production in user programmable versions (FLASH) as well as in factory coded versions (ROM/FASTROM). ST72321 devices are ROM versions. ST72P321 devices are Factory Advanced Service Technique ROM (FASTROM) versions: they are factory-programmed HDFlash devices.
ST72321Rx ST72321ARx ST72321Jx ST72321 DEVICE CONFIGURATION AND ORDERING INFORMATION (Cont’d) OPT0= FMP_R Flash memory read-out protection Read-out protection, when selected, provides a protection against Program Memory content extraction and against write access to Flash memory. Erasing the option bytes when the FMP_R option is selected causes the whole user memory to be erased first, and the device can be reprogrammed. Refer to Section 4.3.
ST72321Rx ST72321ARx ST72321Jx ST72321 DEVICE CONFIGURATION AND ORDERING INFORMATION (Cont’d) 14.2 DEVICE ORDERING INFORMATION AND TRANSFER OF CUSTOMER CODE Customer code is made up of the ROM/FASTROM contents and the list of the selected options (if any). The ROM/FASTROM contents are to be sent on diskette, or by electronic means, with the S19 hexadecimal file generated by the development tool. All unused bytes must be set to FFh.
ST72321Rx ST72321ARx ST72321Jx Figure 105. Ordering information scheme Example: ST72 F 321 J 7 T 8 Family ST7 microcontroller family Memory type F: Flash Blank : ROM P = FASTROM Sub-family 325 No. of pins J = 44 or 42 AR = 64 (LQFP64 10x10 package) R = 64 (LQFP64 14x14 package) Memory size 6 = 32K 7 = 48K 9 = 60K Package T = LQFP Temperature range 3 = -40 to 125 °C 6 = -40 °C to 85 °C For a list of available options (e.g.
ST72321Rx ST72321ARx ST72321Jx ST723251 DEVICE CONFIGURATION AND ORDERING INFORMATION (Cont’d) Figure 106.
ST72321Rx ST72321ARx ST72321Jx ST72321 DEVICE CONFIGURATION AND ORDERING INFORMATION (Cont’d) ST72321 MICROCONTROLLER OPTION LIST (last update Mar 2009) Customer: . . Address: . . . . Contact: . . Phone No: . . Reference/ROM *The ROM code ROM code must . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ST72321Rx ST72321ARx ST72321Jx DEVICE CONFIGURATION AND ORDERING INFORMATION (Cont’d) 14.3 DEVELOPMENT TOOLS Development tools for the ST7 microcontrollers include a complete range of hardware systems and software tools from STMicroelectronics and thirdparty tool suppliers. The range of tools includes solutions to help you evaluate microcontroller peripherals, develop and debug your application, and program your microcontrollers. 14.3.1 Starter kits ST offers complete, affordable starter kits.
ST72321Rx ST72321ARx ST72321Jx DEVICE CONFIGURATION AND ORDERING INFORMATION (Cont’d) Table 30. Suggested List of Socket Types Device Socket (supplied with ST7MDT20MEMU3) Emulator Adapter (supplied with ST7MDT20M-EMU3) LQFP64 14 x14 CAB 3303262 CAB 3303351 LQFP64 10 x10 YAMAICHI IC149-064-*75-*5 YAMAICHI ICP-064-6 LQFP44 10 X10 YAMAICHI IC149-044-*52-*5 YAMAICHI ICP-044-5 14.3.
ST72321Rx ST72321ARx ST72321Jx 14.4 ST7 APPLICATION NOTES Table 31.
ST72321Rx ST72321ARx ST72321Jx Table 31.
ST72321Rx ST72321ARx ST72321Jx Table 31.
ST72321Rx ST72321ARx ST72321Jx 15 KNOWN LIMITATIONS 15.1 ALL FLASH AND ROM DEVICES 15.1.1 External RC option The External RC clock source option described in previous datasheet revisions is no longer supported and has been removed from this specification. 15.1.2 Safe Connection of OSC1/OSC2 Pins The OSC1 and/or OSC2 pins must not be left unconnected otherwise the ST7 main oscillator may start and, in this configuration, could generate an fOSC clock frequency in excess of the allowed maximum (>16MHz.
ST72321Rx ST72321ARx ST72321Jx TNZ Y jrne OUT LD A,sema ; check the semaphore status if edge is detected CP A,#01 jrne OUT call call_routine; call the interrupt routine OUT:LD A,#00 LD sema,A .call_routine ; entry to call_routine PUSH A PUSH X PUSH CC .
ST72321Rx ST72321ARx ST72321Jx – The interrupt flag is cleared within any interrupt routine with higher or identical priority level – The interrupt flag is cleared in any part of the code while this interrupt is disabled If these conditions are not met, the symptom can be avoided by implementing the following sequence: PUSH CC SIM reset interrupt flag POP CC 188/193
ST72321Rx ST72321ARx ST72321Jx KNOWN LIMITATIONS (Cont’d) 15.1.7 SCI Wrong Break duration Description A single break character is sent by setting and resetting the SBK bit in the SCICR2 register. In some cases, the break character may have a longer duration than expected: - 20 bits instead of 10 bits if M=0 - 22 bits instead of 11 bits if M=1. In the same way, as long as the SBK bit is set, break characters are sent to the TDO pin. This may lead to generate one break more than expected.
ST72321Rx ST72321ARx ST72321Jx To identify these parts, check the internal sales type on the box label or the trace code marking on the package. Rev Rev Q Rev S Rev 9 (full spec) Internal Salestype Trace Code 72F321xxx$A2 813xxxQ 72F321xxx$U2 72F321xxx$A8 813xxxQ 813xxxS 72F321xxx$U8 72F321xxx$A3 813xxxS 813xxx9 72F321xxx$U3 813xxx9 15.4 LIMITATIONS DEVICES SPECIFIC TO ROM 15.4.
ST72321Rx ST72321ARx ST72321Jx 15.4.2 LVD Startup behaviour When the LVD is enabled, the MCU reaches its authorized operating voltage from a reset state. However, in some devices, the reset state is released when VDD is approximately between 0.8V and 1.5V. As a consequence, the I/Os may toggle when VDD is within this window. This may be an issue especially for applications where the MCU drives power components. Figure 107. LVD Startup Behaviour 5V LVD RESET VIT+ VD 1.5V D Window 0.8V t 15.4.
ST72321Rx ST72321ARx ST72321Jx 16 REVISION HISTORY Table 32. Revision History Date Revision Description of Changes Added “related documentation” section in specific chapters throughout document Flash readout protection sentence added section 4.3.1 on page 18 I2C Chapter updated, (Section 10.7) Vt POR max modified in section 12.4 on page 142 Added Figure 89 on page 160 Modified description of tw(RSTL)out in “Asynchronous RESET Pin” on page 159 18-Oct-2004 1.
ST72321Rx ST72321ARx ST72321Jx Please Read Carefully: Information in this document is provided solely in connection with ST products. STMicroelectronics NV and its subsidiaries (“ST”) reserve the right to make changes, corrections, modifications or improvements, to this document, and the products and services described herein at any time, without notice. All ST products are sold pursuant to ST’s terms and conditions of sale.