深圳市美芯微电子有限公司 电话:0755-36857609/27945551/29491882 地址:深圳市宝安区宝源路名优产品采购中心B1区721室 麦肯单片机授权一级代理商 MDT10F676 3. Applications 1. General Description The application areas of this MDT10F676 range This 8-bit Micro-controller uses a fully static from appliance motor control and high speed CMOS technology to achieve high speed, small automotive size, low power and high noise immunity. transmitters/receivers, On chip memory includes 1 K words of Flash telecommunications processors, such as Remote ROM, and 128 bytes of EEPROM, and 64 bytes controller, of static RAM. automobile and PC peripheral … etc. 2. Features power pointing instruments, remote devices, chargers, and toy, MDT10F676P11 (DIP) 8-bit data bus MDT10F676S11 (SOP) On chip flash ROM size : Vdd OSC1/PA5 OSC2/PA4 PA3 PC5 PC4 PC3 -- 1 K words Internal RAM size : MDT10F676 small low 4. Pin Assignment Fully CMOS static design MDT10F676 to -- 64 bytes (64 general purpose registers) 128 bytes of EEPROM 1 2 3 4 5 6 7 14 13 12 11 10 9 8 Vss PA0/CIN+ PA1/CINPA2/INT PC0 PC1 PC2 37 single word instructions 14-bit instructions 8-level stacks Operating voltage : 2.3V ~ 5.5 V Watchdog timer with on-chip RC oscillator MDT10F676P13 (DIP) Interrupt capability MDT10F676S13 (SOP) A/D converter module: Vdd OSC1/PA5 OSC2/PA4 /MCLR PC5 PC4 PC3 8 analog input multiplexed into one A/D converter with 10-bit resolution Timer0 : 8-bit timer with 3-bit prescaler Timer1 : 16-bit timer with 2-bit prescaler One analog comparator module 1 2 3 4 5 6 7 14 13 12 11 10 9 8 Vss PA0/CIN+ PA1/CINPA2/INT PC0 PC1 PC2 Sleep mode for power saving PA with port change wake-up interrupt Power-on Reset 12 I/O pins with their own independent direction control System input clock select at 4M or 8MHz This specification is subject to be changed without notice. Please visit our web site for the most updated information. http://www.mdtic.com.tw http://www.mx mcu.com.cn 1/18 2010.6 Ver. 1.1 MDT10F676 5. Order Information Device ROM RAM EEPROM (Words) (Bytes) (Bytes) I/O A/D & Timer Comparators (8/16 bit) Package MDT10F676P11 1.0K 64 128 12 1/1 1/1 14-DIP MDT10F676P13 1.0K 64 128 11 1/1 1/1 14-DIP MDT10F676S11 1.0K 64 128 12 1/1 1/1 14-SOP MDT10F676S13 1.0K 64 128 11 1/1 1/1 14-SOP Remark Pin 4 is /MCLR external reset function Pin 4 is /MCLR external reset function 6. Block Diagram EEPROM 128×8 Stack Eight Levels 8 bits Program Counters Flash ROM 1024 ×14 10 bits Comparator 14 bits Instruction Register RAM 64 ×8 PA3 Port A Special Register PA0~PA2 PA4~PA5 5 bits A/D converter Oscillator circuit Instruction Decoder Control Circuit Data 8bit Port C AN0 | AN7 PC0~PC5 6 bits D0~D7 TMR0 8 Bits Power on Reset Power Down Reset Working Register Watchdog Timer ALU Status Register TMR1 16 Bits This specification is subject to be changed without notice. Please visit our web site for the most updated information. http://www.mdtic.com.tw http://www.mx mcu.com.cn 2/18 2010.6 Ver. 1.1 MDT10F676 7. Pin Function Description Pin Name I/O PA0/CIN+/AN0 I/O Function Description Port A, TTL input level, with program pull_hi and interrupt on pin change. Comparator input. A/D Channel 0 input. PA1/CIN-/AN1 I/O Port A, TTL input level, with program pull_hi and interrupt on pin change. Comparator input. A/D Channel 1 input. PA2/T0CK/INT/COUT I/O Port A, Schmitt Trigger input level, with program pull_hi and interrupt on pin change. /AN2 Timer0 clock input. External interrupt. Comparator output. A/D Channel 2 input. PA3/MCLR I Port A, TTL input level, with program interrupt on pin change. Master clear. Schmitt Trigger input level. PA4/OSC2/T1G/AN3 I/O Port A, TTL input level, with program pull_hi and interrupt on pin change. Oscillator crystal output, in RC mode clock output Fosc/4 frequency. Timer1 gate. A/D Channel 3 input. PA5/OSC1/T1CKI I/O Port A, TTL input level, with program pull_hi and interrupt on pin change. Oscillator crystal input/external clock source input. Timer1 clock input. PC0/AN4 I/O Port C, TTL input level. A/D Channel 4 input. PC1/AN5 I/O Port C, TTL input level. A/D Channel 5 input. PC2/AN6 I/O Port C, TTL input level. A/D Channel 6 input. PC3/AN7 I/O Port C, TTL input level. A/D Channel 7 input. PC4~5 I/O Port C, TTL input level. Vdd Power supply Vss Ground This specification is subject to be changed without notice. Please visit our web site for the most updated information. http://www.mdtic.com.tw http://www.mx mcu.com.cn 3/18 2010.6 Ver. 1.1 MDT10F676 8. Memory Map 8.1 Program memory : 0000H Reset Vector 0001H 0002H 0003H 0004H Peripheral interrupt Vector 0005H Program memory 03FFH This specification is subject to be changed without notice. Please visit our web site for the most updated information. http://www.mdtic.com.tw http://www.mx mcu.com.cn 4/18 2010.6 Ver. 1.1 MDT10F676 8.2 Register file map : Address Description Address BANK 0 BANK 1 00 IAR IAR 80 01 RTCC TMR 81 02 PCL PCL 82 03 STATUS STATUS 83 04 MSR MSR 84 05 PORT A CPIO A 85 06 07 86 PORT C CPIO C 08~09 87 88~89 0A PCHLAT PCHLAT 8A 0B INTS INTS 8B 0C PIFB1 PIEB1 8C 0D 8D 0E TMR1L 0F TMR1H 10 T1STA PSTA 8E 8F 11 INOSCR 90 ADINS 91 12~14 92~94 15 PAPHR 95 16 PAINTR 96 17~18 19 97~98 CMSTA VRSTA 99 1A EEDATA 9A 1B EEADR 9B 1C EECON1 9C 1D EECON2 9D 1E ADRESH ADRESL 9E 1F ADS0 ADS1 9F 64 Mapped Genreal in Register Bank0 20~5F 60~7F A0~DF E0~FF Unimplemented memory location. This specification is subject to be changed without notice. Please visit our web site for the most updated information. http://www.mdtic.com.tw http://www.mx mcu.com.cn 5/18 2010.6 Ver. 1.1 MDT10F676 (1). 00H or 80H : IAR ( Indirect Address Register) Use contents of MSR to address data memory (not a physical register) (2). 01H : RTCC (Timer0 Counter). 8-bit real time clock/counter (3). 02H or 82H : PCL (Program Counter Low Byte) Low order 8 bits of the Program Counter (PC) (4). 03H or 83H : STATUS (Status register). Bit Symbol Function 0 C Carry bit 1 HC Half Carry bit 2 Z Zero bit 3 /PF Power loss Flag bit 4 /TF WDT time-out Flag bit 5 page Register page select bit : 0 : 00H --- 7FH 1 : 80H --- FFH 6—7 —— General purpose bit (5). 04H or 84H : MSR (Memory Select Register) Memory Bank Select Register : 0 : 00~7F (Bank0) 1 : 80~FF (Bank1) MSR Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Indirect Addressing Mode (6). 05H : Port A data output register. Port A Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 - - PA5 PA4 PA3 PA2 PA1 PA0 Bit 7-6 : Unimplemented Bit 5-0 : PA5~PA0, I/O Register (7). 06H : Unimplemented Register. This specification is subject to be changed without notice. Please visit our web site for the most updated information. http://www.mdtic.com.tw http://www.mx mcu.com.cn 6/18 2010.6 Ver. 1.1 MDT10F676 (8). 07H : Port C data output register Port C Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 - - PC5 PC4 PC3 PC2 PC1 PC0 (9). 08 ~ 09H : Unimplemented Register. (10). 0AH or 8AH : Program counter high byte. PCHLAT Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 - - - PCH4 PCH3 PCH2 PCH1 PCH0 (11). 0BH or 8BH : Interrupt control register. INTS Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 GIS PEIE TIS INTS PAIE TIF INTF PAIF GIS : Global Interrupt Enable Bit. 0 = Disable all interrupts 1 = Enable all un-masked interrupts PEIE : Peripheral Interrupt Enable Bit. 0 = Disable all peripheral interrupts 1 = Enable all peripheral interrupts TIS : TMR0 Overflow Interrupt Enable Bit. 0 = Disable the Timer0 interrupt 1 = Enable the Timer0 interrupt INTS : PA2/INT Interrupt Enable Bit. 0 = Disable the PA2/INT interrupt 1 = Enable the PA2/INT interrupt PAIE : PA Port Change Interrupt Enable Bit. 0 = Disable the PA port change interrupt 1 = Enable the PA port change interrupt TIF : TMR0 Overflow Interrupt Flag Bit. 0 = Timer0 did not overflowed 1 = Timer0 has overflowed (must be cleared in software) INTF : PA2/INT Interrupt Flag Bit. 0 = The PA2/INT interrupt did not occur 1 = The PA2/INT interrupt occurred PAIF : PA Port Change Interrupt Flag Bit. 0 = None of the PA5~0 pins have changed state 1 = When at least one of the PA5~0 pins changed state (must be cleared in software) (12). 0CH : Peripheral interrupt register. PIFB1 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 EEIF ADIF - - CMIF - - TMR1IF This specification is subject to be changed without notice. Please visit our web site for the most updated information. http://www.mdtic.com.tw http://www.mx mcu.com.cn 7/18 2010.6 Ver. 1.1 MDT10F676 EEIF : EEPROM Write Operation Interrupt Flag Bit. 0 = The EEPROM write operation is not completed or has not been start 1 = The EEPROM write operation completed (must be cleared in software) ADIF : A/D Converter Interrupt Flag Bit. 0 = The A/D conversion is not complete . 1 = The A/D conversion is complete (must be cleared in software) CMIF : Comparator Interrupt Flag Bit. 0 = Comparator input has not changed 1 = Comparator input has changed (must be cleared in software) TMR1IF : TMR1 Overflow Interrupt Flag Bit. 0 = Timer1 register did not overflow 1 = Timer1 register overflowed (must be cleared in software) (13). 0DH : Unimplemented register. (14). 0EH : TMR1L (The timer1 LSB register) The LSB of the 16-bit TMR1. (15). 0FH : TMR1H (The timer1 MSB register) The MSB of the 16-bit TMR1. (16). 10H : Timer1 control register. Bit 7 T1STA - Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 TMR1GE T1CKPS1 T1CKPS1 T1OSCEN /T1SYNC TMR1CLK TMR1ON TMR1GE : Timer1 Gate Enable Bit. If TMR1ON = 0 this bit is ignored If TMR1ON = 1 0 = Timer1 is on 1 = Timer1 is on if /T1G pin is low T1CKPS1 & T1CKPS0: Timer1 Input Clock Prescale Select bits. 0 0 = 1 : 1 Prescale value 0 1 = 1 : 2 Prescale value 1 0 = 1 : 4 Prescale value 1 1 = 1 : 8 Prescale value T1OSCEN : LF Oscillator Enable Bit. If INTOSC without CLKOUT oscillator is active : 0 = LP oscillator is off 1 = LP oscillator is enabled for Timer1 clock /T1SYNC : Timer1 External Clock Input Synchronization Control Bit. If TMR1CLK = 0 this bit is ignored Timer1 use internal clock If TMR1CLK = 1 0 = Synchronize external clock input 1 = Do not synchronize external clock input TMR1CLK : Timer1 Clock Source Select Bit. 0 = Select internal clock Fosc/4 1 = Select External clock from T1CKI pin (on rising edge) This specification is subject to be changed without notice. Please visit our web site for the most updated information. http://www.mdtic.com.tw http://www.mx mcu.com.cn 8/18 2010.6 Ver. 1.1 MDT10F676 TMR1ON : TMR1 On Bit. 0 = Stop Timer1 1 = Enable Timer1 (17). 11 ~ 18H : Unimplemented register. (18). 19H : Comparator control register. Bit 7 CMSTA - Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 - CMOINV CMIS CMP2 CMP1 CMP0 CMOUT CMOUT : Comparator Output Bit. When CMOINV = 0 1 = Vin+ > Vin- ; 0 = Vin+ < VinWhen CMOINV = 1 1 = Vin+< Vin- ; 0 = Vin+ > VinCMOINV: Comparator Output Inversion Bit. 0 = Output not inverted 1 = Output inverted CMIS: Comparator Input Switch Bit. When CMP2 ~ 0 = 110 or 101 : 0 = Vin- connects to CIN1 = Vin- connects to CIN+ CMP2 ~ 0: Comparator Mode Bits. 0 0 0 = Comparator reset (POR default value – low power) 0 0 1 = Comparator with output 0 1 0 = Comparator without output 0 1 1 = Comparator with output and internal reference (Cvref in 99H register) 1 0 0 = Comparator without output and with internal reference (Cvref in 99H register) 1 0 1 = Comparator multiplexed input with internal reference (Cvref in 99H register) and output 1 1 0 = Comparator multiplexed input with internal reference (Cvref in 99H register) 1 1 1 = Comparator off (lowest power) (19). 1A ~ 1DH : Unimplemented register. (20). 1EH : Most A/D result register. A/D result most 8 bits or 2 bits (21). 1FH : A/D control register 0. Bit 7 ADS0 ADFM Bit 6 ADVRS Bit 5 Bit 4 Bit 3 Bit 2 - CHS2 CHS1 CHS0 Bit 1 Bit 0 GO/DONEB ADRUN ADFM : A/D result formed select bit. 0 = Left justified 1 = Right justified ADVRS : A/D voltage referece bit. 0 = Vdd 1 = Vref pin This specification is subject to be changed without notice. Please visit our web site for the most updated information. http://www.mdtic.com.tw http://www.mx mcu.com.cn 9/18 2010.6 Ver. 1.1 MDT10F676 CHS2 ~ 0: Analog channel select bits. 0 0 0 = Channel AN0 (PA0) 0 0 1 = Channel AN1 (PA1) 0 1 0 = Channel AN2 (PA2) 0 1 1 = Channel AN3 (PA4) 1 0 0 = Channel AN4 (PC0) 1 0 1 = Channel AN5 (PC1) 1 1 0 = Channel AN6 (PC2) 1 1 1 = Channel AN7 (PC3) GO/DONE : A/D conversion status bit. 0 = A/D conversion completed/not in progress 1 = A/D conversion cycle in progress. Setting this bit start A/D conversion cycle. This bit is automatically cleared by hardware when A/D has completed. ADRUN : A/D conversion enable bit. 0 = A/D converter is shut-off. 1 = A/D converter operating. (22). 81H : Option control register. Bit 7 TMR /PAPH Bit Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 IES TCS TCE PSC PS2 PS1 PS0 Symbol Function Prescaler Value 2—0 PS2—0 3 PSC 4 TCE 5 TCS 6 IES 7 /PAPH TMR0 rate 0 0 0 1:2 0 0 1 1:4 0 1 0 1:8 0 1 1 1 : 16 1 0 0 1 : 32 1 0 1 1 : 64 1 1 0 1 : 128 1 1 1 1 : 256 Prescaler assignment bit : 0 — TMR0 1 — Watchdog Timer TMR0 signal Edge : 0 — Increment on low-to-high transition on PA2 pin 1 — Increment on high-to-low transition on PA2 pin TMR0 signal set : 0 — Internal instruction cycle clock 1 — Transition on PA2/INT pin PA2 interrupt edge select bit : 0 — Interrupt on falling edge of PA2/INT pin 1 — Interrupt on rising edge of PA2/INT pin Port A Pull-up Enable Bit : 0 — PA0~2 & PA4~5 pull-up all enable 1 — PA0~2 & PA4~5 pull-up all disable WDT rate 1:1 1:2 1:4 1:8 1 : 16 1 : 32 1 : 64 1 : 128 This specification is subject to be changed without notice. Please visit our web site for the most updated information. http://www.mdtic.com.tw http://www.mx mcu.com.cn 10/18 2010.6 Ver. 1.1 MDT10F676 (23). 85H : Port A input/output control register. Bit 7 CPIO A - Bit 6 - Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 CPIO PA5 CPIO PA4 CPIO PA3 CPIO PA2 CPIO PA1 CPIO PA0 (24). 86H : Unimplemented register. (25). 87H : Port A input/output control register. Bit 7 CPIO C - Bit 6 - Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 CPIO PC5 CPIO PC4 CPIO PC3 CPIO PC2 CPIO PC1 CPIO PC0 (26). 88 ~ 89H : Unimplemented register. (27). 8CH : Peripheral interrupt enable register. PIEB1 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 EEIE ADIE - - CMIE - - TMR1IE EEIE : EEPROM Write Operation Interrupt Enable Bit. 0 = Disable the EEPROM write complete interrupt 1 = Enable the EEPROM write complete interrupt ADIE : A/D Converter Interrupt Enable Bit. 0 = Disable A/D converter interrupt 1 = Enable A/D converter interrupt CMIE : Comparator Interrupt Enable Bit. 0 = Disable the comparator interrupt 1 = Enable the comparator interrupt TMR1IE : TMR1 Overflow Interrupt Enable Bit. 0 = Disable the TMR1 overflow interrupt 1 = Enable the TMR1 overflow interrupt (28). 8DH : Unimplemented register. (29). 8EH : Power control register. PSTA Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 - - - - - - PORB PEDHB PEDHB : Power Detect High Level Status Bit. 0 = A PED high level reset occurred (must be set in software after a power on reset occurs) 1 = No PED high level reset occurred PORB : Power On Reset Status Bit. 0 = A power on reset occurred (must be set in software after a power on reset occurs) 1 = No power on reset occurred This specification is subject to be changed without notice. Please visit our web site for the most updated information. http://www.mdtic.com.tw http://www.mx mcu.com.cn 11/18 2010.6 Ver. 1.1 MDT10F676 (30). 8FH : Unimplemented register. (31). 90H : MCU oscillator control register. INOSCR Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 REG OPRLC OPRC EN8M ECKIN OSO2E OSC2O /OSCIN Bit 7 : Normal register bits. OPRLC : OP RC Mode Lower Work Current Enable Bit. 0 = Disable 1 = Enable OPRC : OP RC Mode Enable Bit. 0 = Disable 1 = Enable EN8M : Internal 4MHz Oscillator Clock Double Enable Bit. 0 = System clock input is internal RC 4MHz 1 = System clock input is 8MHz ( internal RC 4MHz frequency double ) ECKIN : External Clock Input Enable Bit. 0 = Disable oscillator external clock input 1 = Enable oscillator external clock input (must be set in external oscillator of RC mode ) OSO2E : Both of Internal and external oscillator Enable Bit. 0 = Only use internal oscillator or external oscillator 1 = Internal and external (LF mode only) oscillator enable both OSC2O : OSC2/PA4 Oscillator Clock Output Enable Bit. 0 = Disable OSC2/PA4 oscillator clock output in internal or external of RC mode oscillator 1 = Enable OSC2/PA4 oscillator clock output in internal or external of RC mode oscillator OSCIN : MCU Internal Or external oscillator Select Bit. 0 = Default the MCU clock based on internal 4MHz oscillator 1 = The MCU clock based on external oscillator (type from option select), When internal 4MHz oscillator change to external oscillator must wait OST time 20ms. (32). 91H : Unimplemented register. ADINS Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 ANS7 ANS6 ANS5 ANS4 ANS3 ANS2 ANS1 ANS0 ANS7~0 : Analog select analog or digital function on pins AN7~0. 0 = Digital I/O 1 = Analog input (33). 92 ~ 94H : Unimplemented register. (34). 95H : Port A pull_hi control register. Bit 7 PAPHR - Bit 6 - Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 PAH5 PHA4 - PHA2 PHA1 PHA0 This specification is subject to be changed without notice. Please visit our web site for the most updated information. http://www.mdtic.com.tw http://www.mx mcu.com.cn 12/18 2010.6 Ver. 1.1 MDT10F676 Bit 5-4 & Bit 2-0 : Port A Pull_hi Control Bits 0 = Pull_hi disable 1 = Pull_hi enable (35). 96H : Port A interrupt-on-change control register. Bit 7 PAINTR - Bit 6 - Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 PINTA5 PINTA4 PINTA3 PINTA2 PINTA1 PINTA0 Bit 5-0 : Port A Interrupt-On-Change Control Bits 0 = Interrupt-on-change disable 1 = Interrupt-on-change enable (36). 97 ~ 98H : Unimplemented register. (37). 99H : Voltage reference control register. Bit 7 VRSTA CVREN Bit 6 - Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 CVRRS - CVR3 CVR2 CVR1 CVR0 Bit 7 : Comparator Voltage Reference Enable Bit 0 = Comparator voltage reference disable 1 = Comparator voltage reference enable Bit 5 : Comparator Voltage Reference Range Select Bit 0 = High range ; CVref = Vdd/4 + (CVR3:CVR0/32)*Vdd 1 = Low range ; CVref = (CVR3:CVR0/24)*Vdd Bit 3-0 : Comparator Voltage Reference Value Selection When CVRRS = 0, CVref = Vdd/4 + (CVR3:CVR0/32)*Vdd When CVRRS = 1, CVref = (CVR3:CVR0/24)*Vdd (38). 9AH : EEPROM data register. EEDATA Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 EED7 EED6 EED5 EED4 EED3 EED2 EED1 EED0 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 EEAD5 EEAD4 EEAD3 EEAD2 EEAD1 EEAD0 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 - - WRERR WREN WR RD (39). 9BH : EEPROM address register. Bit 7 EEADR - Bit 6 EEAD6 (40). 9CH : EEPROM control register 1. Bit 7 EECON1 - Bit 6 - Bit 7~4 is unimplemented : Read as “0” This specification is subject to be changed without notice. Please visit our web site for the most updated information. http://www.mdtic.com.tw http://www.mx mcu.com.cn 13/18 2010.6 Ver. 1.1 MDT10F676 WRERR : EEPROM Write Error Flag Bit. 0 = The EEPROM write operation completed 1 = The EEPROM write operation is prematurely terminated (any MCLR reset or any WDT reset during normal operation) WREN : EEPROM Write Enable Bit. 0 = Inhibits write to the data EEPROM 1 = Allows write cycles WR : Write Control Bit. 0 = Write cycle to the data EEPROM is complete 1 = Initiates a write cycle. (The bit is cleared by hardware once write is complete. The WR bit can only be set (not clear) in software.) RD : Read Control Bit. 0 = Does not initiate an EEPROM read. 1 = Initiates an EEPROM read (read takes once cycle. RD is cleared in hardwave. The RD bit can only be set (not clear) in software.) (41). 9DH : EEPROM control register 2. Bit 7 EECON2 - Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 - - - - - - - Write only ; Read as “0” When write data to the EEPROM must write 55/H to EECON2, and writ AA/H to EECON2 then set WR bit; the EEPROM can write data inside for write each byte. Example : Data EEPROM Write BSR BCR BSR LDWI STWR LDWI STWR BSR STATUS, PAGE INTS, GIS EECON1, WREN 55H EECON2 0AAH EECON2 EECON1, WR ; Select bank1 ; Disable interrupt ; Enable write ; Write 55/H ; Write AA/H ; Begin write (42). 9EH : Least A/D result register. A/D result least 8 bits or 2 bits (43). 9FH : A/D control register 1. Bit 7 ADS1 - Bit 6 ASCS2 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 ASCS1 ASCS0 - - - - ASCS2 ~ 0 : A/D conversion clock select bits. 0 0 0 = Fosc/2 0 0 1 = Fosc/8 0 1 0 = Fosc/32 X 1 1 = Select by external oscillator mode RC & LF = Fosc/2; XT = Fosc/8; HF = Fosc/32 1 0 0 = Fosc/4 1 0 1 = Fosc/16 This specification is subject to be changed without notice. Please visit our web site for the most updated information. http://www.mdtic.com.tw http://www.mx mcu.com.cn 14/18 2010.6 Ver. 1.1 MDT10F676 1 1 0 = Fosc/64 ASCS2,0 TAD Oscillator Minimum Oscillator Maximum frequency TAD frequency TAD Type Remark 000 Fosc / 2 1M Hz 2us 200K Hz 10us LF,RC 001 Fosc / 8 4M Hz 2us 1M Hz 8us XT 010 Fosc /32 20M Hz 1.6us 4M Hz 8us HF 100 Fosc / 4 2M Hz 2us 250K Hz 8us LF,RC 101 Fosc /16 8M Hz 2us 2M Hz 8us XT 110 Fosc /64 20M Hz 3.2us 8M Hz 8us HF X11 RC:Fosc / 2 1M Hz 2us 200K Hz 10us RC LF:Fosc / 2 1M Hz 2us 200K Hz 10us LF XT:Fosc / 8 4M Hz 2us 1M Hz 8us XT HF:Fosc/32 20M Hz 1.6us 4M Hz 8us HF The A/D conversion clock (1/TAD) must be select to ensure a TAD between minimum 1.6us and maximum 8us This specification is subject to be changed without notice. Please visit our web site for the most updated information. http://www.mx mcu.com.cn http://www.mdtic.com.tw 15/18 2010.6 Ver. 1.1 MDT10F676 9. Reset Condition for all Registers Register Address Power-On Reset, /MCLR or WDT Reset Wake-up from SLEEP Power range detector Reset IAR 00h(80h) 0000 0000 0000 0000 uuuu uuuu RTCC 01h xxxx xxxx uuuu uuuu uuuu uuuu PCL 02h(82h) 0000 0000 0000 0000 0000 0100 STATUS 03h(83h) 0001 1xxx 000# #uuu 000# #uuu MSR 04h(84h) xxxx xxxx uuuu uuuu uuuu uuuu PORT A 05h --xx xxxx --uu uuuu --uu uuuu PORT C 07h xxxx xxxx uuuu uuuu uuuu uuuu PCHLAT 0Ah(8Ah) ---0 0000 ---0 0000 ---u uuuu INTS 0Bh(8Bh) 0000 0000 0000 0000 uuuu uuuu PIFB1 0Ch 00-- 0--0 00-- 0--0 uu-- u--u TMR1L 0Eh xxxx xxxx uuuu uuuu uuuu uuuu TMR1H 0Fh xxxx xxxx uuuu uuuu uuuu uuuu T1STA 10h -000 0000 -000 0000 -uuu uuuu CMSTA 19h -0-0 0000 -0-0 0000 -u-u uuuu ADRESH 1Eh xxxx xxxx uuuu uuuu uuuu uuuu ADS0 1Fh 00-0 0000 00-0 0000 uu-u uuuu TMR 81h 1111 1111 1111 1111 uuuu uuuu CPIO A 85h --11 1111 --11 1111 --uu uuuu CPIO C 87h 1111 1111 1111 1111 uuuu uuuu PIEB1 8Ch 00-- 0--0 00-- 0--0 uu-- u--u PSTA 8Eh ---- --## ---- --uu ---- --uu INOSCR 90h -000 0000 -000 0000 -uuu uuuu ADINS 91h 1111 1111 1111 1111 uuuu uuuu PAPHR 95h --11 -111 --11 -111 --uu -uuu PAINTR 96h --00 0000 --00 0000 --uu uuuu VRSTA 99h 0-0- 0000 0-0- 0000 u-u- uuuu EEDATA 9Ah 0000 0000 0000 0000 uuuu uuuu EEADR 9Bh -000 0000 -000 0000 -uuu uuuu EECON1 9Ch ---- x000 ---- #000 ---- #uuu EECON2 9Dh ---- ---- ---- ---- ---- ---- ADRESL 9Eh xxxx xxxx uuuu uuuu uuuu uuuu ADS1 9Fh -000 ---- -000 ---- -uuu ---- Note : “ x “=unknown; “ u “=unchanged; “ – “=unimplemented, read as “0”; “# “=value depends on condition This specification is subject to be changed without notice. Please visit our web site for the most updated information. http://www.mx http://www.mdtic.com.tw mcu.com.cn 16/18 2010.6 Ver. 1.1 MDT10F676 10. Instruction Set Instruction Code Mnemonic Function Operation Status Operands 010000 00000000 NOP No operation None 010000 00000001 CLRWT Clear Watchdog timer 0→WT /TF, /PF 010000 00000010 SLEEP Sleep mode 0→WT, stop OSC /TF, /PF 010000 00000011 TMODE Load W to TMODE register W→TMODE None 010000 00000rrr CPIO R Control I/O port register W→CPIO r None 010001 1rrrrrrr STWR R Store W to register W→R None 011000 trrrrrrr LDR R, t Load register R→t Z 111010 iiiiiiii LDWI I Load immediate to W I→W None 010111 trrrrrrr SWAPR R, t Swap halves register [R(0~3) R(4~7)]→t None 011001 trrrrrrr INCR R, t Increment register R + 1→t Z 011010 trrrrrrr INCRSZ R, t Increment register, skip if zero R + 1→t None 011011 trrrrrrr ADDWR R, t Add W and register W + R→t C, HC, Z 011100 trrrrrrr SUBWR R, t Subtract W from register R ﹣W→t C, HC, Z (R+/W+1→t) 011101 trrrrrrr DECR R, t Decrement register R ﹣1→t Z 011110 trrrrrrr DECRSZ R, t Decrement register, skip if zero R ﹣1→t None 010010 trrrrrrr ANDWR R, t AND W and register R ∩ W→t Z 110100 iiiiiiii ANDWI I AND W and immediate I ∩ W→W Z 010011 trrrrrrr IORWR R, t Inclu. OR W and register R ∪ W→t Z 110101 iiiiiiii IORWI I Inclu. OR W and immediate I ∪ W→W Z 010100 trrrrrrr XORWR R, t Exclu. OR W and register R ♁ W→t Z 110110 iiiiiiii XORWI I Exclu. OR W and immediate I ♁ W→W Z 011111 trrrrrrr COMR R, t Complement register /R→t Z 010110 trrrrrrr RRR Rotate right register R(n) →R(n-1), C R, t C→R(7), R(0)→C 010101 trrrrrrr RLR R, t Rotate left register R(n)→r(n+1), C C→R(0), R(7)→C 010000 1xxxxxxx CLRW 010001 0rrrrrrr CLRR 0000bb brrrrrrr BCR R R, b Clear working register 0→W Z Clear register 0→R Z Bit clear 0→R(b) None This specification is subject to be changed without notice. Please visit our web site for the most updated information. http://www.mdtic.com.tw http://www.mx mcu.com.cn 17/18 2010.6 Ver. 1.1 MDT10F676 Mnemonic Instruction Code Function Operation Status Operands 0010bb brrrrrrr BSR 0001bb brrrrrrr R, b Bit set 1→R(b) None BTSC R, b Bit Test, skip if clear Skip if R(b)=0 None 0011bb brrrrrrr BTSS R, b Bit Test, skip if set Skip if R(b)=1 None 100nnn nnnnnnnn LCALL N Long CALL subroutine N→PC, None PC+1→Stack 101nnn nnnnnnnn LJUMP N Long JUMP to address N→PC None 110001 iiiiiiii RTIW I Return, place immediate to W Stack→PC, I→W None 110111 iiiiiiii ADDWI I Add immediate to W PC+1→PC, C,HC,Z W+I→W 111000 iiiiiiii SUBWI I Subtract W from immediate I-W→W 010000 00001001 RTFI Return from interrupt Stack→PC, C,HC,Z None 1→GIS 010000 00000100 RET Return from subroutine Stack→PC None Note : W : Working register b : Bit position WT : Watchdog timer t : Target TMODE : TMODE mode register 0 : Working register CPIO : Control I/O port register 1 : General register /TF : Timer overflow flag R : General register address /PF : Power loss flag C : Carry flag PC : Program Counter HC : OSC : Oscillator Z : Zero flag Inclu. : Inclusive ‘∪’ / : Complement Exclu. : Exclusive ‘♁’ x : Don’t care AND : Logic AND ‘∩’ I : Immediate data ( 8 bits ) N : Immediate address Half carry This specification is subject to be changed without notice. Please visit our web site for the most updated information. http://www.mdtic.com.tw http://www.mx mcu.com.cn 18/18 2010.6 Ver. 1.1