Page 2
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.
Page 7
Figure 15.1 Flash Program ROM Structure ..................151 Figure 15.2 Flow of Protection for Invalid Erase/Write ................162 List of Tables Table 1-1 Ordering Information of MC96FM204/FM214 ................. 11 Table 5-1 Normal pin description ......................21 Table 7-1 Absolute Maximum Ratings ....................25 Table 7-2 Recommended Operating Conditions ..................
Page 8
MC96FM204/FM214 Table 12-1 Peripheral Operation during Power Down Mode ..............129 Table 12-2 Power Down Operation Register Map ................133 Table 13-1 Reset State ......................... 134 Table 13-2 Boot Process Description....................137 Table 13-3 Reset Operation Register Map ................... 141 Table 15-1 Flash Memory Register Map ....................
1. Overview 1.1 Description The MC96FM204/FM214 are advanced CMOS 8-bit microcontroller with 4k 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 : 4k bytes of FLASH, 256 bytes of IRAM, general purpose I/O, basic interval...
1.4.1 Compiler We do not provide the compiler. Please contact third parties. The core of MC96FM204/FM214 is Mentor 8051. And, device ROM size is smaller than 64k bytes. Developer can use all kinds of third party’s standard 8051 compiler. 1.4.2 OCD emulator and debugger The OCD (On Chip Debug) emulator supports ABOV Semiconductor’s 8051 series MCU emulation.
P10/AN4/CMP-/EINT0 P12/AN6/CMPO/BUZO P11/AN5/CMP+/EINT1 Figure 3.2 MC96FM204 16SOP/TSSOP Pin Assignment NOTES) 1. On On-Chip Debugging, ISP uses P2[1:0] pin as DSDA, DSCL. 2. The P13-P16 pins should be selected as a push-pull output or an input with pull-up resistor by software control when the 16-pin(with OP-AMP) package is used.
MC96FM204/FM214 5. Pin Description Table 5-1 Normal pin description Function @RESET Shared with Name The low nibble of port 0 is a bit-programmable I/O port T1O/PWM1O/EINT11 Input which can be configured as a schmitt-trigger input, a RESETB/SS/EC1 push-pull output, or an open-drain output.
Page 22
MC96FM204/FM214 Table 5-1 Normal pin description (Continued) Function @RESET Shared with Name A/D converter analog input channels Input P04/MOSI/OP1IN P05/OP0OUT P06/OP0N P07/OP0P P10/CMP-/EINT0 P11/CMP+/EINT1 P12/CMPO/BUZO P13/EINT2 Output (NOTE4,5) DSDA On chip debugger data input/output Input (NOTE4, 5) DSCL On chip debugger clock input...
MC96FM204/FM214 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...
MC96FM204/FM214 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 CLEAR...
MC96FM204/FM214 7. Electrical Characteristics 7.1 Absolute Maximum Ratings Table 7-1 Absolute Maximum Ratings Parameter Symbol Rating Unit NOTE -0.3 – +6.0 – Supply Voltage -0.3 – VDD+0.3 Voltage on any pin with respect to VSS -0.3 – VDD+0.3 Maximum current output sourced by (I...
MC96FM204/FM214 7.14 Data Retention Voltage in Stop Mode Table 7-14 Data Retention Voltage in Stop ModeR = -40°C – +85°C, VDD= 1.8V – 5.5V) Parameter Symbol Conditions Unit – – Data retention supply voltage DDDR VDDR= 1.8V, – – μA...
MC96FM204/FM214 7.18 Main Oscillation Stabilization Characteristics Table 7-18 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 –...
MC96FM204/FM214 7.20 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-...
MC96FM204/FM214 7.21 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.
MC96FM204/FM214 7.22 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.
DPTR register. MC96FM204/FM214 provides on-chip 4k bytes of the ISP type flash program memory, which can be read and written to. Internal data memory (IRAM) is 256 bytes and it includes the stack area.
MC96FM204/FM214 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.
MC96FM204/FM214 8.3.2 SFR Map Table 8-2 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 – – –...
9. I/O Ports 9.1 I/O Ports The MC96FM204/FM214 has three groups of I/O ports (P0 ~ P2). 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.
Page 58
MC96FM204/FM214 P0FSRH (Port 0 Function Selection High Register) : EDH PFSRH07 PFSRH06 PFSRH05 PFSRH04 PFSRH03 PFSRH02 PFSRH01 PFSRH00 Initial value : 00H PFSRH0[7:6] P07 Function select PFSRH07 PFSRH06 Description I/O Port OP0P Function AN3 Function Not used PFSRH0[5:4] P06 Function select...
Page 59
MC96FM204/FM214 P0FSRL (Port 0 Function Selection Low Register) : ECH – – – PFSRL04 PFSRL03 PFSRL02 PFSRL01 PFSRL00 – – – Initial value : 00H PFSRL0[4:3] P03 Function select PFSRL04 PFSRL03 Description I/O Port MISO Function XIN for Oscillator Not used...
Page 62
MC96FM204/FM214 P1FSR (Port 1 Function Selection Register) : EEH PFSR17 PFSR16 PFSR15 PFSR14 PFSR13 PFSR12 PFSR11 PFSR10 Initial value : 00H PFSRH17 P15 Function select I/O Port (EINT12 function possible when input) T2O/PWM2O Function PFSRH16 P13 Function select I/O Port (EINT3 function possible when input)
MC96FM204/FM214 9.5 P2 Port 9.5.1 P2 Port Description P2 is 2-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). 9.5.2 Register description for P2 P2 (P2 Data Register) : 90H –...
10. Interrupt Controller 10.1 Overview The MC96FM204/FM214 supports up to 14 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.
MC96FM204/FM214 10.2 External Interrupt The external interrupt on INT0 – INT4 and INT5 pins receive various interrupt request depending on the external interrupt polarity 0 register (EIPOL0) 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 register (EIFLAG) provides the status of external interrupts.
MC96FM204/FM214 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.
MC96FM204/FM214 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)
MC96FM204/FM214 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...
MC96FM204/FM214 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.
MC96FM204/FM214 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 73
MC96FM204/FM214 10.12.3 External Interrupt Flag Register (EIFLAG) The external interrupt flag register is set to ‘1’ when the external interrupt generating condition is satisfied. The flag is cleared when the interrupt service routine is executed. Alternatively, the flag can be cleared by writing a ‘0’...
Page 78
MC96FM204/FM214 EIFLAG (External Interrupt Flag Register) : A0H – – FLAG12 FLAG11 FLAG3 FLAG2 FLAG1 FLAG0 – – Initial value : 00H When an external interrupt is occurred, the flag becomes ‘1’. EIFLAG0[5:0] The flag is cleared by writing ‘0’ to the bit or automatically...
MC96FM204/FM214 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 frequency clock oscillator. The main clock operation can be easily obtained by attaching a crystal between the XIN and XOUT pin, respectively.
MC96FM204/FM214 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.
Page 81
MC96FM204/FM214 OSCCR (Oscillator Control Register) : C8H – – – LFIRCE IRCS1 IRCS0 HFIRCE XCLKE – – – Initial value : 20H LFIRCE Control the operation of the low frequency internal RC oscillator Enable operation of LF INT-RC OSC Disable operation of LF INT-RC OSC...
11.2 Basic Interval Timer 11.2.1 Overview The MC96FM204/FM214 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).
MC96FM204/FM214 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.
MC96FM204/FM214 11.4 Timer 0 11.4.1 Overview The 8-bit timer 0 consists of multiplexer, timer 0 counter register, timer 0 data register and timer 0 control register (T0CNT, T0DR, T0CR). 8-bit timer/counter mode The timer/counter 0 can be clocked by an internal clock source. The clock source is selected by clock selection logic which is controlled by the clock selection bits (T0CK[2:0]).
MC96FM204/FM214 Match with T0DR T0CNT Value Count Pulse Period Up-count TIME Interrupt Period x (n+1) Timer 0 (T0IFR) Occur Occur Occur Interrupt Interrupt Interrupt Interrupt Figure 11.6 8-Bit Timer/Counter 0 Example April 7, 2016 Ver. 1.8...
MC96FM204/FM214 11.5 Timer 1 11.5.1.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:...
MC96FM204/FM214 11.5.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/L is equal to T1ADRH/L.
MC96FM204/FM214 11.5.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 PFSRL00 to ‘1’ .
MC96FM204/FM214 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"...
MC96FM204/FM214 11.5.5 Block Diagram 16-bit A Data Register T1ADRH/T1ADRL A Match Reload T1CC T1EN T1CK[2:0] 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 99
MC96FM204/FM214 11.5.6.2 Register Description for Timer/Counter 1 T1ADRH (Timer 1 A data High Register) : BDH T1ADRH7 T1ADRH6 T1ADRH5 T1ADRH4 T1ADRH3 T1ADRH2 T1ADRH1 T1ADRH0 Initial value : FFH T1ADRH[7:0] T1 A Data High Byte T1ADRL (Timer 1 A Data Low Register) : BCH...
Page 100
MC96FM204/FM214 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]...
Page 101
MC96FM204/FM214 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...
MC96FM204/FM214 11.6 Timer 2 11.6.1 Overview The 16-bit timer 2 consists of multiplexer, timer 2 A data register high/low, timer 2 B data register high/low and timer 2 control register high/low (T2ADRH, T2ADRL, T2BDRH, T2BDRL, T2CRH, T2CRL). It has four operating modes:...
MC96FM204/FM214 11.6.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/external clock. Basically, it has the same function as the 16-bit timer/counter mode and the interrupt occurs when T2CNTH/L is equal to T2ADRH/L.
MC96FM204/FM214 11.6.4 16-Bit PPG Mode The timer 2 has a PPG (Programmable Pulse Generation) function. In PPG mode, T2O/PWM2O pin outputs up to 16-bit resolution PWM output. This pin should be configured as a PWM output by setting PFSR17 to ‘1’ .
MC96FM204/FM214 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"...
MC96FM204/FM214 11.6.5 Block Diagram 16-bit A Data Register T2ADRH/T2ADRL A Match Reload T2CC T2EN T2CK[2:0] T2ECE INT_ACK Buffer Register A Clear Edge A Match To interrupt Detector T2IFR block T2EN fx/1 Comparator fx/2 A Match Clear fx/4 16-bit Counter T2CC...
Page 109
MC96FM204/FM214 11.6.6.2 Register Description for Timer/Counter 2 T2ADRH (Timer 2 A data High Register) : C5H T2ADRH7 T2ADRH6 T2ADRH5 T2ADRH4 T2ADRH3 T2ADRH2 T2ADRH1 T2ADRH0 Initial value : FFH T2ADRH[7:0] T2 A Data High Byte T2ADRL (Timer 2 A Data Low Register) : C4H...
Page 110
MC96FM204/FM214 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]...
Page 111
MC96FM204/FM214 T2CRL (Timer 2 Control Low Register) : C2H – T2CK2 T2CK1 T2CK0 T2IFR T2POL T2ECE T2CNTR – Initial value : 00H T2CK[2:0] Select Timer 2 clock source. fx is main system clock frequency T2CK2 T2CK1 T2CK0 Description fx/2048 fx/512...
MC96FM204/FM214 11.7 Buzzer Driver 11.7.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 P12/AN6/CMPO/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.
MC96FM204/FM214 11.8 SPI 11.8.1 Overview There is serial peripheral interface (SPI) one channel in MC96M204/FM214. The SPI allows synchronous serial data transfer between the external serial devices. It can do Full-duplex communication by 4-wire (MOSI, MISO, SCK, SS), support master/slave mode, can select serial clock (SCK) polarity, phase and whether LSB first data transfer or MSB first data transfer.
Page 115
MC96FM204/FM214 11.8.3 Data Transmit / Receive Operation User can use SPI for serial data communication by following step 1. Select SPI operation mode(master/slave, polarity, phase) by control register SPICR. 2. When the SPI is configured as a Master, it selects a Slave by SS signal (active low).
MC96FM204/FM214 11.8.6 Register Map Table 11-11 SPI Register Map Name Address Default Description SPISR SPI Status Register SPIDR SPI Data Register SPICR SPI Control Register 11.8.7 SPI Register Description The SPI register consists of SPI control register (SPICR), SPI status register (SPISR) and SPI data register (SPIDR) 11.8.8 Register Description for SPI...
Page 118
MC96FM204/FM214 SPISR (SPI Status Register) : C0H – – – SPIIFR WCOL SS_HIGH FXCH SSENA – – – Initial value : 00H When SPI Interrupt occurs, this bit becomes ‘1’. IF SPI interrupt is SPIIFR enable, this bit is auto cleared by INT_ACK signal. And if SPI Interrupt...
Page 119
MC96FM204/FM214 SPICR (SPI Control Register) : B5H SPIEN FLSB CPOL CPHA DSCR SCR1 SCR0 Initial value : 00H SPIEN This bit controls the SPI operation Disable SPI operation Enable SPI operation FLSB This bit selects the data transmission sequence MSB first mode...
MC96FM204/FM214 11.9 8-Bit A/D Converter 11.9.1 Overview The analog-to-digital(A/D) converter allows conversion of an analog input signal to an corresponding 8-bit digital value. The A/D module has eight analog inputs, which are multiplexer into one sample and hold. The output of the sample and hold is the input of the converter which generates the result through successive approximation.
MC96FM204/FM214 SET ADCCRH Select ADC Clock 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 ADCD...
Page 123
MC96FM204/FM214 11.9.5 ADC Register Description The A/D converter control High register (ADCCRH), A/D converter control low register (ADCCRL), Sample and hold timing data register (SHTDR) and A/D converter data register (ADCDR) 11.9.6 Register Description for ADC ADCDR (A/D Converter Data Register) : 9CH...
Page 124
MC96FM204/FM214 ADCCRL (A/D Converter Counter Low Register) : B0H STBY ADST ADCIFR 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 Trigger Signal for A/D Conversion stop/start.
MC96FM204/FM214 11.10 Analog Comparator 11.10.1 Overview The analog comparator compares the input values on the positive pin CMP+ and negative pin CMP-. When the voltage on the positive pin CMP+ is higher than the voltage on the negative pin CMP-, the analog comparator output, CMPO, is set.
MC96FM204/FM214 11.10.3 Register Map Table 11-13 ADC Register Map Name Address Default Description ACCSR Analog Comparator Control & Status Register 11.10.4 Analog Comparator Register Description The analog comparator control and status register (ACCSR) 11.10.5 Register Description for ACCSR ACCSR (Anlaog Comparator & Status Register) : E8H –...
MC96FM204/FM214 11.11 Operational Amplifier 11.11.1 Overview There is operational amplifier (OP-AMP) two channel in MC96FM204. The operational amplifier (OP-AMP) has one registers which is operational amplifier control High register (AMPCR). The OP-AMP is not in MC96FM214M/H device. 11.11.2 Block Diagram...
12. Power Down Operation 12.1 Overview The MC96FM204/FM214 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 two kinds of power saving functions, IDLE and STOP mode. In three modes, program is stopped.
MC96FM204/FM214 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.
MC96FM204/FM214 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. With the clock frozen, all functions are stopped, but the on-chip RAM and control registers are held.
MC96FM204/FM214 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.
MC96FM204/FM214 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 –...
Control Register Refer to the Peripheral Registers 13.2 Reset Source The MC96FM204/FM214 has five types of reset sources. The following is the reset sources. - External RESETB - Power ON RESET (POR) - WDT Overflow Reset (In the case of WDTEN = `1`)
MC96FM204/FM214 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 >...
MC96FM204/FM214 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...
MC96FM204/FM214 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 -over 1.75V...
MC96FM204/FM214 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...
13.7 Brown Out Detector Processor The MC96FM204/FM214 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, and 4.40V.
MC96FM204/FM214 “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...
MC96FM204/FM214 13.8.1 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.8.2 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 142
MC96FM204/FM214 LVRCR (Low Voltage Reset Control High Register) : 98H – – 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 set to ‘1’...
Page 143
MC96FM204/FM214 LVICR (Low Voltage Indicator Control High Register) : E1H – – 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...
14.1 Overview 14.1.1 Description On-chip debug system (OCD) of MC96FM204/FM214 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.
MC96FM204/FM214 Figure 14.2 10-bit Transmission Packet 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 April 7, 2016 Ver. 1.8...
MC96FM204/FM214 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 14.2.2.3 Start and Stop Condition DSDA DSDA DSCL DSCL START condition STOP condition Figure 14.5 Start and Stop Condition...
MC96FM204/FM214 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 Acknowledge bit Acknowledge bit transmission transmission Minimum wait HIGH start HIGH...
MC96FM204/FM214 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 DSCL DSDA DSCL DSDA 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...
15.1 Overview 15.1.1 Description MC96FM204/FM214 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 154
MC96FM204/FM214 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...
Page 155
15.1.7 Protection Area (User program mode) MC96FM204/FM214 can program its own flash memory (protection area). The protection area can not be erased or programmed. The protection areas are available only when the PAEN bit is cleared to ‘0’, that is, enable protection area at the configure option 1 if it is needed.
Page 156
MC96FM204/FM214 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 157
MC96FM204/FM214 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 158
MC96FM204/FM214 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 159
MC96FM204/FM214 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 160
MC96FM204/FM214 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”.
Page 161
MC96FM204/FM214 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/0x3f” if 0x3f00 to 0x3fff is used for data. 4. Overview of main...
MC96FM204/FM214 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 163
MC96FM204/FM214 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,#0x0F DPL,#0xA0 ;flash memory address MOVC A,@A+DPTR ;read data from flash memory 15.1.12 Hard Lock Mode...
MC96FM204/FM214 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 3FH – – – – –...
MC96FM204/FM214 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 166
MC96FM204/FM214 XRL A, @Ri Exclusive-OR indirect memory to A 66-67 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...
Page 167
MC96FM204/FM214 ANL C,bit AND direct bit to carry ANL C,/bit AND direct bit inverse to carry 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...
Page 168
MC96FM204/FM214 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 169
MC96FM204/FM214 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 170
MC96FM204/FM214 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.
Page 171
MC96FM204/FM214 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 172
• ⑥ 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 ...
Need help?
Do you have a question about the MC96FM204 and is the answer not in the manual?
Questions and answers