ST7232AK2 STMicroelectronics, ST7232AK2 Datasheet
![no-image](/images/manufacturer_photos/0/6/637/stmicroelectronics_sml.jpg)
ST7232AK2
Specifications of ST7232AK2
Related parts for ST7232AK2
ST7232AK2 Summary of contents
Page 1
... PWM and pulse generator modes 2 Communications Interfaces ■ – SPI synchronous serial interface – SCI asynchronous serial interface Device Summary Features ST72F32AK1 ST72F32AK2 ST72F32AJ1 ST72F32AJ2 ST7232AK1 ST7232AK2 ST7232AJ1 ST7232AJ2 Program memory FLASH 4K - bytes RAM (stack) - bytes Operating Voltage Temp. Range ...
Page 2
INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...
Page 3
I/O PORTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...
Page 4
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...
Page 5
RAM and Hardware Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...
Page 6
To obtain the most recent version of this datasheet, please check at www.st.com>products>technical literature>datasheet. Please also pay special attention to the Section 6/157 1 Table of Contents “KNOWN LIMITATIONS” on page 154. 157 ...
Page 7
INTRODUCTION The ST72F32A and ST7232A devices are mem- bers of the ST7 microcontroller family designed for the 5V operating range. The 32 and 44-pin devices are designed for mid- range applications All devices are based on a common industry- ...
Page 8
ST7232A 2 PIN DESCRIPTION Figure 2. 32-Pin SDIP Package Pinout OCMP1_A / AIN10 / PF4 ICAP1_A / (HS) PF6 EXTCLK_A / (HS) PF7 AIN12 / OCMP2_B / PC0 AIN13 / OCMP1_B / PC1 ICAP2_B / (HS) PC2 ICAP1_B / (HS) ...
Page 9
PIN DESCRIPTION (Cont’d) Figure 4. 42-Pin SDIP and 44-Pin TQFP Package Pinouts RDI / PE1 (HS) PB4 AIN0 / PD0 AIN1 / PD1 AIN2 / PD2 AIN3 / PD3 AIN4 / PD4 MCO / AIN8 / PF0 BEEP / (HS) ...
Page 10
ST7232A PIN DESCRIPTION (Cont’d) For external pin connection guidelines, refer to See “ELECTRICAL CHARACTERISTICS” on page 113. Legend / Abbreviations for Type input output supply Input level Dedicated analog input In/Output level: ...
Page 11
Pin n° Pin Name PC1/OCMP1_B AIN13 PC2 (HS)/ICAP2_B PC3 (HS)/ICAP1_B PC4/MISO/ICCDA PC5/MOSI/AIN14 PC6/SCK/ICCCLK 30 23 ...
Page 12
ST7232A Notes the interrupt input column, “eiX” defines the associated external interrupt vector. If the weak pull-up column (wpu) is merged with the interrupt column (int), then the I/O configuration is pull-up interrupt input, else the configuration is ...
Page 13
REGISTER & MEMORY MAP As shown in Figure 5, the MCU is capable of ad- dressing 64K bytes of memories and I/O registers. The available memory locations consist of 128 bytes of register locations 384 bytes of ...
Page 14
ST7232A Table 2. Hardware Register Map Register Address Block 0000h PADR 2) 0001h Port A PADDR 0002h PAOR 0003h PBDR 2) 0004h Port B PBDDR 0005h PBOR 0006h PCDR 0007h Port C PCDDR 0008h PCOR 0009h PDADR 2) 000Ah Port ...
Page 15
Register Address Block 0031h TACR2 0032h TACR1 0033h TACSR 0034h TAIC1HR 0035h TAIC1LR 0036h TAOC1HR 0037h TAOC1LR 0038h TIMER A TACHR 0039h TACLR 003Ah TAACHR 003Bh TAACLR 003Ch TAIC2HR 003Dh TAIC2LR 003Eh TAOC2HR 003Fh TAOC2LR 0040h 0041h TBCR2 0042h TBCR1 ...
Page 16
ST7232A Notes: 1. The contents of the I/O port DR registers are readable only in output configuration. In input configura- tion, the values of the I/O pins are returned instead of the DR register contents. 2. The bits associated with ...
Page 17
FLASH PROGRAM MEMORY 4.1 Introduction The ST7 dual voltage High Density Flash (HDFlash non-volatile memory that can be electrically erased as a single block or by individu- al sectors and programmed on a Byte-by-Byte ba- sis using ...
Page 18
ST7232A FLASH PROGRAM MEMORY (Cont’d) 4.4 ICC Interface ICC needs a minimum of 4 and pins to be connected to the programming tool (see These pins are: – RESET: device reset – device power supply ...
Page 19
... Flash memory programming can be fully custom- ized (number of bytes to program, program loca- tions, or selection serial communication interface for downloading). When using an STMicroelectronics or third-party programming tool that supports ICP and the spe- cific microcontroller device, the user needs only to implement the ICP hardware interface on the ap- ...
Page 20
ST7232A 5 CENTRAL PROCESSING UNIT 5.1 INTRODUCTION This CPU has a full 8-bit architecture and contains six internal registers allowing efficient 8-bit data manipulation. 5.2 MAIN FEATURES Enable executing 63 basic instructions ■ Fast 8-bit by 8-bit multiply ■ 17 ...
Page 21
CENTRAL PROCESSING UNIT (Cont’d) Condition Code Register (CC) Read/Write Reset Value: 111x1xxx The 8-bit Condition Code register contains the in- terrupt masks and four flags representative of the result of the instruction just executed. ...
Page 22
ST7232A CENTRAL PROCESSING UNIT (Cont’d) Stack Pointer (SP) Read/Write Reset Value: 01 FFh SP7 SP6 SP5 SP4 SP3 The Stack Pointer is a 16-bit register which is al- ways pointing to the next ...
Page 23
SUPPLY, RESET AND CLOCK MANAGEMENT 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 re- ducing the number of external components. An overview is ...
Page 24
ST7232A 6.2 MULTI-OSCILLATOR (MO) The main clock of the ST7 can be generated by two different source types coming from the multi- oscillator block: an external source ■ 4 crystal or ceramic resonator oscillators ■ Each oscillator is optimized for ...
Page 25
RESET SEQUENCE MANAGER (RSM) 6.3.1 Introduction The reset sequence manager includes two RE- SET sources as shown in Figure External RESET source pulse ■ Internal WATCHDOG RESET ■ These sources act on the RESET pin and it is al- ...
Page 26
ST7232A RESET SEQUENCE MANAGER (Cont’d) The RESET pin is an asynchronous signal which plays a major role in EMS performance noisy environment recommended to follow the guidelines mentioned in the electrical characteris- tics section. 6.3.3 External ...
Page 27
SYSTEM INTEGRITY MANAGEMENT 6.4.1 Register Description SYSTEM INTEGRITY (SI) CONTROL/STATUS REGISTER (SICSR) Read/Write Reset Value: 0000 000x (00h Bits 7:1 = Reserved, must be kept cleared. Bit 0 = WDGRF Watchdog reset flag ...
Page 28
ST7232A 7 INTERRUPTS 7.1 INTRODUCTION The ST7 enhanced interrupt management pro- vides the following features: Hardware interrupts ■ Software interrupt (TRAP) ■ Nested or concurrent interrupt management ■ with flexible interrupt management: – software programmable nesting levels ...
Page 29
INTERRUPTS (Cont’d) Servicing Pending Interrupts As several interrupts can be pending at the same time, the interrupt to be taken into account is deter- mined by the following two-step process: – the highest software priority interrupt is serviced, – if ...
Page 30
ST7232A INTERRUPTS (Cont’d) 7.3 INTERRUPTS AND LOW POWER MODES 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 ...
Page 31
INTERRUPTS (Cont’d) 7.5 INTERRUPT REGISTER DESCRIPTION CPU CC REGISTER INTERRUPT BITS Read/Write Reset Value: 111x 1010 (xAh Bit I1, I0 Software Interrupt Priority These two bits indicate the current interrupt soft- ...
Page 32
ST7232A INTERRUPTS (Cont’d) Table 7. Dedicated Interrupt Instruction Set Instruction New Description HALT Entering Halt mode IRET Interrupt routine return JRM Jump if I1:0=11 (level 3) JRNM Jump if I1:0<>11 POP CC Pop CC from the Stack RIM Enable interrupt ...
Page 33
INTERRUPTS (Cont’d) Table 8. Interrupt Mapping Source N° Block RESET Reset TRAP Software interrupt 0 Main clock controller time base inter- 1 MCC/RTC rupt 2 ei0 External interrupt port A3..0 3 ei1 External interrupt port F2..0 4 ei2 External interrupt ...
Page 34
ST7232A Figure 19. External Interrupt Control bits PORT A3 INTERRUPT PAOR.3 PADDR.3 PA3 IPA BIT PORT F [2:0] INTERRUPTS PFOR.2 PFDDR.2 PF2 PORT B [3:0] INTERRUPTS PBOR.3 PBDDR.3 PB3 IPB BIT PORT B [7:4] INTERRUPTS PBOR.7 PBDDR.7 PB7 34/157 1 ...
Page 35
INTERRUPTS (Cont’d) 7.7 EXTERNAL INTERRUPT CONTROL REGISTER (EICR) Read/Write Reset Value: 0000 0000 (00h) 7 IS11 IS10 IPB IS21 IS20 Bit 7:6 = IS1[1:0] ei2 and ei3 sensitivity The interrupt sensitivity, defined using the IS1[1:0] bits, is applied to the ...
Page 36
ST7232A INTERRUPTS (Cont’d) Table 9. Nested Interrupts Register Map and Reset Values Address Register 7 (Hex.) Label 0024h I1_3 ISPR0 1 Reset Value 0025h I1_7 ISPR1 1 Reset Value 0026h ISPR2 I1_11 1 Reset Value 0027h ISPR3 Reset Value 1 ...
Page 37
POWER SAVING MODES 8.1 INTRODUCTION To give a large measure of flexibility to the applica- tion in terms of power consumption, four main power saving modes are implemented in the ST7 (see Figure 20): SLOW, WAIT (SLOW WAIT), AC- ...
Page 38
ST7232A POWER SAVING MODES (Cont’d) 8.3 WAIT MODE WAIT mode places the MCU in a low power con- sumption mode by stopping the CPU. This power saving mode is selected by calling the ‘WFI’ instruction. All peripherals remain active. During ...
Page 39
POWER SAVING MODES (Cont’d) 8.4 ACTIVE-HALT AND HALT MODES ACTIVE-HALT and HALT modes are the two low- est power consumption modes of the MCU. They are both entered by executing the ‘HALT’ instruc- tion. The decision to enter either in ...
Page 40
ST7232A POWER SAVING MODES (Cont’d) 8.4.2 HALT MODE The HALT mode is the lowest power consumption mode of the MCU entered by executing the ‘HALT’ instruction when the OIE bit of the Main Clock Controller Status register (MCCSR) ...
Page 41
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 ...
Page 42
ST7232A 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 pe- ripherals. An ...
Page 43
I/O PORTS (Cont’d) Figure 27. I/O Port General Block Diagram ALTERNATE REGISTER OUTPUT ACCESS ALTERNATE ENABLE DR DDR OR If implemented OR SEL DDR SEL DR SEL 1 0 EXTERNAL INTERRUPT SOURCE ( Table 10. I/O Port Mode ...
Page 44
ST7232A I/O PORTS (Cont’d) Table 11. I/O Port Configurations NOT IMPLEMENTED IN V TRUE OPEN DRAIN I/O PORTS PAD NOT IMPLEMENTED IN TRUE OPEN DRAIN V I/O PORTS PAD NOT IMPLEMENTED IN TRUE OPEN DRAIN V I/O PORTS PAD Notes: ...
Page 45
I/O PORTS (Cont’d) CAUTION: The alternate function must not be ac- tivated 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 ...
Page 46
ST7232A I/O PORTS (Cont’d) 9.5.1 I/O Port Implementation The I/O port register configurations are summa- rised as follows. Standard Ports PA5:4, PC7:0, PD5:0, PE1:0, PF7:6, 4 MODE floating input pull-up input open drain output push-pull output Interrupt Ports PB4, PB2:0, ...
Page 47
I/O PORTS (Cont’d) Table 13. I/O Port Register Map and Reset Values Address Register 7 (Hex.) Label Reset Value of all I/O port registers 0000h PADR 0001h PADDR MSB 0002h PAOR 0003h PBDR 0004h PBDDR MSB 0005h PBOR 0006h PCDR ...
Page 48
ST7232A 10 ON-CHIP PERIPHERALS 10.1 WATCHDOG TIMER (WDG) 10.1.1 Introduction The Watchdog timer is used to detect the occur- rence of a software fault, usually generated by ex- ternal interference or by unforeseen logical condi- tions, which causes the application ...
Page 49
WATCHDOG TIMER (Cont’d) 10.1.4 How to Program the Watchdog Timeout Figure 30 shows the linear relationship between the 6-bit value to be loaded in the Watchdog Coun- ter (CNT) and the resulting timeout duration in mil- liseconds. This can be ...
Page 50
ST7232A WATCHDOG TIMER (Cont’d) Figure 31. Exact Timeout Duration (t WHERE (LSB + 128 min0 OSC2 t = 16384 x t max0 OSC2 t = 125ns MHz OSC2 OSC2 CNT = ...
Page 51
WATCHDOG TIMER (Cont’d) 10.1.5 Low Power Modes Mode Description SLOW No effect on Watchdog. WAIT No effect on Watchdog. OIE bit in WDGHALT bit MCCSR in Option register Byte 0 HALT 0 1 10.1.6 Hardware Watchdog Option If Hardware Watchdog ...
Page 52
ST7232A Table 14. Watchdog Timer Register Map and Reset Values Address Register 7 (Hex.) Label WDGCR WDGA 002Ah Reset Value 52/157 ...
Page 53
MAIN CLOCK CONTROLLER WITH REAL TIME CLOCK AND BEEPER (MCC/RTC) The Main Clock Controller consists of three differ- ent functions: a programmable CPU clock prescaler ■ a clock-out signal to supply external devices ■ a real time clock timer ...
Page 54
ST7232A MAIN CLOCK CONTROLLER WITH REAL TIME CLOCK (Cont’d) 10.2.5 Low Power Modes Mode Description No effect on MCC/RTC peripheral. WAIT MCC/RTC interrupt cause the device to exit from WAIT mode. No effect on MCC/RTC counter (OIE bit is ACTIVE- ...
Page 55
MAIN CLOCK CONTROLLER WITH REAL TIME CLOCK (Cont’d) Bit 0 = OIF Oscillator interrupt flag This bit is set by hardware and cleared by software reading the MCCSR register. It indicates when set that the main oscillator has reached the ...
Page 56
ST7232A 10.3 16-BIT TIMER 10.3.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 two input sig- nals (input ...
Page 57
TIMER (Cont’d) Figure 33. Timer Block Diagram f CPU 8 high EXEDG 1/2 COUNTER 1/4 REGISTER 1/8 ALTERNATE EXTCLK pin COUNTER REGISTER CC[1:0] OVERFLOW DETECT CIRCUIT ICF1 OCF1 TOF ICF2 (Control/Status Register) ICIE OCIE TOIE FOLV2 (See note) TIMER ...
Page 58
ST7232A 16-BIT TIMER (Cont’d) 16-bit read sequence: (from either the Counter Register or the Alternate Counter Register). Beginning of the sequence Read MS Byte At t0 Other instructions Returns the buffered Read At t0 +∆t LS Byte value at t0 ...
Page 59
TIMER (Cont’d) Figure 34. Counter Timing Diagram, internal clock divided by 2 CPU CLOCK INTERNAL RESET TIMER CLOCK COUNTER REGISTER TIMER OVERFLOW FLAG (TOF) Figure 35. Counter Timing Diagram, internal clock divided by 4 CPU CLOCK INTERNAL RESET TIMER ...
Page 60
ST7232A 16-BIT TIMER (Cont’d) 10.3.3.3 Input Capture In this section, the index, i, may because there are 2 input capture functions in the 16-bit timer. The two 16-bit input capture registers (IC1R and IC2R) are used ...
Page 61
TIMER (Cont’d) Figure 37. Input Capture Block Diagram ICAP1 pin EDGE DETECT CIRCUIT2 ICAP2 pin IC2R Register 16-BIT 16-BIT FREE RUNNING COUNTER Figure 38. Input Capture Timing Diagram TIMER CLOCK COUNTER REGISTER ICAPi PIN ICAPi FLAG ICAPi REGISTER rising ...
Page 62
ST7232A 16-BIT TIMER (Cont’d) 10.3.3.4 Output Compare In this section, the index, i, may because there are 2 output compare functions in the 16-bit timer. This function can be used to control an output waveform or ...
Page 63
TIMER (Cont’d) Notes: 1. After a processor write cycle to the OCiHR reg- ister, the output compare function is inhibited until the OCiLR register is also written the OCiE bit is not set, the OCMPi pin is ...
Page 64
ST7232A 16-BIT TIMER (Cont’d) Figure 40. Output Compare Timing Diagram, f INTERNAL CPU CLOCK COUNTER REGISTER OUTPUT COMPARE REGISTER i (OCRi) OUTPUT COMPARE FLAG i (OCFi) OCMPi PIN (OLVLi=1) Figure 41. Output Compare Timing Diagram, f INTERNAL CPU CLOCK COUNTER ...
Page 65
TIMER (Cont’d) 10.3.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 ...
Page 66
ST7232A 16-BIT TIMER (Cont’d) Figure 42. One Pulse Mode Timing Example IC1R 01F8 COUNTER ICAP1 OCMP1 Note: IEDG1=1, OC1R=2ED0h, OLVL1=0, OLVL2=1 Figure 43. Pulse Width Modulation Mode Timing Example with 2 Output Compare Functions FFFC FFFD FFFE COUNTER 34E2 OCMP1 ...
Page 67
TIMER (Cont’d) 10.3.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 ...
Page 68
ST7232A 16-BIT TIMER (Cont’d) 10.3.4 Low Power Modes Mode No effect on 16-bit Timer. WAIT 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 ...
Page 69
TIMER (Cont’d) 10.3.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 al- ...
Page 70
ST7232A 16-BIT TIMER (Cont’d) CONTROL REGISTER 2 (CR2) Read/Write Reset Value: 0000 0000 (00h) 7 OC1E OC2E OPM PWM CC1 CC0 IEDG2 EXEDG Bit 7 = OC1E Output Compare 1 Pin Enable. This bit is used only to output the ...
Page 71
TIMER (Cont’d) CONTROL/STATUS REGISTER (CSR) Read Only (except bit 2 R/W) Reset Value: xxxx x0xx (xxh) 7 ICF1 OCF1 TOF ICF2 OCF2 TIMD Bit 7 = ICF1 Input Capture Flag input capture (reset value ...
Page 72
ST7232A 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). 7 MSB ...
Page 73
TIMER (Cont’d) OUTPUT COMPARE 2 (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. 7 MSB OUTPUT COMPARE 2 (OC2LR) Read/Write ...
Page 74
ST7232A 16-BIT TIMER (Cont’d) ALTERNATE COUNTER (ACHR) Read Only Reset Value: 1111 1111 (FFh) This is an 8-bit register that contains the high part of the counter value. 7 MSB ALTERNATE COUNTER (ACLR) Read Only Reset Value: 1111 1100 (FCh) ...
Page 75
TIMER (Cont’d) Table 17. 16-Bit Timer Register Map and Reset Values Address Register (Hex.) Label Timer A: 32 CR1 ICIE Timer B: 42 Reset Value Timer A: 31 CR2 OC1E Timer B: 41 Reset Value Timer A: 33 CSR ...
Page 76
ST7232A 10.4 SERIAL PERIPHERAL INTERFACE (SPI) 10.4.1 Introduction The Serial Peripheral Interface (SPI) allows full- duplex, synchronous, serial communication with external devices. An SPI system may consist of a master and one or more slaves however the SPI interface can ...
Page 77
SERIAL PERIPHERAL INTERFACE (Cont’d) – SS: Slave select: This input signal acts as a ‘chip select’ to let the SPI master communicate with slaves indi- vidually and to avoid contention on the data lines. Slave SS inputs can be driven ...
Page 78
ST7232A SERIAL PERIPHERAL INTERFACE (Cont’d) 10.4.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 ...
Page 79
SERIAL PERIPHERAL INTERFACE (Cont’d) 10.4.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 ...
Page 80
ST7232A SERIAL PERIPHERAL INTERFACE (Cont’d) 10.4.4 Clock Phase and Clock Polarity Four possible timing relationships may be chosen by software, using the CPOL and CPHA bits (See Figure 48). Note: The idle state of SCK must correspond to the polarity ...
Page 81
SERIAL PERIPHERAL INTERFACE (Cont’d) 10.4.5 Error Flags 10.4.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 ...
Page 82
ST7232A SERIAL PERIPHERAL INTERFACE (Cont’d) 10.4.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 50). The master device selects the individual slave de- vices ...
Page 83
SERIAL PERIPHERAL INTERFACE (Cont’d) 10.4.6 Low Power Modes Mode Description No effect on SPI. WAIT SPI interrupt events cause the device to exit from WAIT mode. SPI registers are frozen. In HALT mode, the SPI is inactive. SPI oper- ation ...
Page 84
ST7232A SERIAL PERIPHERAL INTERFACE (Cont’d) 10.4.8 Register Description CONTROL REGISTER (SPICR) Read/Write Reset Value: 0000 xxxx (0xh) 7 SPIE SPE SPR2 MSTR CPOL Bit 7 = SPIE Serial Peripheral Interrupt Enable. This bit is set and cleared by software. 0: ...
Page 85
SERIAL PERIPHERAL INTERFACE (Cont’d) CONTROL/STATUS REGISTER (SPICSR) Read/Write (some bits Read Only) Reset Value: 0000 0000 (00h) 7 SPIF WCOL OVR MODF Bit 7 = SPIF Serial Peripheral Data Transfer Flag (Read only). This bit is set by hardware when ...
Page 86
ST7232A SERIAL PERIPHERAL INTERFACE (Cont’d) Table 19. SPI Register Map and Reset Values Address Register 7 (Hex.) Label SPIDR MSB 0021h Reset Value SPICR SPIE 0022h Reset Value SPICSR SPIF 0023h Reset Value 86/157 ...
Page 87
SERIAL COMMUNICATIONS INTERFACE (SCI) 10.5.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 of- fers a very wide range ...
Page 88
ST7232A SERIAL COMMUNICATIONS INTERFACE (Cont’d) Figure 51. SCI Block Diagram Write Transmit Data Register (TDR) TDO Transmit Shift Register RDI TRANSMIT CONTROL CR2 TIE TCIE RIE SCI INTERRUPT CONTROL TRANSMITTER CLOCK f CPU 88/157 1 Read Received Data Register (RDR) ...
Page 89
SERIAL COMMUNICATIONS INTERFACE (Cont’d) 10.5.4 Functional Description The block diagram of the Serial Control Interface, is shown in Figure 51. It contains 6 dedicated reg- isters: – Two control registers (SCICR1 & SCICR2) – A status register (SCISR) – A ...
Page 90
ST7232A SERIAL COMMUNICATIONS INTERFACE (Cont’d) 10.5.4.2 Transmitter The transmitter can send data words of either bits depending on the M bit status. When the M bit is set, word length is 9 bits and the 9th bit ...
Page 91
SERIAL COMMUNICATIONS INTERFACE (Cont’d) 10.5.4.3 Receiver The SCI can receive data words of either bits. When the M bit is set, word length is 9 bits and the MSB is stored in the R8 bit in the ...
Page 92
ST7232A SERIAL COMMUNICATIONS INTERFACE (Cont’d) Figure 53. SCI Baud Rate and Extended Prescaler Block Diagram EXTENDED PRESCALER TRANSMITTER RATE CONTROL EXTENDED TRANSMITTER PRESCALER REGISTER EXTENDED RECEIVER PRESCALER REGISTER EXTENDED PRESCALER RECEIVER RATE CONTROL f CPU /PR /16 SCP1 CONVENTIONAL BAUD ...
Page 93
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-synchroni- zation or excessive noise. – A break is received. When the ...
Page 94
ST7232A SERIAL COMMUNICATIONS INTERFACE (Cont’d) 10.5.4.7 Parity Control Parity control (generation of parity bit in transmis- sion and parity checking in reception) can be ena- bled by setting the PCE bit in the SCICR1 register. Depending on the frame length ...
Page 95
SERIAL COMMUNICATIONS INTERFACE (Cont’d) 10.5.4.9 Clock Deviation Causes The causes which contribute to the total deviation are: – Deviation due to transmitter error (Local TRA oscillator error of the transmitter or the trans- mitter is transmitting at a ...
Page 96
ST7232A SERIAL COMMUNICATIONS INTERFACE (Cont’d) 10.5.5 Low Power Modes Mode Description No effect on SCI. WAIT SCI interrupts cause the device to exit from Wait mode. SCI registers are frozen. In Halt mode, the SCI stops transmit- HALT ting/receiving until ...
Page 97
SERIAL COMMUNICATIONS INTERFACE (Cont’d) 10.5.7 Register Description STATUS REGISTER (SCISR) Read Only Reset Value: 1100 0000 (C0h) 7 TDRE TC RDRF IDLE OR Bit 7 = TDRE Transmit data register empty. This bit is set by hardware when the content ...
Page 98
ST7232A SERIAL COMMUNICATIONS INTERFACE (Cont’d) CONTROL REGISTER 1 (SCICR1) Read/Write Reset Value: x000 0000 (x0h SCID M WAKE Bit Receive data bit 8. This bit is used to store the 9th bit of the ...
Page 99
SERIAL COMMUNICATIONS INTERFACE (Cont’d) CONTROL REGISTER 2 (SCICR2) Read/Write Reset Value: 0000 0000 (00h) 7 TIE TCIE RIE ILIE TE Bit 7 = TIE Transmitter interrupt enable. This bit is set and cleared by software. 0: Interrupt is inhibited 1: ...
Page 100
ST7232A SERIAL COMMUNICATIONS INTERFACE (Cont’d) DATA REGISTER (SCIDR) Read/Write Reset Value: Undefined Contains the Received or Transmitted data char- acter, depending on whether it is read from or writ- ten to. 7 DR7 DR6 DR5 DR4 DR3 The Data register ...
Page 101
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 divi- sion factor for the receive circuit. 7 ERPR ERPR ERPR ERPR ERPR ...
Page 102
ST7232A SERIAL COMMUNICATION INTERFACE (Cont’d) Table 22. SCI Register Map and Reset Values Address Register 7 (Hex.) Label SCISR TDRE 0050h Reset Value 1 SCIDR MSB 0051h Reset Value x SCIBRR SCP1 0052h Reset Value 0 SCICR1 R8 0053h Reset ...
Page 103
A/D CONVERTER (ADC) 10.6.1 Introduction The on-chip Analog to Digital Converter (ADC) pe- ripheral is a 10-bit, successive approximation con- verter with internal sample and hold circuitry. This peripheral has multiplexed analog input channels (refer ...
Page 104
ST7232A 10-BIT A/D CONVERTER (ADC) (Cont’d) 10.6.3 Functional Description The conversion is monotonic, meaning that the re- sult never decreases if the analog input does not and never increases if the analog input does not. If the input voltage (V ...
Page 105
A/D CONVERTER (ADC) (Cont’d) 10.6.6 Register Description CONTROL/STATUS REGISTER (ADCCSR) Read/Write (Except bit 7 read only) Reset Value: 0000 0000 (00h) 7 EOC SPEED ADON 0 CH3 Bit 7 = EOC End of Conversion This bit is set by ...
Page 106
ST7232A 10-BIT A/D CONVERTER (Cont’d) Table 23. ADC Register Map and Reset Values Address Register 7 (Hex.) Label ADCCSR EOC 0070h Reset Value 0 ADCDRH D9 0071h Reset Value 0 ADCDRL 0072h Reset Value 0 106/157 ...
Page 107
INSTRUCTION SET 11.1 CPU ADDRESSING MODES The CPU features 17 different addressing modes which can be classified in 7 main groups: Addressing Mode Example Inherent nop Immediate ld A,#$55 Direct ld A,$55 Indexed ld A,($55,X) Indirect ld A,([$55],X) Relative ...
Page 108
ST7232A INSTRUCTION SET OVERVIEW (Cont’d) 11.1.1 Inherent All Inherent instructions consist of a single byte. The opcode fully specifies all the required informa- tion for the CPU to process the operation. Inherent Instruction NOP No operation TRAP S/W Interrupt Wait ...
Page 109
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 un- signed addition of an index register ...
Page 110
ST7232A INSTRUCTION SET OVERVIEW (Cont’d) 11.2 INSTRUCTION GROUPS The ST7 family devices use an Instruction Set consisting of 63 instructions. The instructions may Load and Transfer Stack operation Increment/Decrement Compare and Tests Logical operations Bit Operation Conditional Bit Test and ...
Page 111
INSTRUCTION SET OVERVIEW (Cont’d) Mnemo Description ADC Add with Carry ADD Addition AND Logical And BCP Bit compare A, Memory BRES Bit Reset BSET Bit Set BTJF Jump if bit is false (0) BTJT Jump if bit is true (1) ...
Page 112
ST7232A INSTRUCTION SET OVERVIEW (Cont’d) Mnemo Description JRULE Jump Load MUL Multiply NEG Negate (2's compl) NOP No Operation OR OR operation POP Pop from the Stack PUSH Push onto the Stack RCF ...
Page 113
ELECTRICAL CHARACTERISTICS 12.1 PARAMETER CONDITIONS Unless otherwise specified, all voltages are re- ferred 12.1.1 Minimum and Maximum values Unless otherwise specified the minimum and max- imum values are guaranteed in the worst condi- tions of ...
Page 114
ST7232A 12.2 ABSOLUTE MAXIMUM RATINGS Stresses above those listed as “absolute maxi- mum ratings” may cause permanent damage to the device. This is a stress rating only and func- tional operation of the device under these condi- 12.2.1 Voltage Characteristics ...
Page 115
Thermal Characteristics Symbol T Storage temperature range STG T Maximum junction temperature (see J 12.3 OPERATING CONDITIONS 12.3.1 Operating Conditions Symbol Parameter f Internal clock frequency CPU Operating voltage (except Flash Write/ Erase Operating Voltage for Flash ...
Page 116
ST7232A 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 consump- tion, the two current values ...
Page 117
SUPPLY CURRENT CHARACTERISTICS (Cont’d) 12.4.1.1 Power Consumption vs f Figure 59. Typical I in RUN mode Vdd (V) Figure 60. Typical I in SLOW mode DD 1.2 1 0.8 0.6 0.4 0.2 ...
Page 118
ST7232A 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 consump- ...
Page 119
SUPPLY CURRENT CHARACTERISTICS (Cont’d) 12.4.3 On-Chip Peripherals T = 25°C f =4MHz. A CPU Symbol I 16-bit Timer supply current DD(TIM) I SPI supply current DD(SPI) I SCI supply current DD(SCI) I ADC supply current when converting DD(ADC) Notes: 1. ...
Page 120
ST7232A 12.5 CLOCK AND TIMING CHARACTERISTICS Subject to general operating conditions for V 12.5.1 General Timings Symbol Parameter t Instruction cycle time c(INST) Interrupt reaction time t = ∆t v(IT v(IT) c(INST) 12.5.2 External Clock Source Symbol ...
Page 121
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 are based on characterization results with specified typical external ...
Page 122
ST7232A CLOCK AND TIMING CHARACTERISTICS (Cont’d) Typical Ceramic Resonators (information for guidance only) Oscil. 3) Reference LP CSA2.00MG MP CSA4.00MG MS CSA8.00MTZ 4) HS CSA16.00MXZ040 Notes: 1. Resonator characteristics given by the ceramic resonator manufacturer the typical ...
Page 123
CLOCK CHARACTERISTICS (Cont’d) 12.5.4 PLL Characteristics Symbol Parameter f PLL input frequency range OSC ∆ Instantaneous PLL jitter CPU CPU Note: 1. Data characterized but not tested. The user must take the PLL jitter into account in ...
Page 124
ST7232A 12.6 MEMORY CHARACTERISTICS 12.6.1 RAM and Hardware Registers Symbol Parameter V Data retention mode RM 12.6.2 FLASH Memory DUAL VOLTAGE HDFLASH MEMORY Symbol Parameter f Operating frequency CPU V Programming voltage Supply current ...
Page 125
EMC CHARACTERISTICS Susceptibility tests are performed on a sample ba- sis 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 ...
Page 126
ST7232A 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 ...
Page 127
... Dynamic latch-up class Notes: 1. Class description: A Class is an STMicroelectronics internal specification. All its limits are higher than the JEDEC spec- ifications, that means when a device belongs to Class A it exceeds the JEDEC standard. B Class strictly covers all the JEDEC criteria (international standard). ...
Page 128
ST7232A 12.8 I/O PORT PIN CHARACTERISTICS 12.8.1 General Characteristics Subject to general operating conditions for V Symbol Parameter Input low level voltage (standard voltage devices) V Input high level voltage IH V Schmitt trigger voltage hysteresis hys ...
Page 129
I/O PORT PIN CHARACTERISTICS (Cont’d) 12.8.2 Output Driving Current Subject to general operating conditions for V Symbol Parameter Output low level voltage for a standard I/O pin when 8 pins are sunk at same time (see Figure 68 ...
Page 130
ST7232A I/O PORT PIN CHARACTERISTICS (Cont’d) Figure 71. Typical V vs 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0 2.5 3 3.5 Vdd(V ) Figure 72. Typical V vs ...
Page 131
CONTROL PIN CHARACTERISTICS 12.9.1 Asynchronous RESET Pin Subject to general operating conditions for V Symbol Parameter V Schmitt trigger voltage hysteresis hys V Input low level voltage IL V Input high level voltage IH V Output low level voltage ...
Page 132
ST7232A CONTROL PIN CHARACTERISTICS (Cont’d) Figure 74. RESET pin protection Recommended for EMC V DD 0.01µF USER EXTERNAL RESET CIRCUIT 0.01µF Required 1. The reset network protects the device against parasitic resets. 2. The output of the external reset circuit ...
Page 133
CONTROL PIN CHARACTERISTICS (Cont’d) 12.9.2 ICCSEL/V Pin PP Subject to general operating conditions for V Symbol Parameter V Input low level voltage IL V Input high level voltage IH I Input leakage current L Figure 75. Two typical Applications with ...
Page 134
ST7232A 12.10 TIMER PERIPHERAL CHARACTERISTICS Subject to general operating conditions for V Refer to I/O port characteristics for more details on the input/output alternate function characteristics (out- put compare, input capture, external clock, PWM output...). Data based on design simulation ...
Page 135
COMMUNICATION INTERFACE CHARACTERISTICS 12.11.1 SPI - Serial Peripheral Interface Subject to general operating conditions for V design simulation and/or characterisation results, not tested in production. When no communication is on-going the data output line of the SPI (MOSI in ...
Page 136
ST7232A COMMUNICATION INTERFACE CHARACTERISTICS (Cont’d) Figure 77. SPI Slave Timing Diagram with CPHA=1 SS INPUT t su(SS) CPHA=1 CPOL=0 CPHA=1 CPOL=1 t w(SCKH) t a(SO) t w(SCKL) see MISO OUTPUT HZ note 2 t su(SI) MOSI INPUT Figure 78. SPI ...
Page 137
ADC CHARACTERISTICS Subject to general operating conditions for V Symbol Parameter f ADC clock frequency ADC V Analog reference voltage AREF V Conversion voltage range AIN Positive input leakage current for analog I 2) lkg input R External ...
Page 138
ST7232A ADC CHARACTERISTICS (Cont’d) Figure 79. R max AIN ADC (pF) PARASITIC Figure 81. Typical A/D Converter Application R AIN V AIN Notes ...
Page 139
ADC CHARACTERISTICS (Cont’d) 12.12.1 Analog Power Supply and Reference Pins Depending on the MCU pin count, the package may feature separate V AREF power supply pins. These pins supply power to the A/D converter cell and function as the high ...
Page 140
ST7232A 10-BIT ADC CHARACTERISTICS (Cont’d) 12.12.3 ADC Accuracy 1) Conditions: V =5V DD Symbol Parameter Total unadjusted error Offset error Gain Error Differential linearity error D ...
Page 141
PACKAGE CHARACTERISTICS 13.1 PACKAGE MECHANICAL DATA Figure 84. 32-Pin Thin Quad Flat Package Figure 85. 32-Pin Plastic Dual In-Line Package, Shrink 400-mil Width ...
Page 142
ST7232A Figure 86. 42-Pin Plastic Dual In-Line Package, Shrink 600-mil Width b2 D Figure 87. 44-Pin Thin Quad Flat Package D D1 Figure 88. 142/157 0.015 GAGE ...
Page 143
THERMAL CHARACTERISTICS Symbol Package thermal resistance (junction to ambient) R thJA P Power dissipation D T Maximum junction temperature Jmax Notes: 1. The power dissipation is obtained from the formula P and P is the port power dissipation determined ...
Page 144
... ST7232A 13.3 SOLDERING INFORMATION In accordance with the RoHS European directive, all STMicroelectronics packages will be converted in 2005 to lead-free technology, named ECO- TM PACK (for a detailed roadmap, please refer to PCN CRP/04/744 "Lead-free Conversion Program - Compliance with RoHS", issued November 18th, 2004). TM ECOPACK packages are qualified according ■ ...
Page 145
ST7232A DEVICE CONFIGURATION AND ORDERING INFORMATION Each device is available for production in user pro- grammable versions (FLASH) as well as in factory coded versions (ROM). ST7232A devices are ROM versions. ST72P32A devices are Factory Advanced Service Technique ROM ...
Page 146
ST7232A ST7232A DEVICE CONFIGURATION AND ORDERING INFORMATION (Cont’d) OPTION BYTE 1 OPT7= PKG1 Pin package selection bit This option bit selects the package. Version Selected Package K TQFP32 / SDIP32 J TQFP44 / SDIP42 Note: On the chip, each I/O ...
Page 147
... XXX Code name (defined by STMicroelectronics) 1= Standard 0 to +70 °C 5= Standard -10 to +85 °C 6= Standard -40 to +85 ° Automotive -40 to +85 ° Automotive -40 to +105 ° Automotive -40 to +125 °C T= Plastic Thin Quad Flat Pack B= Plastic Dual in Line ST7232AK1, ST7232AK2, ST7232AJ1, ST7232AJ2 ST7232A 147/157 1 ...
Page 148
... Yes " " (TQFP32 7 char., other pkg. 10 char. max LP: Low power resonator ( MHz MP: Medium power resonator ( MHz MS: Medium speed resonator ( MHz HS: High speed resonator ( MHz) ( Disabled [ ] 256 Cycles [ ] 4096 Cycles [ ] Software Activation [ ] Reset [ ] Disabled Signature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ST7232AK2T [ ] ST7232AK2B [ ] ST7232AJ2T [ ] ST7232AJ2B Enabled [ ] Hardware Activation [ ] No Reset [ ] Enabled ...
Page 149
DEVICE CONFIGURATION AND ORDERING INFORMATION (Cont’d) 14.3 VERSION-SPECIFIC SALES CONDITIONS To satisfy the different customer requirements and to ensure that ST Standard Microcontrollers will consistently meet or exceed the expectations of each Market Segment, the Codification System for Standard Microcontrollers ...
Page 150
... ST7232A 14.5 DEVELOPMENT TOOLS STMicroelectronics offers a range of hardware and software development tools for the ST7 micro- controller family. Full details of tools available for the ST7 from third party manufacturers can be ob- tain from the STMicroelectronics Internet site: ➟ http//:mcu.st.com. Tools from these manufacturers include C compli- ers, emulators and gang programmers ...
Page 151
Socket and Emulator Information For information on the type of socket that is sup- plied with the emulator, refer to the suggested list of sockets in Table 29. Note: Before designing the board layout rec- ommended to ...
Page 152
ST7232A 14.6 ST7 APPLICATION NOTES Table 30. ST7 Application Notes IDENTIFICATION DESCRIPTION APPLICATION EXAMPLES AN1658 SERIAL NUMBERING IMPLEMENTATION AN1720 MANAGING THE READ-OUT PROTECTION IN FLASH MICROCONTROLLERS AN1755 A HIGH RESOLUTION/PRECISION THERMOMETER USING ST7 AND NE555 EXAMPLE DRIVERS AN 969 SCI ...
Page 153
Table 30. ST7 Application Notes IDENTIFICATION DESCRIPTION AN 983 KEY FEATURES OF THE COSMIC ST7 C-COMPILER PACKAGE AN 985 EXECUTING CODE IN ST7 RAM AN 986 USING THE INDIRECT ADDRESSING MODE WITH ST7 AN 987 ST7 SERIAL TEST CONTROLLER PROGRAMMING ...
Page 154
ST7232A 15 KNOWN LIMITATIONS 15.1 ALL FLASH AND ROM DEVICES 15.1.1 Safe Connection of OSC1/OSC2 Pins The OSC1 and/or OSC2 pins must not be left un- connected otherwise the ST7 main oscillator may start and, in this configuration, could generate ...
Page 155
DEVICE CONFIGURATION AND ORDERING INFORMATION (Cont’d) tion is not doing anything between the idle and the break. This can be ensured by temporarily disa- bling interrupts. The exact sequence is: - Disable interrupts - Reset and Set TE (IDLE request) ...
Page 156
ST7232A 16 REVISION HISTORY Table 32. Revision History Date Revision Apr-2005 1 First Release. Added TQFP44 and SDIP42 sales types Added -40°C to 105°C and -40°C to 125°C sales types: changes in device summa 1st page, 12.7.3.2 on ...
Page 157
... No license is granted by implication or otherwise under any patent or patent rights of STMicroelectronics. Specifications mentioned in this publication are subject to change without notice. This publication supersedes and replaces all information previously supplied. STMicroelectronics products are not authorized for use as critical components in life support devices or systems without express written approval of STMicroelectronics ...