Page 2
MC96F6432 REVISION HISTORY VERSION 0.0 (January 14, 2011) VERSION 1.0 (June 27, 2011) Change ‘Typ/Max’ to “LVR/LVI level” in LVR/LVI electrical characteristics. Change ‘600/1200/2000 kΩ (Min/Typ/Max)’ to “RX1” in DC electrical characteristics. Change ‘3/6/9 kHz (Min/Typ/Max)’ to “f ” in INTERNAL WATCH-DOG RC OSCILLATION characteristics. WDTRC Remove WDTRC Current Max value at INTERNAL WATCH-DOG RC OSCILLATION characteristics.
Page 3
MC96F6432 VERSION 1.7 (November 19, 2013) Retype a typo on ‘P5FSR register’s contents’. VERSION 1.8 (February 26, 2014) Change a package diagram, “44-Pin MQFP-1010”. VERSION 1.9 (March 21, 2014) AVREF range changed from 1.8V~VDD to 2.7V~VDD Figure 10.3 and Figure 10.6 modified Appendix 1 “DJNZ Rn,rel”...
Page 4
Additional information of this manual may be served by ABOV Semiconductor offices in Korea or Distributors. ABOV Semiconductor reserves the right to make changes to any information here in at any time without notice. The information, diagrams and other data in this manual are correct and reliable; however, ABOV Semiconductor is in no way responsible for any violations of patents or other rights of the third party generated by the use of this manual.
MC96F6432 Table of Contents 1. Overview ................................13 1.1 Description ..............................13 1.2 Features ..............................14 1.3 Ordering Information ..........................15 1.4 Development Tools ............................ 16 2. Block Diagram ..............................19 3. Pin Assignment ..............................20 4. Package Diagram .............................. 24 5.
Page 6
MC96F6432 9.8 P5 Port ............................... 83 9.9 Port Function .............................. 84 10. Interrupt Controller ............................93 10.1 Overview ..............................93 10.2 External Interrupt ............................94 10.3 Block Diagram ............................95 10.4 Interrupt Vector Table ..........................96 10.5 Interrupt Sequence ........................... 96 10.6 Effective Timing after Controlling Interrupt Bit ..................
Page 7
MC96F6432 16. Configure Option ............................317 16.1 Configure Option Control ........................317 17. APPENDIX ..............................318 List of Figures Figure 1.1 Debugger(OCD1/OCD2) and Pin description ................ 16 Figure 1.2 E-PGM+(Single writer) ......................17 Figure 1.3 E-GANG4 and E-GANG6 (for Mass Production) ..............18 Figure 2.1 Block Diagram ........................
Page 8
MC96F6432 Figure 10.2 Block Diagram of Interrupt ....................95 Figure 10.3 Interrupt Sequence Flow ...................... 97 Figure 10.4 Effective Timing of Interrupt Enable Register..............98 Figure 10.5 Effective Timing of Interrupt Flag Register ................98 Figure 10.6 Effective Timing of Multi-Interrupt ..................99 Figure 10.7 Interrupt Response Timing Diagram ..................
Page 9
MC96F6432 Figure 11.41 Example of PWM External Synchronization with BLNK Input .......... 163 Figure 11.42 Example of Force Drive All Channel with A-ch ..............164 Figure 11.43 Example of Force Drive 6-ch Mode ................. 165 Figure 11.44 Example of PWM Delay ....................167 Figure 11.45 Two 8-Bit Timer 3, 4 Block Diagram ................
Page 10
MC96F6432 Figure 11.90 Data Transfer on the I2C-Bus (USI1) ................248 Figure 11.91 Acknowledge on the I2C-Bus (USI1) ................249 Figure 11.92 Clock Synchronization during Arbitration Procedure (USI1) ..........250 Figure 11.93 Arbitration Procedure of Two Masters (USI1) ..............250 Figure 11.94 Formats and States in the Master Transmitter Mode (USI1)..........
MC96F6432 MC96F6432 CMOS SINGLE-CHIP 8-BIT MICROCONTROLLER WITH 12-BIT A/D CONVERTER 1. Overview 1.1 Description The MC96F6432 is an advanced CMOS 8-bit microcontroller with 32k bytes of FLASH. This is powerful microcontroller which provides a highly flexible and cost effective solution to many embedded control applications. This provides the following features : 32 Kbytes of FLASH, 256 bytes of IRAM, 768 bytes of XRAM , general purpose I/O, basic interval timer, watchdog timer, 8/16-bit timer/counter, 16-bit PPG output, 8-bit PWM output, 10-bit PWM output, watch timer, buzzer driving port, SPI, USI, 12-bit A/D converter, LCD driver, on-chip POR,...
8051 compiler. 1.4.2 OCD emulator and debugger The OCD (On Chip Debug) emulator supports ABOV Semiconductor’s 8051 series MCU emulation. The OCD interface uses two-wire interfacing between PC and MCU which is attached to user’s system. The OCD can read or change the value of MCU internal memory and I/O peripherals.
MC96F6432 OCD emulator: It can write code in MCU device too, because OCD debugging supports ISP (In System Programming). It does not require additional H/W, except developer’s target system. Gang programmer: E-GANG4 and E-GANG6 It can run PC controlled mode. It can run standalone without PC control too.
MC96F6432 P53/SXIN/T0O/PWM0O P03/SEG26/AN1/EINT1/PWM4AB P54/SXOUT/EINT10 P04/SEG25/AN2/EINT2/PWM4BA P55/RESETB P05/SEG24/AN3/EINT3/PWM4BB P40/VLC3/RXD0/SCL0/MISO0 P06/SEG23/AN4/EINT4/PWM4CA MC96F6332L P41/VLC2/TXD0/SDA0/MOSI0 P07/SEG22/AN5/EINT5/PWM4CB (32-LQFP) P42/VLC1/SCK0 P13/SEG17/AN10/EC1/BUZO P33/COM4/SEG2 P12/SEG16/AN11/EINT11/T1O/PWM1O P32/COM5/SEG3 P11/SEG15/AN12/EINT12/T2O/PWM2O Figure 3.3 MC96F6332L 32LQFP Pin Assignment NOTES) 1. On On-Chip Debugging, ISP uses P0[1:0] pin as DSDA, DSCL. 2. The P14-P17, P23-P25, P34-P37 and P43 pins should be selected as a push-pull output or an input with pull-up resistor by software control when the 32-pin package is used.
MC96F6432 5. Pin Description Table 5-1 Normal Pin Description Function @RESET Shared with Name Port 0 is a bit-programmable I/O port which can Input EC3/DSDA be configured as a schmitt-trigger input, a T3O/DSCL push-pull output, or an open-drain output. AN0/AVREF/EINT0/T4O/PWM4AA A pull-up resistor can be specified in 1-bit unit.
Page 30
MC96F6432 Table 5-1 Normal Pin Description (Continued) Function @RESET Shared with Name Port 5 is a bit-programmable I/O port which Input XOUT can be configured as a schmitt-trigger input or a push-pull output. EINT8/EC0/BLNK A pull-up resistor can be specified in 1-bit SXIN/T0O/PWM0O unit.
Page 31
MC96F6432 Table 5-1 Normal Pin Description (Continued) Function @RESET Shared with Name BUZO Buzzer signal output Input P13/SEG17/AN10/EC1 SCK0 Serial 0 clock input/output Input P42/VLC1 SCK1 Serial 1 clock input/output Input P21/SEG12/AN15 SCK2 Serial 2 clock input/output Input P16/SEG20/AN7/EINT7 MOSI0 SPI 0 master output, slave input Input P41/VLC2/TXD0/SDA0...
Page 32
MC96F6432 Table 5-1 Normal Pin Description (Continued) Function @RESET Shared with Name VLC0 LCD bias voltage pins Input P43/SS0 VLC1 P42/SCK0 VLC2 P41/TXD0/SDA0/MOSI0 VLC3 P40/RXD0/SCL0/MISO0 COM0– LCD common signal outputs Input P37–P36 COM1 COM2– P35–P34/SEG0–SEG1 COM3 COM4– P33–P30/SEG2–SEG5 COM7 SEG0– LCD segment signal outputs Input P35–P34/COM2–COM3...
Page 33
MC96F6432 Table 5-1 Normal Pin Description (Continued) Function @RESET Shared with Name System reset pin with a pull-up resistor when it Input RESETB is selected as the RESETB by CONFIGURE OPTION (NOTE4,5) DSDA On chip debugger data input/output Input P00/EC3 (NOTE4,5) DSCL On chip debugger clock input...
MC96F6432 6. Port Structures 6.1 General Purpose I/O Port Level Shift (1.8V to ExtVDD) Level Shift (ExtVDD to 1.8V) PULL-UP REGISTER OPEN DRAIN REGISTER DATA REGISTER SUB-FUNC DATA OUTPUT SUB-FUNC ENABLE SUB-FUNC DIRECTION DIRECTION REGISTER CMOS or Schmitt Level Input PORTx INPUT or SUB-FUNC DATA INPUT ANALOG CHANNEL...
MC96F6432 6.2 External Interrupt I/O Port Level Shift (1.8V to ExtVDD) Level Shift (ExtVDD to 1.8V) PULL-UP REGISTER OPEN DRAIN REGISTER DATA REGISTER SUB-FUNC DATA OUTPUT SUB-FUNC ENABLE SUB-FUNC DIRECTION DIRECTION REGISTER EXTERNAL INTERRUPT POLARITY REG. INTERRUPT ENABLE FLAG CMOS or CLEAR Schmitt Level Input...
MC96F6432 7. Electrical Characteristics 7.1 Absolute Maximum Ratings Table 7-1 Absolute Maximum Ratings Parameter Symbol Rating Unit Note – Supply Voltage -0.3 ~ +6.5 -0.3 ~ VDD+0.3 Voltage on any pin with respect to VSS -0.3 ~ VDD+0.3 Maximum current output sourced by (I I/O pin) Normal Voltage Pin ∑...
MC96F6432 7.9 DC Characteristics Table 7-9 DC Characteristics = -40°C ~ +85°C, VDD= 1.8V ~ 5.5V, VSS= 0V, f = 12MHz) Parameter Symbol Conditions Unit – P0, P1, P5, RESETB 0.8VDD Input High Voltage – All input pins except V 0.7VDD –...
MC96F6432 7.12 UART0/1 Characteristics Table 7-12 UART0/1 Characteristics = -40°C ~ +85°C, VDD= 1.8V ~ 5.5V, f =11.1MHz) Parameter Symbol Unit Serial port clock cycle time 1250 x 16 1650 – Output data setup to clock rising edge x 13 –...
MC96F6432 7.14 Data Retention Voltage in Stop Mode Table 7-14 Data Retention Voltage in Stop Mode = -40°C ~ +85°C, VDD= 1.8V ~ 5.5V) Parameter Symbol Conditions Unit – – Data retention supply voltage DDDR VDDR= 1.8V, – – Data retention supply current DDDR = 25°C), Stop mode Idle Mode...
MC96F6432 7.19 Main Oscillation Stabilization Characteristics Table 7-19 Main Oscillation Stabilization Characteristics = -40°C ~ +85°C, VDD= 1.8V ~ 5.5V) Oscillator Parameter Unit fx > 1MHz – – Crystal Oscillation stabilization occurs when VDD is equal to the minimum oscillator voltage –...
MC96F6432 7.21 Operating Voltage Range =0.4 to 12MHz) =32 to 38kHz) 12.0MHz 32.768kHz 10.0MHz 4.2MHz 0.4MHz Supply voltage (V) Supply voltage (V) Figure 7.14 Operating Voltage Range June 22, 2018 Ver. 2.9...
MC96F6432 7.22 Recommended Circuit and Layout This 0.1uF capacitor should be within 1cm from the VDD pin of MCU on the VDD VCC PCB layout. DC Power 0.1uF 0.1uF The MCU power line (VDD and VSS) should be separated from the high- current part at a DC power node on High-Current Part the PCB layout.
MC96F6432 7.23 Recommended Circuit and Layout with SMPS Power SMPS Side MCU Side SMPS 1. The C1 capacitor is to flatten out the voltage of the SMPS power, VCC. √ Recommended C1: 470uF/25V more. 2. The R1 and C2 are the RC filter for VDD and suppress the ripple of VCC. √...
MC96F6432 7.24 Typical Characteristics These graphs and tables provided in this section are only for design guidance and are not tested or guaranteed. In graphs or tables some data are out of specified operating range (e.g. out of specified VDD range). This is only for information and devices are guaranteed to operate properly only within the specified range.
MC96F6432 8. Memory The MC96F6432 addresses two separate address memory stores: Program memory and Data memory. The logical separation of Program and Data memory allows Data memory to be accessed by 8-bit addresses, which makes the 8-bit CPU access the data memory more rapidly. Nevertheless, 16-bit Data memory addresses can also be generated through the DPTR register.
MC96F6432 8.2 Data Memory Figure 8-2 shows the internal data memory space available. Upper 128 Bytes Special Function Registers Internal RAM 128 Bytes (Indirect Addressing) (Direct Addressing) Lower 128 Bytes Internal RAM (Direct or Indirect Addressing) Figure 8.2 Data Memory Map The internal data memory space is divided into three blocks, which are generally referred to as the lower 128 bytes, upper 128 bytes, and SFR space.
MC96F6432 8.3 XRAM Memory MC96F6432 has 768 bytes XRAM. This area has no relation with RAM/FLASH. It can be read and written to through SFR with 8-bit unit. 107FH Extended Special Function Registers 128 Bytes (Indirect Addressing) 1000H Not used 02FFH External RAM 768 Bytes...
MC96F6432 8.4.2 SFR Map Table 8-3 SFR Map @Reset Address Function Symbol P0 Data Register Stack Pointer Data Pointer Register Low Data Pointer Register High Data Pointer Register Low 1 DPL1 Data Pointer Register High 1 DPH1 – – Low Voltage Indicator Control Register LVICR –...
Page 67
MC96F6432 Table 8-2 SFR Map (Continued) @Reset Address Function Symbol External Interrupt Flag 0 Register EIFLAG0 P3 Direction Register P3IO – – Timer 2 Control Low Register T2CRL – – – – Timer 2 Control High Register T2CRH Timer 2 A Data Low Register T2ADRL Timer 2 A Data High Register T2ADRH...
Page 68
MC96F6432 Table 8-2 SFR Map (Continued) @Reset Address Function Symbol Accumulator Register – USI0 Status Register 1 USI0ST1 USI0 Status Register 2 USI0ST2 USI0 Baud Rate Generation Register USI0BD USI0 SDA Hold Time Register USI0SHDR USI0 Data Register USI0DR USI0 SCL Low Period Register USI0SCLR USI0 SCL High Period Register USI0SCHR...
Page 69
MC96F6432 Table 8-2 SFR Map (Continued) @Reset Address Function Symbol – 1000H Timer 3 Control Register T3CR Timer 3 Counter Register T3CNT 1001H Timer 3 Data Register T3DR Timer 3 Capture Data Register T3CAPR 1002H Timer 4 Control Register T4CR 1003H Timer 4 PWM Control Register 1 T4PCR1...
Page 70
MC96F6432 8.4.3 Compiler Compatible SFR ACC (Accumulator Register) : E0H Initial value : 00H Accumulator B (B Register) : F0H Initial value : 00H B Register SP (Stack Pointer) : 81H Initial value : 07H Stack Pointer DPL (Data Pointer Register Low) : 82H Initial value : 00H Data Pointer Low DPH (Data Pointer Register High) : 83H...
Page 71
MC96F6432 DPL1 (Data Pointer Register Low 1) : 84H DPL1 Initial value : 00H DPL1 Data Pointer Low 1 DPH1 (Data Pointer Register High 1) : 85H DPH1 Initial value : 00H DPH1 Data Pointer High 1 PSW (Program Status Word Register) : D0H Initial value : 00H Carry Flag Auxiliary Carry Flag...
MC96F6432 9. I/O Ports 9.1 I/O Ports The MC96F6432 has ten groups of I/O ports (P0 ~ P5). Each port can be easily configured by software as I/O pin, internal pull up and open-drain pin to meet various system configurations and design requirements. Also P0 includes function that can generate interrupt according to change of state of the pin.
MC96F6432 9.5 P2 Port 9.5.1 P2 Port Description P2 is 8-bit I/O port. P2 control registers consist of P2 data register (P2), P2 direction register (P2IO), P2 pull-up resistor selection register (P2PU) and P2 open-drain selection register (P2OD). Refer to the port function selection registers for the P2 function selection.
MC96F6432 9.6 P3 Port 9.6.1 P3 Port Description P3 is 8-bit I/O port. P3 control registers consist of P3 data register (P3), P3 direction register (P3IO) and P3 pull-up resistor selection register (P3PU). Refer to the port function selection registers for the P3 function selection.
MC96F6432 9.7 P4 Port 9.7.1 P4 Port Description P4 is 4-bit I/O port. P4 control registers consist of P4 data register (P4), P4 direction register (P4IO), P4 pull-up resistor selection register (P4PU) and P4 open-drain selection register (P4OD). Refer to the port function selection registers for the P4 function selection.
MC96F6432 9.8 P5 Port 9.8.1 P5 Port Description P5 is 6-bit I/O port. P5 control registers consist of P5 data register (P5), P5 direction register (P5IO) and P5 pull-up resistor selection register (P5PU) . Refer to the port function selection registers for the P5 function selection.
MC96F6432 9.9 Port Function 9.9.1 Port Function Description Port function control registers consist of Port function selection register 0 ~ 5. (P0FSRH/L ~ P5FSR). 9.9.2 Register description for P0FSRH/L ~ P5FSR P0FSRH (Port 0 Function Selection High Register) : D3H –...
Page 85
MC96F6432 P0FSRL (Port 0 Function Selection Low Register) : D2H – P0FSRL6 P0FSRL5 P0FSRL4 P0FSRL3 P0FSRL2 P0FSRL1 P0FSRL0 – Initial value : 00H P0FSRL[6:5] P04 Function Select P0FSRL6 P0FSRL5 Description I/O Port (EINT2 function possible when input) SEG25 Function AN2 Function PWM4BA Function P0FSRL[4:3] P03 Function Select...
Page 86
MC96F6432 P1FSRH (Port 1 Function Selection High Register) : D5H P1FSRH7 P1FSRH6 P1FSRH5 P1FSRH4 P1FSRH3 P1FSRH2 P1FSRH1 P1FSRH0 Initial value : 00H P1FSRH[7:6] P17 Function Select P1FSRH7 P1FSRH6 Description I/O Port (EINT6/SS2 function possible when input) SEG21 Function AN6 Function Not used P1FSRH[5:4] P16 Function Select...
Page 87
MC96F6432 P1FSRL (Port 1 Function Selection Low Register) : D4H P1FSRL7 P1FSRL6 P1FSRL5 P1FSRL4 P1FSRL3 P1FSRL2 P1FSRL1 P1FSRL0 Initial value : 00H P1FSRL[7:6] P13 Function Select P1FSRL7 P1FSRL6 Description I/O Port (EC1 function possible when input) SEG17 Function AN10 Function BUZO Function P1FSRL[5:4] P12Function Select...
Page 88
MC96F6432 P2FSRH (Port 2 Function Selection High Register) : D7H – – – – P2FSRH3 P2FSRH2 P2FSRH1 P2FSRH0 – – – – Initial value : 00H P2FSRH3 P27 Function select I/O Port SEG6 Function P2FSRH2 P26 Function Select I/O Port SEG7 Function P2FSRH1 P25 Function select...
Page 89
MC96F6432 P2FSRL (Port 2 Function Selection Low Register) : D6H – – P2FSRL5 P2FSRL4 P2FSRL3 P2FSRL2 P2FSRL1 P2FSRL0 – – Initial value : 00H P2FSRL5 P23 Function Select I/O Port SEG10 Function P2FSRL4 P22Function Select I/O Port (SS1 function possible when input) SEG11 Function P2FSRL[3:2] P21 Function Select...
Page 90
MC96F6432 P3FSR (Port 3 Function Selection Register) : EEH P3FSR7 P3FSR6 P3FSR5 P3FSR4 P3FSR3 P3FSR2 P3FSR1 P3FSR0 Initial value : 00H P3FSR7 P37 Function select I/O Port COM0 Function P3FSR6 P36 Function Select I/O Port COM1 Function P3FSR5 P35 Function select I/O Port COM2/SEG0 Function P3FSR4...
Page 91
MC96F6432 P4FSR (Port 4 Function Selection Register) : EFH – P4FSR6 P4FSR5 P4FSR4 P4FSR3 P4FSR2 P4FSR1 P4FSR0 – Initial value : 00H P4FSR6 P43 Function Select I/O Port (SS0 function possible when input) VLC0 Function P4FSR[5:4] P42 Function Select P4FSR5 P4FSR4 Description I/O Port VLC1 Function SCK0 Function...
Page 92
MC96F6432 P5FSR (Port 5 Function Selection Register) : FFH – – P5FSR5 P5FSR4 P5FSR3 P5FSR2 P5FSR1 P5FSR0 – – Initial value : 00H P5FSR5 P54 Function Select I/O Port (EINT10 function possible when input) SXOUT Function P5FSR[4:3] P53 Function Select P5FSR4 P5FSR3 Description I/O Port SXIN Function...
MC96F6432 10. Interrupt Controller 10.1 Overview The MC96F6432 supports up to 23 interrupt sources. The interrupts have separate enable register bits associated with them, allowing software control. They can also have four levels of priority assigned to them. The non-maskable interrupt source is always enabled with a higher priority than any other interrupt source, and is not controllable by software.
MC96F6432 10.2 External Interrupt The external interrupt on INT0, INT1, INT5, INT6 and INT11 pins receive various interrupt request depending on the external interrupt polarity 0 high/low register (EIPOL0H/L) and external interrupt polarity 1 register (EIPOL1) as shown in Figure 10.1. Also each external interrupt source has enable/disable bits. The External interrupt flag 0 register (EIFLAG0) and external interrupt flag 1 register 1 (EIFLAG1) provides the status of external interrupts.
MC96F6432 10.4 Interrupt Vector Table The interrupt controller supports 24 interrupt sources as shown in the Table 10-2. When interrupt is served, long call instruction (LCALL) is executed and program counter jumps to the vector address. All interrupt requests have their own priority order. Table 10-2 Interrupt Vector Address Table Interrupt Interrupt Source...
MC96F6432 IE.EA Flag 0 Program Counter low Byte SP SP + 1 M(SP) (PCL) Saves PC value in order to continue process again after executing ISR Program Counter high Byte SP SP + 1 M(SP) (PCH) Interrupt Vector Address occurrence (Interrupt Vector Address) ISR(Interrupt Service Routine) move,...
MC96F6432 10.6 Effective Timing after Controlling Interrupt Bit Case a) Control Interrupt Enable Register (IE, IE1, IE2, IE3) Interrupt Enable Register command After executing IE set/clear, enable register is effective. Next Instruction Next Instruction Figure 10.4 Effective Timing of Interrupt Enable Register Case b) Interrupt flag Register Interrupt Flag Register Command...
MC96F6432 10.7 Multi Interrupt If two requests of different priority levels are received simultaneously, the request of higher priority level is served first. If more than one interrupt request are received, the interrupt polling sequence determines which request is served first by hardware. However, for special features, multi-interrupt processing can be executed by software.
MC96F6432 10.11 Interrupt Timing Interrupt sampled here CLP2 CLP1 CLP2 C1P1 C1P2 C2P1 C2P2 SCLK INT_SRC INTR_ACK LAST_CYC INTR_LCALL 8-Bit interrupt Vector INT_VEC {8’h00, INT_VEC} PROGA Figure 10.10 Timing Chart of Interrupt Acceptance and Interrupt Return Instruction Interrupt sources are sampled at the last cycle of a command. If an interrupt source is detected the lower 8-bit of interrupt vector (INT_VEC) is decided.
Page 102
MC96F6432 10.12.3 External Interrupt Flag Register (EIFLAG0, EIFLAG1) The external interrupt flag 0 register (EIFLAG0) and external interrupt flag 1 register (EIFLAG1) are set to ‘1’ when the external interrupt generating condition is satisfied. The flag is cleared when the interrupt service routine is executed.
Page 108
MC96F6432 EIFLAG0 (External Interrupt Flag 0 Register) : C0H FLAG7 FLAG6 FLAG5 FLAG4 FLAG3 FLAG2 FLAG1 FLAG0 Initial value : 00H When an External Interrupt 0-7 is occurred, the flag becomes ‘1’. EIFLAG0[7:0] The flag is cleared only by writing ‘0’ to the bit. So, the flag should be cleared by software.
Page 109
MC96F6432 EIFLAG1 (External Interrupt Flag 1 Register) : A6H – T0OVIFR T0IFR T3IFR FLAG12 FLAG11 FLAG10 FLAG8 – Initial value : 00H When T0 overflow interrupt occurs, this bit becomes ‘1’. For clearing T0OVIFR bit, write ‘0’ to this bit or automatically clear by INT_ACK signal. Writing “1”...
MC96F6432 11. Peripheral Hardware 11.1 Clock Generator 11.1.1 Overview As shown in Figure 11.1, the clock generator produces the basic clock pulses which provide the system clock to be supplied to the CPU and the peripheral hardware. It contains main/sub-frequency clock oscillator. The main/sub clock operation can be easily obtained by attaching a crystal between the XIN/SXIN and XOUT/SXOUT pin, respectively.
MC96F6432 11.1.3 Register Map Table 11-1 Clock Generator Register Map Name Address Default Description SCCR System and Clock Control Register OSCCR Oscillator Control Register 11.1.4 Clock Generator Register Description The clock generator register uses clock control for system operation. The clock generation consists of System and clock control register and oscillator control register.
MC96F6432 11.2 Basic Interval Timer 11.2.1 Overview The MC96F6432 has one 8-bit basic interval timer that is free-run and can’t stop. Block diagram is shown in Figure 11.2. In addition, the basic interval timer generates the time base for watchdog timer counting. It also provides a basic interval timer interrupt (BITIFR).
MC96F6432 11.2.3 Register Map Table 11-2 Basic Interval Timer Register Map Name Address Default Description BITCNT Basic Interval Timer Counter Register BITCR Basic Interval Timer Control Register 11.2.4 Basic Interval Timer Register Description The basic interval timer register consists of basic interval timer counter register (BITCNT) and basic interval timer control register (BITCR).
Page 115
MC96F6432 BITCR (Basic Interval Timer Control Register) : 8BH – BITIFR BITCK1 BITCK0 BCLR BCK2 BCK1 BCK0 – Initial value : 01H When BIT Interrupt occurs, this bit becomes ‘1’. For clearing bit, write ‘0’ BITIFR to this bit or auto clear by INT_ACK signal. Writing “1” has no effect. BIT interrupt no generation BIT interrupt generation BITCK[1:0]...
MC96F6432 11.3 Watch Dog Timer 11.3.1 Overview The watchdog timer rapidly detects the CPU malfunction such as endless looping caused by noise or something like that, and resumes the CPU to the normal state. The watchdog timer signal for malfunction detection can be used as either a CPU reset or an interrupt request.
MC96F6432 11.4 Watch Timer 11.4.1 Overview The watch timer has the function for RTC (Real Time Clock) operation. It is generally used for RTC design. The internal structure of the watch timer consists of the clock source select circuit, timer counter circuit, output select circuit, and watch timer control register.
MC96F6432 11.5.2 8-Bit Timer/Counter Mode The 8-bit timer/counter mode is selected by control register as shown in Figure 11.6. The 8-bit timer have counter and data register. The counter register is increased by internal or external clock input. Timer 0 can use the input clock with one of 2, 4, 8, 32, 128, 512 and 2048 prescaler division rates (T0CK[2:0]).
MC96F6432 11.5.3 8-Bit PWM Mode The timer 0 has a high speed PWM (Pulse Width Modulation) function. In PWM mode, T0O/PWM0O pin outputs up to 8-bit resolution PWM output. This pin should be configured as a PWM output by setting the T0O/PWM0O function by P5FSR[4:3] bits.
MC96F6432 11.5.4 8-Bit Capture Mode The timer 0 capture mode is set by T0MS[1:0] as ‘1x’. The clock source can use the internal/external clock. Basically, it has the same function as the 8-bit timer/counter mode and the interrupt occurs when T0CNT is equal to T0DR.
MC96F6432 11.6 Timer 1 11.6.1 Overview The 16-bit timer 1 consists of multiplexer, timer 1 A data register high/low, timer 1 B data register high/low and timer 1 control register high/low (T1ADRH, T1ADRL, T1BDRH, T1BDRL, T1CRH, T1CRL). It has four operating modes: 16-bit timer/counter mode 16-bit capture mode 16-bit PPG output mode (one-shot mode)
MC96F6432 11.6.3 16-Bit Capture Mode The 16-bit timer 1 capture mode is set by T1MS[1:0] as ‘01’. The clock source can use the internal/external clock. Basically, it has the same function as the 16-bit timer/counter mode and the interrupt occurs when T1CNTH/T1CNTL is equal to T1ADRH/T1ADRL.
MC96F6432 11.6.4 16-Bit PPG Mode The timer 1 has a PPG (Programmable Pulse Generation) function. In PPG mode, T1O/PWM1O pin outputs up to 16-bit resolution PWM output. This pin should be configured as a PWM output by setting P1FSRL[5:4] to ‘11’...
MC96F6432 Repeat Mode(T1MS = 11b) and "Start High"(T1POL = 0b). Clear and Start Set T1EN Timer 1 clock Counter T1ADRH/L T1 Interrupt 1. T1BDRH/L(5) < T1ADRH/L PWM1O B Match A Match 2. T1BDRH/L >= T1ADRH/L PWM1O A Match 3. T1BDRH/L = "0000H" PWM1O A Match Low Level...
MC96F6432 11.6.5 Block Diagram 16-bit A Data Register T1ADRH/T1ADRL A Match Reload T1CC T1EN To Timer 2 T1CK[2:0] block T1ECE INT_ACK Buffer Register A Clear Edge A Match To interrupt Detector T1IFR block T1EN fx/1 Comparator fx/2 A Match Clear fx/4 16-bit Counter T1CC...
Page 138
MC96F6432 11.6.6.1 Timer/Counter 1 Register Description The timer/counter 1 register consists of timer 1 A data high register (T1ADRH), timer 1 A data low register (T1ADRL), timer 1 B data high register (T1BDRH), timer 1 B data low register (T1BDRL), timer 1 control High register (T1CRH) and timer 1 control low register (T1CRL).
Page 139
MC96F6432 T1CRH (Timer 1 Control High Register) : BBH – – – – T1EN T1MS1 T1MS0 T1CC – – – – Initial value : 00H T1EN Control Timer 1 Timer 1 disable Timer 1 enable (Counter clear and start) T1MS[1:0] Control Timer 1 Operation Mode T1MS1 T1MS0 Description...
Page 140
MC96F6432 T1CRL (Timer 1 Control Low Register) : BAH – T1CK2 T1CK1 T1CK0 T1IFR T1POL T1ECE T1CNTR – Initial value : 00H T1CK[2:0] Select Timer 1 clock source. fx is main system clock frequency T1CK2 T1CK1 T1CK0 Description fx/2048 fx/512 fx/64 fx/8 fx/4...
MC96F6432 11.7 Timer 2 11.7.1 Overview The 16-bit timer 2 consists of multiplexer, timer 2 A data high/low register, timer 2 B data high/low register and timer 2 control high/low register (T2ADRH, T2ADRL, T2BDRH, T2BDRL, T2CRH, T2CRL). It has four operating modes: 16-bit timer/counter mode 16-bit capture mode 16-bit PPG output mode (one-shot mode)
MC96F6432 11.7.2 16-Bit Timer/Counter Mode The 16-bit timer/counter mode is selected by control register as shown in Figure 11.22. The 16-bit timer have counter and data register. The counter register is increased by internal or timer 1 A match clock input. Timer 2 can use the input clock with one of 1, 2, 4, 8, 32, 128, 512 and T1 A Match prescaler division rates (T2CK[2:0]).
MC96F6432 Match with T2ADRH/L T2CNTH/L Value Count Pulse Period Up-count TIME Interrupt Period x (n+1) Timer 2 (T2IFR) Occur Occur Occur Interrupt Interrupt Interrupt Interrupt Figure 11.23 16-Bit Timer/Counter 2 Example June 22, 2018 Ver. 2.9...
MC96F6432 11.7.3 16-Bit Capture Mode The timer 2 capture mode is set by T2MS[1:0] as ‘01’. The clock source can use the internal clock. Basically, it has the same function as the 16-bit timer/counter mode and the interrupt occurs when T2CNTH/T2CNTL is equal to T2ADRH/T2ADRL.
MC96F6432 11.7.4 16-Bit PPG Mode The timer 2 has a PPG (Programmable Pulse Generation) function. In PPG mode, the T2O/PWM2O pin outputs up to 16-bit resolution PWM output. This pin should be configured as a PWM output by set P1FSRL[3:2] to ‘11’...
MC96F6432 Repeat Mode(T2MS = 11b) and "Start High"(T2POL = 0b). Clear and Start Set T2EN Timer 2 clock Counter T2ADRH/L T2 Interrupt 1. T2BDRH/L(5) < T2ADRH/L PWM2O B Match A Match 2. T2BDRH/L >= T2ADRH/L PWM2O A Match 3. T2BDRH/L = "0000H" PWM2O A Match Low Level...
MC96F6432 11.7.5 Block Diagram 16-bit A Data Register T2ADRH/T2ADRL A Match Reload T2CC T2CK[2:0] T2EN INT_ACK Buffer Register A Clear T1 A Match A Match To interrupt T2IFR block T2EN fx/1 Comparator fx/2 A Match Clear fx/4 16-bit Counter T2CC T2CNTH/T2CNTL fx/8 T2EN...
Page 149
MC96F6432 11.7.6.1 Timer/Counter 2 Register Description The timer/counter 2 register consists of timer 2 A data high register (T2ADRH), timer 2 A data low register (T2ADRL), timer 2 B data high register (T2BDRH), timer 2 B data low register (T2BDRL), timer 2 control High register (T2CRH) and timer 2 control low register (T2CRL).
Page 150
MC96F6432 T2CRH (Timer 2 Control High Register) : C3H – – – – T2EN T2MS1 T2MS0 T2CC – – – – Initial value : 00H T2EN Control Timer 2 Timer 2 disable Timer 2 enable (Counter clear and start) T2MS[1:0] Control Timer 2 Operation Mode T2MS1 T2MS0 Description...
Page 151
MC96F6432 T2CRL (Timer 2 Control Low Register) : CAH – – T2CK2 T2CK1 T2CK0 T2IFR T2POL T2CNTR – – Initial value : 00H T2CK[2:0] Select Timer 2 clock source. fx is main system clock frequency T2CK2 T2CK1 T2CK0 Description fx/512 fx/128 fx/32 fx/8...
MC96F6432 11.8 Timer 3, 4 11.8.1 Overview Timer 3 and timer 4 can be used either two 8-bit timer/counter or one 16-bit timer/counter with combine them. Each 8-bit timer/event counter module has multiplexer, comparator, 8-bit timer data register, 8-bit counter register, control register and capture data register (T3CNT, T3DR, T3CAPR, T3CR, T4CNT, T4DR, T4CAPR, T4CR).
MC96F6432 11.8.2 8-Bit Timer/Counter 3, 4 Mode The 8-bit timer/counter mode is selected by control register as shown in Figure 11.30. The two 8-bit timers have each counter and data register. The counter register is increased by internal or external clock input. Timer 3 can use the input clock with one of 2, 4, 8, 32, 128, 512, 2048 and EC3 prescaler division rates (T3CK[2:0]).
MC96F6432 11.8.3 16-Bit Timer/Counter 3 Mode The 16-bit timer/counter mode is selected by control register as shown in Figure 11.31. The 16-bit timer have counter and data register. The counter register is increased by internal or external clock input. Timer 3 can use the input clock with one of 2, 4, 8, 32, 128, 512 and 2048 prescaler division rates (T3CK[2:0]).
Page 155
MC96F6432 11.8.4 8-Bit Timer 3, 4 Capture Mode The 8-bit Capture 3 and 4 mode is selected by control register as shown in Figure 11.32. The timer 3, 4 capture mode is set by T3MS, T4MS as ‘1’. The clock source can use the internal/external clock. Basically, it has the same function as the 8-bit timer/counter mode and the interrupt occurs when T3CNT, T4CNT is equal to T3DR, T4DR.
MC96F6432 11.8.5 16-Bit Timer 3 Capture Mode The 16-bit Capture mode is selected by control register as shown in Figure 11.33. The 16-bit capture mode is the same operation as 8-bit capture mode, except that the timer register uses 16 bits. The 16-bit timer 3 capture mode is set by T3MS, T4MS as ‘1’.
MC96F6432 11.8.6 10-Bit Timer 4 PWM Mode The timer 4 has a high speed PWM (Pulse Width Modulation) function. In PWM mode, the 6-channel pins output up to 10-bit resolution PWM output. This pin should be configured as a PWM output by set PWM4E to ‘1’. When the value of 2bit +T4CNT and T4PPRH/L are identical in timer 4, a period match signal is generated and the interrupt of timer 4 occurs.
MC96F6432 Phase correction & Frequency correction On operating PWM, it is possible that it is changed the phase and the frequency by using BMOD bit (back-to- back mode) in T4PCR1 register. (Figure 1.38, Figure 11.39, Figure 11.40 referred) In the back-to-back mode, the counter of PWM repeats up/down count. In fact, the effective duty and period becomes twofold of the register set values.
MC96F6432 Duty, Period Update T4CNT Back-to-Back mode Duty1 Duty2 Duty3 Output Period1 Period2 Period3 Interrupt Timing Overflow INT. Overflow INT. Bottom INT. Overflow INT. Figure 11.40 Example of Phase Correction and Frequency correction of PWM External Sync If using ESYNC bit of T4PCR1 register, it is possible to synchronize the output of PWM from external signal. If ESYNC bit sets to ‘1’, the external signal moves to PWM module through the BLNK pin.
MC96F6432 FORCE Drive ALL Channel with A-ch mode If FORCA bit sets to ‘1’, it is possible to enable or disable all PWM output pins through PWM outputs which occur from A-ch duty counter. It is noted that the inversion outputs of A, B, C channel have the same A-ch output waveform.
MC96F6432 FORCE 6-Ch Drive If FORCA bit sets to ‘0’, it is possible to enable or disable PWM output pin and inversion output pin generated through the duty counter of each channel. The inversion output is the reverse phase of the PWM output. A AA/AB output of the A-channel duty register, a BA/BB output of the B-channel duty register, a CA/CB output of the C- channel duty register are controlled respectively.
Page 166
MC96F6432 PWM output Delay If using the T4DLYA, T4DLYB, T4DLYC register, it can delay PWM output based on the rising edge. At that time, it does not change the falling edge, so the duty is reduced as the time delay. In POLAA/BA/CA setting to ‘0’, the delay is applied to the falling edge.
Page 171
MC96F6432 11.8.8.1 Timer/Counter 3 Register Description The timer/counter 3 register consists of timer 3 counter register (T3CNT), timer 3 data register (T3DR), timer 3 capture data register (T3CAPR) and timer 3 control register (T3CR). 11.8.8.2 Register Description for Timer/Counter 3 T3CNT (Timer 3 Counter Register: Read Case, Timer mode only) : 1001H (ESFR) T3CNT7 T3CNT6...
Page 172
MC96F6432 T3CR (Timer 3 Control Register) : 1000H (ESFR) – T3EN T3MS T3CK2 T3CK1 T3CK0 T3CN T3ST – Initial value : 00H T3EN Control Timer 3 Timer 3 disable Timer 3 enable T3MS Control Timer 3 Operation Mode Timer/counter mode (T3O: toggle at match) Capture mode (the match interrupt can occur) T3CK[2:0] Select Timer 3 clock source.
Page 173
MC96F6432 11.8.8.3 Timer/Counter 4 Register Description The timer/counter 4 register consists of timer 4 PWM period high/low register (T4PPRH/L), timer 4 PWM A duty high/low register (T4ADRH/L), timer 4 PWM B duty high/low register (T4BDRH/L), timer 4 PWM C duty high/low register (T4CDRH/L), timer 4 PWM A delay register (T4DLYA), timer 4 PWM B delay register (T4DLYB), timer 4 PWM C delay register (T4DLYC), timer 4 data register (T4DR), timer 4 capture data register (T4CAPR), timer 4 counter register (T4CNT), timer 4 control register (T4CR), timer 4 PWM control register 1 (T4PCR1), timer 4...
Page 174
MC96F6432 T4BDRH (Timer 4 PWM B Duty High Register : 6-ch PWM mode only) : 100DH (ESFR) – – – – – – T4BDRH1 T4BDRH0 – – – – – – Initial value : 00H T4BDRH[1:0] T4 PWM B Duty Data High Byte T4BDRL (Timer 4 PWM B Duty Low Register : 6-ch PWM mode only) : 100CH (ESFR) T4BDRL7 T4BDRL6...
Page 175
MC96F6432 T4DLYC (Timer 4 PWM C Delay Register : 6-ch PWM mode only) : 1012H (ESFR) T4DLYCA3 T4DLYCA2 T4DLYCA1 T4DLYCA0 T4DLYCB3 T4DLYCB2 T4DLYCB1 T4DLYCB0 Initial value : 00H T4DLYCA[3:0] PWM4CA Delay Data (Rising edge only) T4DLYCB[3:0] PWM4CB Delay Data (Rising edge only) T4DR (Timer 4 Data Register: Timer and Capture mode only) : 1013H (ESFR) T4DR7 T4DR6...
Page 176
MC96F6432 T4CR (Timer 4 Control Register) : 1002H (ESFR) 16BIT T4MS T4CN T4ST T4CK3 T4CK2 T4CK1 T4CK0 Initial value : 00H 16BIT Select Two 8-bit or 16-bit Mode for Timer 3/4 Two 8-bit Timer 3/4 16-bit Timer 3 T4MS Control Timer 4 Operation Mode Timer/counter mode (T4O: toggle at match) Capture mode (the match interrupt can occur) T4CN...
Page 177
MC96F6432 T4PCR1 (Timer 4 PWM Control Register 1) : 1003H (ESFR) PWM4E ESYNC BMOD PHLT UPDT UALL NOPS1 NOPS0 Initial value : 00H PWM4E Control Timer 4 Mode Select timer/counter or capture mode of Timer 4 Select 10-bit PWM mode of Timer 4 ESYNC Select the Operation of External Sync with the BLNK pin Disable external sync operation...
Page 178
MC96F6432 T4PCR2 (Timer 4 PWM Control Register 2) : 1004H (ESFR) – FORCA PAAOE PABOE PBAOE PBBOE PCAOE PCBOE – Initial value : 00H FORCA Control The PWM outputs Mode 6-channel mode (The PWM4xA/PWM4xB pins are output according to the T4xDR registers, respectively.
Page 179
MC96F6432 T4PCR3 (Timer 4 PWM Control Register 3) : 1005H (ESFR) HZCLR POLBO POLAA POLAB POLBA POLBB POLCA POLCB Initial value : 00H HZCLR High-Impedance Output Clear Bit No effect Clear high-impedance output (The PWM4xA/PWM4xB pins are back to output and this bit is automatically cleared to logic ‘0’.
Page 180
MC96F6432 T4ISR (Timer 4 Interrupt Status Register) : 1006H (ESFR) – – – IOVR IBTM ICMA ICMB ICMC – – – Initial value : 00H Timer 4 Overflow Interrupt Status, Write ‘0’ to this bit for clear IOVR Overflow no occurrence Overflow occurrence Timer 4 Bottom Interrupt Status, Write ‘0’...
MC96F6432 11.9 Buzzer Driver 11.9.1 Overview The Buzzer consists of 8 bit counter, buzzer data register (BUZDR), and buzzer control register (BUZCR). The Square Wave (61.035Hz~125.0 kHz @8MHz) is outputted through P13/SEG17/AN10/EC1/BUZO pin. The buzzer data register (BUZDR) controls the buzzer frequency (look at the following expression). In buzzer control register (BUZCR), BUCK[1:0] selects source clock divided by prescaler.
MC96F6432 11.10 SPI 2 11.10.1 Overview There is serial peripheral interface (SPI 2) one channel in MC96F6432. The SPI 2 allows synchronous serial data transfer between the external serial devices. It can do Full-duplex communication by 4-wire (MOSI2, MISO2, SCK2, SS2), support master/slave mode, can select serial clock (SCK2) polarity, phase and whether LSB first data transfer or MSB first data transfer.
Page 184
MC96F6432 11.10.3 Data Transmit / Receive Operation User can use SPI 2 for serial data communication by following step 1. Select SPI 2 operation mode(master/slave, polarity, phase) by control register SPICR. 2. When the SPI 2 is configured as a Master, it selects a Slave by SS2 signal (active low). When the SPI 2 is configured as a Slave, it is selected by SS2 signal incoming from Master 3.
MC96F6432 11.10.6 Register Map Table 11-17 SPI 2 Register Map Name Address Default Description SPISR SPI 2 Status Register SPIDR SPI 2 Data Register SPICR SPI 2 Control Register 11.10.7 SPI 2 Register Description The SPI 2 register consists of SPI 2 control register (SPICR), SPI 2 status register (SPISR) and SPI 2 data register (SPIDR) 11.10.8 Register Description for SPI 2 SPIDR (SPI 2 Data Register) : B6H...
Page 187
MC96F6432 SPISR (SPI 2 Status Register) : B7H – – – SPIIFR WCOL SS_HIGH FXCH SSENA – – – Initial value : 00H When SPI 2 Interrupt occurs, this bit becomes ‘1’. IF SPI 2 interrupt is SPIIFR enable, this bit is auto cleared by INT_ACK signal. And if SPI 2 Interrupt is disable, this bit is cleared when the status register SPISR is read, and then access (read/write) the data register SPIDR.
Page 188
MC96F6432 SPICR (SPI 2 Control Register) : B5H SPIEN FLSB CPOL CPHA DSCR SCR1 SCR0 Initial value : 00H SPIEN This bit controls the SPI 2 operation Disable SPI 2 operation Enable SPI 2 operation FLSB This bit selects the data transmission sequence MSB first LSB first This bit selects whether Master or Slave mode...
MC96F6432 11.11 12-Bit A/D Converter 11.11.1 Overview The analog-to-digital converter (A/D) allows conversion of an analog input signal to corresponding 12-bit digital value. The A/D module has eight analog inputs. The output of the multiplexer is the input into the converter which generates the result through successive approximation.
MC96F6432 11.11.3 Block Diagram TRIG[2:0] ADST T1 A match signal T4 overflow event signal T4 A match event signal ADSEL[3:0] Start T4 B match event signal (Select one input pin T4 C match event signal of the assigned pins) Clock ADCLK Selector Clear...
MC96F6432 SET ADCCRH Select ADC Clock and Data Align Bit. SET ADCCRL ADC enable & Select AN Input Channel. Converting START Start ADC Conversion. If Conversion is completed, AFLAG is set “1” and ADC AFLAG = 1? interrupt is occurred. After Conversion is completed, read ADCDRH and ADCDRL.
Page 193
MC96F6432 11.11.7 Register Description for ADC ADCDRH (A/D Converter Data High Register) : 9FH ADDM11 ADDM10 ADDM9 ADDM8 ADDM7 ADDM6 ADDM5 ADDM4 ADDL11 ADDL10 ADDL9 ADDL8 Initial value : xxH ADDM[11:4] MSB align, A/D Converter High Data (8-bit) ADDL[11:8] LSB align, A/D Converter High Data (4-bit) ADCDRL (A/D Converter Data Low Register) : 9EH ADDM3 ADDM2...
Page 194
MC96F6432 ADCCRL (A/D Converter Control Low Register) : 9CH STBY ADST REFSEL AFLAG ADSEL3 ADSEL2 ADSEL1 ADSEL0 Initial value : 00H STBY Control Operation of A/D (The ADC module is automatically disabled at stop mode) ADC module disable ADC module enable ADST Control A/D Conversion stop/start.
MC96F6432 11.12 USI0 (UART + SPI + I2C) 11.12.1 Overview The USI0 consists of USI0 control register1/2/3/4, USI0 status register 1/2, USI0 baud-rate generation register, USI0 data register, USI0 SDA hold time register, USI0 SCL high period register, USI0 SCL low period register, and USI0 slave address register (USI0CR1, USI0CR2, USI0CR3, USI0CR4, USI0ST1, USI0ST2, USI0BD, USI0DR, USI0SDHR, USI0SCHR, USI0SCLR, USI0SAR).
Page 196
MC96F6432 11.12.2 USI0 UART Mode The universal synchronous and asynchronous serial receiver and transmitter (UART) is a highly flexible serial communication device. The main features are listed below. - Full Duplex Operation (Independent Serial Receive and Transmit Registers) - Asynchronous or Synchronous Operation - Baud Rate Generator - Supports Serial Frames with 5,6,7,8, or 9 Data Bits and 1 or 2 Stop Bits - Odd or Even Parity Generation and Parity Check Supported by Hardware...
MC96F6432 11.12.4 USI0 Clock Generation USI0BD DBLS0 SCLK (USI0BD+1) Prescaling Up-Counter txclk SCLK MASTER0 Edge Sync Register USI0MS[1:0] Detector CPOL0 SCK0 rxclk Figure 11.58 Clock Generation Block Diagram (USI0) The clock generation logic generates the base clock for the transmitter and receiver. The USI0 supports four modes of clock operation and those are normal asynchronous, double speed asynchronous, master synchronous and slave synchronous mode.
MC96F6432 11.12.5 USI0 External Clock (SCK0) External clocking is used in the synchronous mode of operation. External clock input from the SCK0 pin is sampled by a synchronization logic to remove meta-stability. The output from the synchronization logic must be passed through an edge detector before it is used by the transmitter and receiver.
MC96F6432 11.12.7 USI0 UART Data format A serial frame is defined to be one character of data bits with synchronization bits (start and stop bits), and optionally a parity bit for error detection. The UART supports all 30 combinations of the following as valid frame formats. - 1 start bit - 5, 6, 7, 8 or 9 data bits - no, even or odd parity bit...
Page 201
MC96F6432 11.12.9 USI0 UART Transmitter The UART transmitter is enabled by setting the TXE0 bit in USI0CR2 register. When the Transmitter is enabled, the TXD0 pin should be set to TXD0 function for the serial output pin of UART by the P4FSR[3:2]. The baud-rate, operation mode and frame format must be setup once before doing any transmission.
Page 202
MC96F6432 11.12.9.3 USI0 UART Parity Generator The parity generator calculates the parity bit for the serial frame data to be sent. When parity bit is enabled (USI0PM1=1), the transmitter control logic inserts the parity bit between the MSB and the first stop bit of the frame to be sent.
Page 203
MC96F6432 11.12.10.2 USI0 UART Receiver Flag and Interrupt The UART receiver has one flag that indicates the receiver state. The receive complete (RXC0) flag indicates whether there are unread data in the receive buffer. This flag is set when there are unread data in the receive buffer and cleared when the receive buffer is empty. If the receiver is disabled (RXE0=0), the receiver buffer is flushed and the RXC0 flag is cleared.
MC96F6432 11.12.10.5 USI0 Asynchronous Data Reception To receive asynchronous data frame, the UART includes a clock and data recovery unit. The clock recovery logic is used for synchronizing the internally generated baud-rate clock to the incoming asynchronous serial frame on the RXD0 pin. The data recovery logic samples and low pass filters the incoming bits, and this removes the noise of RXD0 pin.
MC96F6432 The process for detecting stop bit is like clock and data recovery process. That is, if 2 or more samples of 3 center values have high level, correct stop bit is detected, else a frame error (FE0) flag is set. After deciding whether the first stop bit is valid or not, the Receiver goes to idle state and monitors the RXD0 line to check a valid high to low transition is detected (start bit detection).
MC96F6432 11.12.11 USI0 SPI Mode The USI0 can be set to operate in industrial standard SPI compliant mode. The SPI mode has the following features. - Full Duplex, Three-wire synchronous data transfer - Mater and Slave Operation - Supports all four SPI0 modes of operation (mode 0, 1, 2, and 3) - Selectable LSB first or MSB first data transfer - Double buffered transmit and receive - Programmable transmit bit rate...
MC96F6432 SCK0 (CPOL0=0) SCK0 (CPOL0=1) SAMPLE MOSI0 MSB First … BIT7 BIT6 BIT2 BIT1 BIT0 LSB First … BIT0 BIT1 BIT5 BIT6 BIT7 MISO0 /SS0 OUT (MASTER) /SS0 IN (SLAVE) Figure 11.64 USI0 SPI Clock Formats when CPHA0=0 When CPHA0=0, the slave begins to drive its MISO0 output with the first data bit value when SS0 goes to active low.
MC96F6432 SCK0 (CPOL0=0) SCK0 (CPOL0=1) SAMPLE MOSI0 … MSB First BIT7 BIT6 BIT2 BIT1 BIT0 … LSB First BIT0 BIT1 BIT5 BIT6 BIT7 MISO0 /SS0 OUT (MASTER) /SS0 IN (SLAVE) Figure 11.65 USI0 SPI Clock Formats when CPHA0=1 When CPHA0=1, the slave begins to drive its MISO0 output when SS0 goes active low, but the data is not defined until the first SCK0 edge.
MC96F6432 11.12.14 USI0 I2C Mode The USI0 can be set to operate in industrial standard serial communication protocols mode. The I2C mode uses 2 bus lines serial data line (SDA0) and serial clock line (SCL0) to exchange data. Because both SDA0 and SCL0 lines are open-drain output, each line needs pull-up resistor.
MC96F6432 11.12.16 USI0 I2C Start / Repeated Start / Stop One master can issue a START (S) condition to notice other devices connected to the SCL0, SDA0 lines that it will use the bus. A STOP (P) condition is generated by the master to release the bus lines so that other devices can use it.
MC96F6432 11.12.18 USI0 I2C Acknowledge The acknowledge related clock pulse is generated by the master. The transmitter releases the SDA0 line (HIGH) during the acknowledge clock pulse. The receiver must pull down the SDA0 line during the acknowledge clock pulse so that it remains stable LOW during the HIGH period of this clock pulse. When a slave is addressed by a master (Address Packet), and if it is unable to receive or transmit because it’s performing some real time function, the data line must be left HIGH by the slave.
MC96F6432 Wait High Start High Counting Counting Fast Device SCLOUT High Counter Reset Slow Device SCLOUT SCL0 Figure 11.71 Clock Synchronization during Arbitration Procedure (USI0) Arbitration Process Device 1 loses Device1 outputs not adaped Arbitration High Device1 DataOut Device2 DataOut SDA0 on BUS SCL0 on BUS Figure 11.72 Arbitration Procedure of Two Masters (USI0)
Page 214
MC96F6432 Load SLA0+W into the USI0DR where SLA0 is address of slave device and W is transfer direction from the viewpoint of the master. For master transmitter, W is ‘0’. Note that USI0DR is used for both address and data. Configure baud rate by writing desired value to both USI0SCLR and USI0SCHR for the Low and High period of SCL0 line.
MC96F6432 Master S or Sr SLA+R Receiver SLA+W 0x86 0x22 STOP 0x0E 0x87 LOST DATA STOP LOST LOST& Slave Receiver (0x1D) 0x0F 0x1D 0x1F or Transmitter (0x1F) 0x46 0x22 STOP 0x0E Other master continues LOST Lost? Cont? From master to slave / 0x0F 0x47 Master command or Data Write...
Page 216
MC96F6432 11.12.20.2 USI0 I2C Master Receiver To operate I2C in master receiver, follow the recommended steps below. Enable I2C by setting USI0MS[1:0] bits in USI0CR1 and USI0EN bit in USI0CR2. This provides main clock to the peripheral. Load SLA0+R into the USI0DR where SLA is address of slave device and R is transfer direction from the viewpoint of the master.
MC96F6432 This is the final step for master receiver function of I2C, handling STOP interrupt. The STOP bit indicates that data transfer between master and slave is over. To clear USI0ST2, write “0” to USI0ST2. After this, I2C enters idle state. The processes described above for master receiver operation of I2C can be depicted as the following figure.
Page 218
MC96F6432 11.12.20.3 USI0 I2C Slave Transmitter To operate I2C in slave transmitter, follow the recommended steps below. If the main operating clock (SCLK) of the system is slower than that of SCL0, load value 0x00 into USI0SDHR to make SDA0 change within one system clock period from the falling edge of SCL0. Note that the hold time of SDA0 is calculated by SDAH x period of SCLK where SDAH is multiple of number of SCLK coming from USI0SDHR.
MC96F6432 The next figure shows flow chart for handling slave transmitter function of I2C. IDLE S or Sr SLA+R GCALL 0x97 0x1F LOST& 0x17 DATA 0x22 STOP 0x47 0x46 IDLE From master to slave / Interrupt, SCL0 line is held low Master command or Data Write From slave to master Interrupt after stop command...
Page 220
MC96F6432 11.12.20.4 USI0 I2C Slave Receiver To operate I2C in slave receiver, follow the recommended steps below. 1. If the main operating clock (SCLK) of the system is slower than that of SCL0, load value 0x00 into USI0SDHR to make SDA0 change within one system clock period from the falling edge of SCL0. Note that the hold time of SDA0 is calculated by SDAH x period of SCLK where SDAH is multiple of number of SCLK coming from USI0SDHR.
MC96F6432 The process can be depicted as following figure when I2C operates in slave receiver mode. IDLE S or Sr SLA+W GCALL 0x95 0x1D LOST& 0x15 DATA 0x20 STOP 0x44 0x45 IDLE From master to slave / Interrupt, SCL0 line is held low Master command or Data Write From slave to master Interrupt after stop command...
MC96F6432 11.12.22 Register Map Table 11-21 USI0 Register Map Name Address Default Description USI0BD USI0 Baud Rate Generation Register USI0DR USI0 Data Register USI0SDHR USI0 SDA Hold Time Register USI0SCHR USI0 SCL High Period Register USI0SCLR USI0 SCL Low Period Register USI0SAR USI0 Slave Address Register USI0CR1...
Page 224
MC96F6432 USI0DR (USI0 Data Register: For UART, SPI, and I2C mode) : E5H USI0DR7 USI0DR 6 USI0DR 5 USI0DR 4 USI0DR 3 USI0DR 2 USI0DR 1 USI0DR 0 Initial value : 00H USI0DR[7:0] The USI0 transmit buffer and receive buffer share the same I/O address with this DATA register.
Page 225
MC96F6432 USI0SCLR (USI0 SCL Low Period Register: For I2C mode) : E6H USI0SCLR7 USI0SCLR6 USI0SCLR5 USI0SCLR 4 USI0SCLR 3 USI0SCLR 2 USI0SCLR 1 USI0SCLR 0 Initial value : 3FH USI0SCLR[7:0] This register defines the high period of SCL0 when it operates in I2C master mode.
Page 226
MC96F6432 USI0CR1 (USI0 Control Register 1: For UART, SPI, and I2C mode) : D9H USI0S1 USI0S0 USI0MS1 USI0MS0 USI0PM1 USI0PM0 USI0S2 CPOL0 ORD0 CPHA0 Initial value : 00H USI0MS[1:0] Selects operation mode of USI0 USI0MS1 USI0MS0 Operation mode Asynchronous Mode (UART) Synchronous Mode I2C mode SPI mode...
Page 227
MC96F6432 USI0CR2 (USI0 Control Register 2: For UART, SPI, and I2C mode) : DAH DRIE0 TXCIE0 RXCIE0 WAKEIE0 TXE0 RXE0 USI0EN DBLS0 Initial value : 00H DRIE0 Interrupt enable bit for data register empty (only UART and SPI mode). Interrupt from DRE0 is inhibited (use polling) When DRE0 is set, request an interrupt TXCIE0 Interrupt enable bit for transmit complete (only UART and SPI mode).
Page 228
MC96F6432 USI0CR3 (USI0 Control Register 3: For UART, SPI, and I2C mode) : DBH MASTER0 LOOPS0 DISSCK0 USI0SSEN FXCH0 USI0SB USI0TX8 USI0RX8 Initial value : 00H MASTER0 Selects master or slave in SPI and synchronous mode operation and controls the direction of SCK0 pin Slave mode operation (External clock for SCK0).
Page 229
MC96F6432 USI0CR4 (USI0 Control Register 4: For I2C mode) : DCH – IIC0IFR TXDLYENB0 IIC0IE ACK0EN IMASTER0 STOPC0 STARTC0 – Initial value : 00H IIC0IFR This is an interrupt flag bit for I2C mode. When an interrupt occurs, this bit becomes ‘1’. This bit is cleared when all interrupt source bits in the USI0ST2 register are cleared to “0b”.
Page 230
MC96F6432 USI0ST1 (USI0 Status Register 1: For UART and SPI mode) : E1H DRE0 TXC0 RXC0 WAKE0 USI0RST DOR0 Initial value : 80H DRE0 The DRE0 flag indicates if the transmit buffer (USI0DR) is ready to receive new data. If DRE0 is ‘1’, the buffer is empty and ready to be written.
Page 231
MC96F6432 USI0ST2 (USI0 Status Register 2: For I2C mode) : E2H GCALL0 TEND0 STOPD0 SSEL0 MLOST0 BUSY0 TMODE0 RXACK0 Initial value : 00H (NOTE) GCALL0 This bit has different meaning depending on whether I2C is master or slave. When I2C is a master, this bit represents whether it received AACK (address ACK) from slave.
MC96F6432 11.13 USI1 (UART + SPI + I2C) 11.13.1 Overview The USI1 consists of USI1 control register1/2/3/4, USI1 status register 1/2, USI1 baud-rate generation register, USI1 data register, USI1 SDA hold time register, USI1 SCL high period register, USI1 SCL low period register, and USI1 slave address register (USI1CR1, USI1CR2, USI1CR3, USI1CR4, USI1ST1, USI1ST2, USI1BD, USI1DR, USI1SDHR, USI1SCHR, USI1SCLR, USI1SAR).
Page 233
MC96F6432 11.13.2 USI1 UART Mode The universal synchronous and asynchronous serial receiver and transmitter (UART) is a highly flexible serial communication device. The main features are listed below. - Full Duplex Operation (Independent Serial Receive and Transmit Registers) - Asynchronous or Synchronous Operation - Baud Rate Generator - Supports Serial Frames with 5,6,7,8, or 9 Data Bits and 1 or 2 Stop Bits - Odd or Even Parity Generation and Parity Check Supported by Hardware...
MC96F6432 11.13.4 USI1 Clock Generation USI1BD DBLS1 SCLK (USI1BD+1) Prescaling Up-Counter txclk SCLK MASTER1 Edge Sync Register USI1MS[1:0] Detector CPOL1 SCK1 rxclk Figure 11.79 Clock Generation Block Diagram (USI1) The clock generation logic generates the base clock for the transmitter and receiver. The USI1 supports four modes of clock operation and those are normal asynchronous, double speed asynchronous, master synchronous and slave synchronous mode.
MC96F6432 11.13.5 USI1 External Clock (SCK1) External clocking is used in the synchronous mode of operation. External clock input from the SCK1 pin is sampled by a synchronization logic to remove meta-stability. The output from the synchronization logic must be passed through an edge detector before it is used by the transmitter and receiver.
MC96F6432 11.13.7 USI1 UART Data format A serial frame is defined to be one character of data bits with synchronization bits (start and stop bits), and optionally a parity bit for error detection. The UART supports all 30 combinations of the following as valid frame formats. - 1 start bit - 5, 6, 7, 8 or 9 data bits - no, even or odd parity bit...
Page 238
MC96F6432 11.13.9 USI1 UART Transmitter The UART transmitter is enabled by setting the TXE1 bit in USI1CR2 register. When the Transmitter is enabled, the TXD1 pin should be set to TXD1 function for the serial output pin of UART by the P2FSR[1:0]. The baud-rate, operation mode and frame format must be setup once before doing any transmission.
Page 239
MC96F6432 11.13.9.3 USI1 UART Parity Generator The parity generator calculates the parity bit for the serial frame data to be sent. When parity bit is enabled (USI1PM1=1), the transmitter control logic inserts the parity bit between the MSB and the first stop bit of the frame to be sent.
Page 240
MC96F6432 11.13.10.2 USI1 UART Receiver Flag and Interrupt The UART receiver has one flag that indicates the receiver state. The receive complete (RXC1) flag indicates whether there are unread data in the receive buffer. This flag is set when there are unread data in the receive buffer and cleared when the receive buffer is empty. If the receiver is disabled (RXE1=1), the receiver buffer is flushed and the RXC1 flag is cleared.
MC96F6432 11.13.10.5 USI1 Asynchronous Data Reception To receive asynchronous data frame, the UART includes a clock and data recovery unit. The clock recovery logic is used for synchronizing the internally generated baud-rate clock to the incoming asynchronous serial frame on the RXD1 pin. The data recovery logic samples and low pass filters the incoming bits, and this removes the noise of RXD1 pin.
MC96F6432 The process for detecting stop bit is like clock and data recovery process. That is, if 2 or more samples of 3 center values have high level, correct stop bit is detected, else a frame error (FE1) flag is set. After deciding whether the first stop bit is valid or not, the Receiver goes to idle state and monitors the RXD1 line to check a valid high to low transition is detected (start bit detection).
MC96F6432 11.13.11 USI1 SPI Mode The USI1 can be set to operate in industrial standard SPI compliant mode. The SPI mode has the following features. - Full Duplex, Three-wire synchronous data transfer - Mater and Slave Operation - Supports all four SPI0 modes of operation (mode 0, 1, 2, and 3) - Selectable LSB first or MSB first data transfer - Double buffered transmit and receive - Programmable transmit bit rate...
MC96F6432 SCK1 (CPOL1=0) SCK1 (CPOL1=1) SAMPLE MOSI1 MSB First … BIT7 BIT6 BIT2 BIT1 BIT0 LSB First … BIT0 BIT1 BIT5 BIT6 BIT7 MISO1 /SS0 OUT (MASTER) /SS1 IN (SLAVE) Figure 11.85 USI1 SPI Clock Formats when CPHA1=0 When CPHA1=0, the slave begins to drive its MISO1 output with the first data bit value when SS1 goes to active low.
MC96F6432 SCK1 (CPOL1=0) SCK1 (CPOL1=1) SAMPLE MOSI1 … MSB First BIT7 BIT6 BIT2 BIT1 BIT0 … LSB First BIT0 BIT1 BIT5 BIT6 BIT7 MISO1 /SS0 OUT (MASTER) /SS0 IN (SLAVE) Figure 11.86 USI1 SPI Clock Formats when CPHA1=1 When CPHA1=1, the slave begins to drive its MISO1 output when SS1 goes active low, but the data is not defined until the first SCK1 edge.
MC96F6432 11.13.14 USI1 I2C Mode The USI1 can be set to operate in industrial standard serial communication protocols mode. The I2C mode uses 2 bus lines serial data line (SDA1) and serial clock line (SCL1) to exchange data. Because both SDA1 and SCL1 lines are open-drain output, each line needs pull-up resistor.
MC96F6432 11.13.16 USI1 I2C Start / Repeated Start / Stop One master can issue a START (S) condition to notice other devices connected to the SCL1, SDA1 lines that it will use the bus. A STOP (P) condition is generated by the master to release the bus lines so that other devices can use it.
MC96F6432 11.13.18 USI1 I2C Acknowledge The acknowledge related clock pulse is generated by the master. The transmitter releases the SDA1 line (HIGH) during the acknowledge clock pulse. The receiver must pull down the SDA1 line during the acknowledge clock pulse so that it remains stable LOW during the HIGH period of this clock pulse. When a slave is addressed by a master (Address Packet), and if it is unable to receive or transmit because it’s performing some real time function, the data line must be left HIGH by the slave.
MC96F6432 Wait High Start High Counting Counting Fast Device SCLOUT High Counter Reset Slow Device SCLOUT SCL1 Figure 11.92 Clock Synchronization during Arbitration Procedure (USI1) Arbitration Process Device 1 loses Device1 outputs not adaped Arbitration High Device1 DataOut Device2 DataOut SDA1 on BUS SCL1 on BUS Figure 11.93 Arbitration Procedure of Two Masters (USI1)
Page 251
MC96F6432 Load SLA1+W into the USI1DR where SLA1 is address of slave device and W is transfer direction from the viewpoint of the master. For master transmitter, W is ‘0’. Note that USI1DR is used for both address and data. Configure baud rate by writing desired value to both USI1SCLR and USI1SCHR for the Low and High period of SCL1 line.
MC96F6432 Master S or Sr SLA+R Receiver SLA+W 0x86 0x22 STOP 0x0E 0x87 LOST DATA STOP LOST LOST& Slave Receiver (0x1D) 0x0F 0x1D 0x1F or Transmitter (0x1F) 0x46 0x22 STOP 0x0E Other master continues LOST Lost? Cont? From master to slave / 0x0F 0x47 Master command or Data Write...
Page 253
MC96F6432 11.13.20.2 USI1 I2C Master Receiver To operate I2C in master receiver, follow the recommended steps below. Enable I2C by setting USI1MS[1:0] bits in USI1CR1 and USI1EN bit in USI1CR2. This provides main clock to the peripheral. Load SLA1+R into the USI1DR where SLA is address of slave device and R is transfer direction from the viewpoint of the master.
MC96F6432 This is the final step for master receiver function of I2C, handling STOP interrupt. The STOP bit indicates that data transfer between master and slave is over. To clear USI1ST2, write “0” to USI1ST2. After this, I2C enters idle state. The processes described above for master receiver operation of I2C can be depicted as the following figure.
Page 255
MC96F6432 11.13.20.3 USI1 I2C Slave Transmitter To operate I2C in slave transmitter, follow the recommended steps below. If the main operating clock (SCLK) of the system is slower than that of SCL1, load value 0x00 into USI1SDHR to make SDA1 change within one system clock period from the falling edge of SCL1. Note that the hold time of SDA1 is calculated by SDAH x period of SCLK where SDAH is multiple of number of SCLK coming from USI1SDHR.
MC96F6432 The next figure shows flow chart for handling slave transmitter function of I2C. IDLE S or Sr SLA+R GCALL 0x97 0x1F LOST& 0x17 DATA 0x22 STOP 0x47 0x46 IDLE From master to slave / Interrupt, SCL1 line is held low Master command or Data Write From slave to master Interrupt after stop command...
Page 257
MC96F6432 11.13.20.4 USI1 I2C Slave Receiver To operate I2C in slave receiver, follow the recommended steps below. If the main operating clock (SCLK) of the system is slower than that of SCL1, load value 0x00 into USI1SDHR to make SDA1 change within one system clock period from the falling edge of SCL1. Note that the hold time of SDA1 is calculated by SDAH x period of SCLK where SDAH is multiple of number of SCLK coming from USI1SDHR.
MC96F6432 The process can be depicted as following figure when I2C operates in slave receiver mode. IDLE S or Sr SLA+W GCALL 0x95 0x1D LOST& 0x15 DATA 0x20 STOP 0x44 0x45 IDLE From master to slave / Interrupt, SCL1 line is held low Master command or Data Write From slave to master Interrupt after stop command...
MC96F6432 11.13.22 Register Map Table 11-24 USI1 Register Map Name Address Default Description USI1BD USI1 Baud Rate Generation Register USI1DR USI1 Data Register USI1SDHR USI1 SDA Hold Time Register USI1SCHR USI1 SCL High Period Register USI1SCLR USI1 SCL Low Period Register USI1SAR USI1 Slave Address Register USI1CR1...
Page 261
MC96F6432 USI1DR (USI1 Data Register: For UART, SPI, and I2C mode) : F5H USI1DR7 USI1DR 6 USI1DR 5 USI1DR 4 USI1DR 3 USI1DR 2 USI1DR 1 USI1DR 0 Initial value : 00H USI1DR[7:0] The USI1 transmit buffer and receive buffer share the same I/O address with this DATA register.
Page 262
MC96F6432 USI1SCLR (USI1 SCL Low Period Register: For I2C mode) : F6H USI1SCLR7 USI1SCLR6 USI1SCLR5 USI1SCLR 4 USI1SCLR 3 USI1SCLR 2 USI1SCLR 1 USI1SCLR 0 Initial value : 3FH USI1SCLR[7:0] This register defines the high period of SCL1 when it operates in I2C master mode.
Page 263
MC96F6432 USI1CR1 (USI1 Control Register 1: For UART, SPI, and I2C mode) : E9H USI1S1 USI1S0 USI1MS1 USI1MS0 USI1PM1 USI1PM0 USI1S2 CPOL1 ORD1 CPHA1 Initial value : 00H USI1MS[1:0] Selects operation mode of USI1 USI1MS1 USI1MS0 Operation mode Asynchronous Mode (UART) Synchronous Mode I2C mode SPI mode...
Page 264
MC96F6432 USI1CR2 (USI1 Control Register 2: For UART, SPI, and I2C mode) : EAH DRIE1 TXCIE1 RXCIE1 WAKEIE1 TXE1 RXE1 USI1EN DBLS1 Initial value : 00H DRIE1 Interrupt enable bit for data register empty (only UART and SPI mode). Interrupt from DRE1 is inhibited (use polling) When DRE1 is set, request an interrupt TXCIE1 Interrupt enable bit for transmit complete (only UART and SPI mode).
Page 265
MC96F6432 USI1CR3 (USI1 Control Register 3: For UART, SPI, and I2C mode) : EBH MASTER1 LOOPS1 DISSCK1 USI1SSEN FXCH1 USI1SB USI1TX8 USI1RX8 Initial value : 00H MASTER1 Selects master or slave in SPI and synchronous mode operation and controls the direction of SCK1 pin Slave mode operation (External clock for SCK1).
Page 266
MC96F6432 USI1CR4 (USI1 Control Register 4: For I2C mode) : ECH – IIC1IFR TXDLYENB1 IIC1IE ACK1EN IMASTER1 STOPC1 STARTC1 – Initial value : 00H IIC1IFR This is an interrupt flag bit for I2C mode. When an interrupt occurs, this bit becomes ‘1’. This bit is cleared when all interrupt source bits in the USI1ST2 register are cleared to “0b”.
Page 267
MC96F6432 USI1ST1 (USI1 Status Register 1: For UART and SPI mode) : F1H DRE1 TXC1 RXC1 WAKE1 USI1RST DOR1 Initial value : 80H DRE1 The DRE1 flag indicates if the transmit buffer (USI1DR) is ready to receive new data. If DRE1 is ‘1’, the buffer is empty and ready to be written.
Page 268
MC96F6432 USI1ST2 (USI1 Status Register 2: For I2C mode) : F2H GCALL1 TEND1 STOPD1 SSEL1 MLOST1 BUSY1 TMODE1 RXACK1 Initial value : 00H (NOTE) GCALL1 This bit has different meaning depending on whether I2C is master or slave. When I2C is a master, this bit represents whether it received AACK (address ACK) from slave.
MC96F6432 11.14 LCD Driver 11.14.1 Overview The LCD driver is controlled by the LCD Control Register (LCDCRH/L). The LCLK[1:0] determines the frequency of COM signal scanning of each segment output. A RESET clears the LCD control register LCDCRH and LCDCRL values to logic ‘0’. The LCD display can continue operating during IDLE and STOP modes if a sub-frequency clock is used as LCD clock source.
MC96F6432 11.14.2 LCD Display RAM Organization Display data are stored to the display data area in the external data memory. The display data which stored to the display external data area (address 0000H-001AH) are read automatically and sent to the LCD driver by the hardware. The LCD driver generates the segment signals and common signals in accordance with the display data and drive method.
Page 279
MC96F6432 11.14.8 Register Description for LCD Driver LCDCRH (LCD Driver Control High Register) : 9AH – – – – – COMCHG LCDDR DISP – – – – – Initial value : 00H COMCHG Common Signal Output Port Change Control COM0 – COM3 signals are outputted through the P37-P34 COM0 –...
MC96F6432 12. Power Down Operation 12.1 Overview The MC96F6432 has two power-down modes to minimize the power consumption of the device. In power down mode, power consumption is reduced considerably. The device provides three kinds of power saving functions, Main-IDLE, Sub-IDLE and STOP mode. In three modes, program is stopped. 12.2 Peripheral Operation in IDLE/STOP Mode Table 12-1 Peripheral Operation during Power Down Mode Peripheral...
MC96F6432 12.3 IDLE Mode The power control register is set to ‘01h’ to enter the IDLE Mode. In this mode, the internal oscillation circuits remain active. Oscillation continues and peripherals are operated normally but CPU stops. It is released by reset or interrupt.
MC96F6432 12.4 STOP Mode The power control register is set to ‘03H’ to enter the STOP Mode. In the stop mode, the selected oscillator, system clock and peripheral clock is stopped, but watch timer can be continued to operate with sub clock. With the clock frozen, all functions are stopped, but the on-chip RAM and control registers are held.
MC96F6432 12.5 Release Operation of STOP Mode After STOP mode is released, the operation begins according to content of related interrupt register just before STOP mode start (Figure 12.3). If the global interrupt Enable Flag (IE.EA) is set to `1`, the STOP mode is released by the interrupt which each interrupt enable flag = `1` and the CPU jumps to the relevant interrupt service routine.
MC96F6432 12.5.1 Register Map Table 12-2 Power Down Operation Register Map Name Address Default Description PCON Power Control Register 12.5.2 Power Down Operation Register Description The power down operation register consists of the power control register (PCON). 12.5.3 Register Description for Power Down Operation PCON (Power Control Register) : 87H –...
MC96F6432 13. RESET 13.1 Overview The following is the hardware setting value. Table 13-1 Reset State On Chip Hardware Initial Value Program Counter (PC) 0000h Accumulator Stack Pointer (SP) Peripheral Clock Control Register Refer to the Peripheral Registers 13.2 Reset Source The MC96F6432 has five types of reset sources.
MC96F6432 13.4 RESET Noise Canceller The Figure 13.2 is the noise canceller diagram for noise cancellation of RESET. It has the noise cancellation value of about 2us (@V =5V) to the low input of system reset. t < T t < T t >...
MC96F6432 Counting for config read start after POR is released Internal nPOR PAD RESETB “H” LVR_RESETB .. 27 28 BIT (for Config) 00 01 02 03 BIT (for Reset) 1us X 256 X 28h = about 10ms Config Read 1us X 4096 X 4h = about 16ms RESET_SYSB INT-OSC (8MHz) INT-OSC 8MHz/8...
MC96F6432 Table 13-2 Boot Process Description Process Description Remarks ① -No Operation ② -1st POR level Detection -about 1.4V - (INT-OSC 8MHz/8)x256x28h Delay section (=10ms) ③ -Slew Rate >= 0.05V/ms -VDD input voltage must rise over than flash operating voltage for Config read -about 1.5V ~ 1.6V ④...
MC96F6432 13.6 External RESETB Input The External RESETB is the input to a Schmitt trigger. If RESETB pin is held with low for at least 10us over within the operating voltage range and stable oscillation, it is applied and the internal state is initialized. After reset state becomes ‘1’, it needs the stabilization time with 16ms and after the stable state, the internal RESET becomes ‘1’.
MC96F6432 13.7 Brown Out Detector Processor The MC96F6432 has an On-chip brown-out detection circuit (BOD) for monitoring the VDD level during operation by comparing it to a fixed trigger level. The trigger level for the BOD can be selected by LVRVS[3:0] bit to be 1.60V, 2.00V, 2.10V, 2.20V,2.32V, 2.44V, 2.59V, 2.75V, 2.93V, 3.14V, 3.38V, 3.67V, 4.00V, 4.40V.
MC96F6432 “H” “H” Internal nPOR “H” PAD RESETB LVR_RESETB ..27 28 BIT (for Config) 00 01 02 BIT (for Reset) 1us X 256 X 28h = about 10ms Config Read 1us X 4096 X 4h = about 16ms RESET_SYSB Main OSC Off INT-OSC (8MHz)
MC96F6432 13.9 Register Map Table 13-3 Reset Operation Register Map Name Address Default Description RSTFR Reset Flag Register LVRCR Low Voltage Reset Control Register LVICR Low Voltage Indicator Control Register 13.10 Reset Operation Register Description The reset control register consists of the reset flag register (RSTFR), low voltage reset control register (LVRCR), and low voltage indicator control register (LVICR).
Page 295
MC96F6432 LVRCR (Low Voltage Reset Control Register) : D8H – – LVRST LVRVS3 LVRVS2 LVRVS1 LVRVS0 LVREN – – Initial value : 00H LVRST LVR Enable when Stop Release Not effect at stop release LVR enable at stop release NOTES) When this bit is ‘1’, the LVREN bit is cleared to ‘0’...
Page 296
MC96F6432 LVICR (Low Voltage Indicator Control Register) : 86H – – LVIF LVIEN LVILS3 LVILS2 LVILS1 LVILS0 – – Initial value : 00H LVIF Low Voltage Indicator Flag Bit No detection Detection LVIEN LVI Enable/Disable Disable Enable LVILS[3:0] LVI Level Select LVILS3 LVILS2 LVILS1 LVILS0...
MC96F6432 14. On-chip Debug System 14.1 Overview 14.1.1 Description On-chip debug system (OCD) of MC96F6432 can be used for programming the non-volatile memories and on- chip debugging. Detail descriptions for programming via the OCD interface can be found in the following chapter. Figure 14.1 shows a block diagram of the OCD interface and the On-chip Debug system.
MC96F6432 14.2 Two-Pin External Interface 14.2.1 Basic Transmission Packet • 10-bit packet transmission using two-pin interface. • 1-packet consists of 8-bit data, 1-bit parity and 1-bit acknowledge. • Parity is even of ‘1’ for 8-bit data in transmitter. • Receiver generates acknowledge bit as ‘0’ when transmission for 8-bit data and its parity has no error. •...
MC96F6432 14.2.2 Packet Transmission Timing 14.2.2.1 Data Transfer DSDA acknowledgement acknowledgement signal from receiver signal from receiver DSCL START STOP Figure 14.3 Data Transfer on the Twin Bus 14.2.2.2 Bit Transfer DSDA DSCL data line change stable: of data data valid allowed except Start and Stop Figure 14.4 Bit Transfer on the Serial Bus...
MC96F6432 14.2.2.3 Start and Stop Condition DSDA DSDA DSCL DSCL START condition STOP condition Figure 14.5 Start and Stop Condition 14.2.2.4 Acknowledge Bit Data output by transmitter no acknowledge Data output By receiver acknowledge DSCL from master clock pulse for acknowledgement Figure 14.6 Acknowledge on the Serial Bus June 22, 2018 Ver.
MC96F6432 Acknowledge bit Acknowledge bit transmission transmission Minimum wait HIGH start HIGH 500ns Host PC DSCL OUT Start wait Target Device DSCL OUT minimum 1 T SCLK for next byte Maximum 5 T SCLK transmission DSCL Internal Operation Figure 14.7 Clock Synchronization during Wait Procedure June 22, 2018 Ver.
MC96F6432 14.2.3 Connection of Transmission Two-pin interface connection uses open-drain (wire-AND bidirectional I/O). pull resistors DSDA(Debugger Serial Data Line) DSCL(Debugger Serial Clock Line) DSCL DSDA DSCL DSDA DSDA DSDA DSCL DSCL Target Device(Slave) Host Machine(Master) Current source for DSCL to fast 0 to 1 transition in high speed mode Figure 14.8 Connection of Transmission June 22, 2018 Ver.
MC96F6432 15. Flash Memory 15.1 Overview 15.1.1 Description MC96F6432 incorporates flash memory to which a program can be written, erased, and overwritten while mounted on the board. The flash memory can be read by ‘MOVC’ instruction and it can be programmed in OCD, serial ISP mode or user program mode.
Page 307
MC96F6432 FMCR (Flash Mode Control Register) : FEH – – – – FMBUSY FMCR2 FMCR1 FMCR0 – – – – Initial value : 00H FMBUSY Flash Mode Busy Bit. This bit will be used for only debugger. No effect when “1” is written Busy FMCR[2:0] Flash Mode Control Bits.
Page 308
MC96F6432 15.1.6 Serial In-System Program (ISP) Mode Serial in-system program uses the interface of debugger which uses two wires. Refer to chapter 14 in details about debugger 15.1.7 Protection Area (User program mode) MC96F6432 can program its own flash memory (protection area). The protection area can not be erased or programmed.
Page 309
MC96F6432 15.1.8 Erase Mode The sector erase program procedure in user program mode 1. Page buffer clear (FMCR=0x01) 2. Write ‘0’ to page buffer 3. Set flash sector address register (FSADRH/FSADRM/FSADRL). 4. Set flash identification register (FIDR). (Note) 5. Check the UserID for to prevent the invalid work 6.
Page 310
MC96F6432 The Byte erase program procedure in user program mode 1. Page buffer clear (FMCR=0x01) 2. Write ‘0’ to page buffer 3. Set flash sector address register (FSADRH/FSADRM/FSADRL). 4. Set flash identification register (FIDR). (Note) 5. Check the UserID for to prevent the invalid work 6.
Page 311
MC96F6432 15.1.9 Write Mode The sector Write program procedure in user program mode 1. Page buffer clear (FMCR=0x01) 2. Write data to page buffer 3. Set flash sector address register (FSADRH/FSADRM/FSADRL). 4. Set flash identification register (FIDR). (Note1) 5. Check the UserID for to prevent the invalid work 6.
Page 312
MC96F6432 The Byte Write program procedure in user program mode 1. Page buffer clear (FMCR=0x01) 2. Write data to page buffer 3. Set flash sector address register (FSADRH/FSADRM/FSADRL). 4. Set flash identification register (FIDR). (Note1). 5. Check the UserID for to prevent the invalid work 6.
Page 313
MC96F6432 15.1.10 Protection for Invalid Erase/Write It should be taken care to the flash erase/write programming in code. You must make preparations for invalid jump to the flash erase/write code by malfunction, noise, and power off. Note) For more information, please refer to the appendix “Flash Protection for Invalid Erase/Write”. 1.
Page 314
MC96F6432 3. The flash sector address (FSADRH/FSADRM/FSADRL) should always keep the address of the flash which is used for data area. For example, The FSADRH/FSADRM is always 0x00/0x7f” if 0x7f00 to 0x7fff is used for data. 4. Overview of main CALL Work1 CALL...
MC96F6432 15.1.10.1 Flow of Protection for Invalid Erase/Write Start Work1 Decide to write/erase on Set Flags flash Work2 Match Check the flag for UserID Write UserID1/2/3 Work3 Check the UserID for Match Write/Erase Flash write/erase flash Clear the Flag Clear UserID1/2/3 Note) This method is helpful to reduce the case for flash memory to be erased by malfunction, noise and power off.
Page 316
MC96F6432 15.1.11 Read Mode The Reading program procedure in user program mode 1. Load receive data from flash memory on MOVC instruction by indirectly addressing mode. Program Tip – reading A,#0 DPH,#0x7F DPL,#0x40 ;flash memory address MOVC A,@A+DPTR ;read data from flash memory 15.1.12 Code Write Protection Mode The Code Write Protection program procedure in user program mode 1.
MC96F6432 16. Configure Option 16.1 Configure Option Control The data for configure option should be written in the configure option area (003EH – 003FH) by programmer (Writer tools). CONFIGURE OPTION 1 : ROM Address 003FH – – – – – RSTS Initial value : 00H Code Read Protection...
MC96F6432 17. APPENDIX A. Instruction Table Instructions are either 1, 2 or 3 bytes long as listed in the ‘Bytes’ column below. Each instruction takes either 1, 2 or 4 machine cycles to execute as listed in the following table. 1 machine cycle comprises 2 system clock cycles.
Page 319
MC96F6432 XRL A,#data Exclusive-OR immediate to A XRL dir,A Exclusive-OR A to direct byte XRL dir,#data Exclusive-OR immediate to direct byte CLR A Clear A CPL A Complement A SWAP A Swap Nibbles of A RL A Rotate A left RLC A Rotate A left through carry RR A...
Page 320
MC96F6432 ORL C,bit OR direct bit to carry ORL C,/bit OR direct bit inverse to carry MOV C,bit Move direct bit to carry MOV bit,C Move carry to direct bit BRANCHING Mnemonic Description Bytes Cycles Hex code ACALL addr 11 Absolute jump to subroutine 11→F1 LCALL addr 16...
Page 321
MC96F6432 B. Instructions on how to use the input port. Error occur status Using compare jump instructions with input port, it could cause error due to the timing conflict inside the MCU. Compare jump Instructions which cause potential error used with input port condition: bit, rel ;...
Page 322
MC96F6432 If you use input bit port for compare jump instruction, you have to copy the input port as internal paramet er or carry bit and then use compare jump instruction. zzz: C,080.0 ; input port use internal parameter bit tt;...
Page 323
MC96F6432 C. Flash Protection for Invalid Erase/Write Overview This is example to prevent changing code or data in flash by abnormal operation(noise, unstable power, malfunction, etc…). How to protect the flash • Divide into decision and execution to Erase/Write in flash. Check the program sequence from decision to execution in order of precedence about Erase/Write.
Page 324
MC96F6432 Flowchart Start Initial ① Set LVR/LVI more than 2.0V Start Main Loop Working ③ Write Flash? Set User_ID1 ② Working ③ Check User_ID1? Set User_ID2 Working Check User_ID2? Set User_ID3 ③ Working Write Flash Set FSADDRH/M/L ④ Set FIDR ⑤...
Page 325
• ⑥ Initialize Flags Initialize User_ID1/2/3 Set Flash Sector Address to Dummy Address • Sample Source Refer to the ABOV homepage. It is created based on the MC97F2664. Each product should be modified according to the Page Buffer Size and Flash Size ...
Page 326
MC96F6432 D. ESD Test Method ESD Test Description ESD Testing was perform on Zapmaster system using the Human-Body-Model (H.B.M) and Machine-Model (M.M) according JESD22-A114F and EIA/JESD22-A115-A respectively. Human-Body-Model stresses devices by sudden application of a high voltage supplied by a 100pF capacitor through 1.5k Ohms resistance. Machine- Model stresses devices by sudden application of a high voltage supplied by a 200pF capacitor through very low (0 Ohm) resistance.
Page 327
MC96F6432 ESD Test Method : I/O (Pin-to-Pin) Mode I/O pins are zapped, pin by pin. I/O pins which are not zapped are grounded. All power pins (VDD and VSS) are floated. ESD Class HBM (Human-Body-Model) : 2 M.M. (Machine-Model) : B June 22, 2018 Ver.
Need help?
Do you have a question about the MC96F6432 Series and is the answer not in the manual?
Questions and answers