Page 2
Hynix 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, Hynix 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.
The HMS81004E/08E/16E/24E/32E is an advanced CMOS 8-bit microcontroller with 4/8/16/24/32K bytes of ROM. The device is one of GMS800 family. The HYNIX HMS81004E/08E/16E/24E/32E is a powerful microcontroller which provides a highly flexible and cost effective solution to many UR applications.The HMS81004E/08E/16E/24E/32E provides the fol- lowing standard features: 4/8/16/24/32K bytes of ROM, 448 bytes of RAM, 8-bit timer/counter, on-chip oscillator and clock circuitry.
HMS81032E/HMS81032TL 1.3 Development Tools The HMS81004E/08E/16E/24E/32E are supported by a full-fea- - MS- Window base assembler tured macro assembler, an in-circuit emulator CHOICE-Dr. Software - Linker / Editor / Debugger and OTP programmers. Macro assembler operates under the MS- Windows 95/98 /NT4/W2000.
HMS81032E/HMS81032TL 5. PIN FUNCTION : Supply voltage. used as outputs or inputs. : Circuit ground. In addition, R1 serves the functions of the various follow- ing special features. TEST: Used for shipping inspection of the IC. For normal operation, it should be connected to V Port pin Alternate function RESET: Reset the MCU.
Page 13
HMS8132E/HMS81032TL INPUT/ PIN NAME Function @RESET @STOP OUTPUT - Each bit of the port can be individually configured as an input or an output by user software - Push-pull output State of - CMOS input with pull-up resister (option) INPUT before - Can be programmable as key scan input Stop...
HMS81032E/HMS81032TL 6. PORT STRUCTURES R0[0:7] R11/INT1, R12/INT2, R14/EC OTP: connected MASK: option (default connected) OTP: connected Circuit MASK: option (default connected) Pull up Circuit Pull-up Tr. Reg. Pull up Pull-up Tr. Open Drain Reg. Reg. Open Drain Reg. Data Reg. Data Reg.
Page 15
HMS8132E/HMS81032TL R15/T2, R16/T1, R17/T0 TEST OTP: connected MASK: option (default connected) Circuit Noise Pull up Pull-up Tr. Filter Reg. Open Drain Reg. REMOUT Data Reg. Function Sele- ction Reg. Internal Signal Dir R eg. XIN, XOUT to R15...T2 to R16...T1 to R17...T0 Key Scan Input...
HMS81032E/HMS81032TL 7. ELECTRICAL CHARACTERISTICS 7.1 Absolute Maximum Ratings Supply voltage ........... -0.3 to +4.1 V Note: Stresses above those listed under “Absolute Maxi- Input Voltage ........-0.3 to V +0.3 V mum Ratings” may cause permanent damage to the de- vice. This is a stress rating only and functional operation of Output Voltage ........-0.3 to V +0.3 V the device at any other conditions above those indicated in...
HMS81032E/HMS81032TL 8. MEMORY ORGANIZATION The HMS81004E/08E/16E/24E/32E has separate address 32K bytes of Program memory. Data memory can be read spaces for Program memory and Data Memory. Program and written to up to 448 bytes including the stack area. memory can only be read, not written to. It can be up to 8.1 Registers...
Page 21
HMS8132E/HMS81032TL Caution: Stack Address (100 ~ 1FF The Stack Pointer must be initialized by software be- cause its value is undefined after RESET. Example: To initialize the SP #0FFH Hardware fixed ; SP ← FF TXSP At execution of At acceptance At execution At execution a CALL/TCALL/PCALL...
Page 22
HMS81032E/HMS81032TL [Zero flag Z] This flag is set when the result of an arithmetic operation or data transfer is "0" and is cleared by any other result. RESET VALUE: 00 CARRY FLAG RECEIVES NEGATIVE FLAG CARRY OUT OVERFLOW FLAG ZERO FLAG SELECT DIRECT PAGE INTERRUPT ENABLE FLAG when g=1, page is addressed by RPR...
HMS8132E/HMS81032TL 8.2 Program Memory A 16-bit program counter is capable of addressing up to Example: Usage of TCALL 64K bytes, but this device has 4/8/16/24/32K bytes pro- gram memory space only physically implemented. Ac- ;1BYTE INSTR UCTIO N TCALL 0FH cessing a location above FFFF will cause a wrap-around ;INSTEAD OF 2 BYTES...
User Memory return instruction [RETI] restores the contents of the pro- The HMS81004E/08E/16E/24E/32E has 448 × 8 bits for gram counter and flags. the user memory (RAM). The save/restore locations in the stack are determined by Control Registers the stack pointed (SP).
HMS8132E/HMS81032TL 8.4 List for Control Registers Read Address Function Register Symbol RESET Value Write 00C0h PORT R0 DATA REG. undefined 00C1h PORT R0 DATA DIRECTION REG. R0DD 00000000b 00C2h PORT R1 DATA REG. undefined 00C3h PORT R1 DATA DIRECTION REG. R1DD 00000000b 00C4h...
HMS8132E/HMS81032TL 8.5 Addressing Mode The HMS81004E/08E/16E/24E/32E uses six addressing E45535 35H,#55H modes; • Register addressing • Immediate addressing data ← 55H data 0C35 • Direct page addressing • Absolute addressing • Indexed addressing 0F100 0F101 • Register-indirect addressing 0F102 (1) Register Addressing Register addressing accesses the A, X, Y, C and PSW.
Page 30
HMS81032E/HMS81032TL 0735F0 !0F035H ;A←ROM[0F035H] ;ACC←RAM[X]. data 0F035 data data → A A+data+C → A 0F100 0E550 0F101 address: 0F035 0F102 X indexed direct page, auto increment→ → → → {X}+ The operation within data memory (RAM) In this mode, a address is specified within direct page by ASL, BIT, DEC, INC, LSR, ROL, ROR the X register and the content of X is increased by 1.
Page 31
HMS8132E/HMS81032TL JMP, CALL C645 45H+X Example; G=0 3F35 [35H] data data → A 0E550 0E551 45H+0F5H=13AH jump to address 0E30A 0E30A NEXT Y indexed direct page (8 bit offset) → → → → dp+Y 0FA00 This address value is the second byte (Operand) of com- mand plus the data of Y-register, which assigns Memory in Direct page.
Page 32
HMS81032E/HMS81032TL Y indexed indirect → → → → [dp]+Y Absolute indirect → → → → [!abs] Processes memory data as Data, assigned by the data The program jumps to address specified by 16-bit absolute [dp+1][dp] of 16-bit pair memory paired by Operand in Di- address.
HMS8132E/HMS81032TL 9. I/O PORTS (1) R0 I/O Data Direction Register (R0DD) The HMS81004E/08E/16E/24E/32E has 24 I/O ports which are PORT0(8 I/O), PORT1 (8 I/O), PORT2 (8 I/O). R0 I/O Data Direction Register (R0DD) is 8-bit register, Pull-up resistor of each port can be selectable by program.
Page 34
HMS81032E/HMS81032TL and can assign R1 port as open drain output port each bit, if corresponding port is selected as output. If R1ODC is se- ADDRESS: 0C2 R1 Data Register (R/W) lected as “1”, port R1 is open drain output, and if selected RESET VALUE: Undefined as “0”, it is push-pull output.
HMS8132E/HMS81032TL pull-up is automatically disabled, if corresponding port is (1) R2 I/O Data Direction Register (R2DD) selected as output. R2 I/O Data Direction Register (R2DD) is 8-bit register, and can assign input state or output state to each bit. If R2DD is “1”, port R2 is in the output state, and if “0”, it is in the input state.
HMS81032E/HMS81032TL 10. CLOCK GENERATOR Clock generating circuit consists of Clock Pulse Generator state. (C.P.G), Prescaler, Basic Interval Timer (B.I.T) and Watch Dog Timer. The clock applied to the Xin pin divided by ADDRESS: 0C7 Clock Control Register (W) INITIAL VALUE: --110111b two is used as the internal system clock.
HMS8132E/HMS81032TL 10.1 Oscillation Circuit Oscillation circuit is designed to be used either with a ce- Oscillation circuit is designed to be used either with a ce- ramic resonator or crystal oscillator. Figure 10-2 shows ramic resonator or crystal oscillator. Since each crystal and circuit diagrams using a crystal (or ceramic) oscillator.
HMS8132E/HMS81032TL 11. BASIC INTERVAL TIMER The HMS81004E/08E/16E/24E/32E has one 8-bit Basic The Basic Interval Timer is controlled by the clock control Interval Timer that is free-run and can not stop. Block dia- register (CKCTLR) shown in Figure 11-2. If bit3(BTCL) gram is shown in Figure 11-1.
Page 40
HMS81032E/HMS81032TL ADDRESS: 0C7 CKCTLR BTCL BTS2 BTS1 BTS0 WDTON ENPCK BTCL INITAIL VALUE: --110111 Basic Interval Timer source clock select ÷ 000: f ÷ 001: f ÷ 010: f ÷ 011: f ÷ 100: f ÷ 101: f ÷ 110: f Caution: ÷...
HMS8132E/HMS81032TL 12. WATCH DOG TIMER Watch Dog Timer (WDT) consists of 6-bit binary counter, As IFBIT (Basic Interval Timer Interrupt Request) is used 6-bit comparator, and Watch Dog Timer Register for input clock of WDT, Input clock cycle is possible from (WDTR).Watch Dog Timer can be used 6-bit general Tim- 512 us to 65,536 us by BTS.
HMS81032E/HMS81032TL 13. Timer0, Timer1, Timer2 (1) Timer Operation Mode Register (T1LD), Timer2 Data Register (T2DR). Any of the PS0 ~ PS5, PS11 and external event input EC can be Timer consists of 16bit binary counter Timer0 (T0), 8bit selected as clock source for T0. Any of the PS0 ~ PS3, PS7 binary Timer1 (T1), Timer2 (T2), Timer Data Register, ~ PS10 can be selected as clock T1.
Page 43
HMS8132E/HMS81032TL T0HMD T0HLD T0LMD T0LLD T1HD T1LD T2DR from EC/R14 Timer0 (16bit) Timer2(8bit) Timer1(8bit) TM01 T0IN IT T1INIT TO U TS TO UTB T0O UTP BTC L TO UT1 TO UT0 Edge Polarity Tout Selection Selection Logic from INT2/R12 (Capture Signal) T2OUT T0OUT TOUT...
Page 44
HMS81032E/HMS81032TL IEDS[5:4] INT2 INT2/R12 PIN IFINT2 INTERRUPT 16 BITS T0HC T0LC [0D5 ][0D6 capture T0ST CAP0 T0IFS T 0 S L [2 :0 ] E d g e D e te cto r delay EC PIN 1 1 1 Interrupt CAP0 clear IFT0...
Page 45
HMS8132E/HMS81032TL T1ST T1IFS T1 COUNT REG. T 1S L [2 :0 ] [0D8 P S 1 0 Interrupt 1 11 IFT1 P S 9 GEN. 1 10 clear P S 8 1 01 T1 COUNTER (8-bit) P S 7 1 00 P S 3 0 11 OUTPUT...
Page 46
HMS81032E/HMS81032TL T2ST T2 COUNT REG. T 2S L [2 :0 ] [0D9 P S 1 2 Interrupt 1 11 IFT2 P S 1 1 GEN. 1 10 clear P S 1 0 1 01 T2 COUNTER (8-bit) P S 9 1 00 P S 8 0 11...
Page 47
HMS8132E/HMS81032TL 2) Timer0, Timer1 TIMER0 and TIMER1 have an up-counter. When value of (TDR), the up-counter is cleared to “00h”, and interrupt the up-counter reaches the content of Timer Data Register (IFT0, IFT1) is occurred at the next clock. T0 Data MATCH Register (TDR = T0)
Page 49
HMS8132E/HMS81032TL 3) Single/Modulo-N Mode Timer0 (Timer1) can select initial (T0INIT, T1INIT of should be set “0”. Counter counts up until the value of Data TM01) output level of Timer Output port. If initial level is Register and occurs Time-out interrupt. The level of Timer “L”, Low-Data Register value of Timer Data Register is Output port toggle and repeats process of transferred to comparator and T0OUT (T1OUT) is to be...
- Nested interrupt control is possible uration of interrupt circuit is shown in Figure 14-1. - Programmable interrupt mode The HMS81004E/08E/16E/24E/32E contains 8 interrupt (Hardware and software interrupt accept mode) sources; 3 externals and 5 internals. Nested interrupt ser- - Read and write of interrupt request flag are possible.
HMS8132E/HMS81032TL 14.1 Interrupt priority and sources Each interrupt vector is independent and has its own pri- source classification is shown in Table 14-1. ority. Software interrupt (BRK) is also available. Interrupt 14.2 Interrupt control register I flag of PSW is a interrupt mask enable flag. When I flag during interrupt cycle process.
HMS8132E/HMS81032TL Interrupt mode register ADDRESS: 0CA IMOD IM 1 IM 0 BTCL IP 3 IP 2 INITIAL VALUE: --000000 Priority Selection interrupt 00: Fixed by hardware 0001: KSCNR 01: Changeable by IP3~IP0 0010: INT1R 1x: Interrupt is inhibited 0011: INT2R 0101: T0R 0110: T1R 0111: T2R...
Page 54
HMS81032E/HMS81032TL System clock Instruction Fetch SP-2 V.L. V.H. New PC SP-1 Address Bus Not used V.L. OP code Data Bus Internal Read Internal Write Interrupt Processing Step Interrupt Service Task V.L. and V.H. are vector addresses. ADL and ADH are start addresses of interrupt service routine as vector contents. Figure 14-4 Timing chart of Interrupt Acceptance and Interrupt Return Instruction the program status word are automatically saved on the stack, but accumulator and other registers are not saved itself.
HMS8132E/HMS81032TL However, multiple processing through software for special fea- tures is possible. Generally when an interrupt is accepted, the I- flag is cleared to disable any further interrupt. But as user sets I- main task flag in interrupt routine, some further interrupt can be serviced acceptance of interrupt interrupt...
Page 57
HMS8132E/HMS81032TL Standby release level control register (SRLC) can select (SRLC) is write-only register and initialized as “00h” in re- the key scan input level “L” or “H” for standby release by set state. each bit pin (R0, R1). Standby release level control register SMRR0 SRLC0 R 0 0...
HMS81032E/HMS81032TL 15. STANDBY FUNCTION 15.1 Sleep Mode SLEEP mode can be entered by setting the bit of SLEEP mode register (SLPM). In the mode, CPU clock stops but oscillator keeps running. B.I.T and a part of peripheral ADDRESS: 0F0 Sleep Mode Control Register (W) INITIAL VALUE: -------0b hardware execute, but prescaler output which provide SLPM...
HMS8132E/HMS81032TL Clock Pulse CPU Clock Generator Circuit Basic Interval Timer Prescaler Clear Clear Control Signal STOP Overflow Detection Release Signal from Interrupt RESETB Figure 15-1 Block Diagram of Standby Circuit 15.3 Standby mode release Release of STANDBY mode is executed by RESET input and Interrupt signal.
Page 60
HMS81032E/HMS81032TL Release Factor Release Method RESETB By RESETB Pin=Low level, Standby mode is released and system is initialized Standby mode is released by low input of selected pin by key scan Input(SMRR0,SMRR1). KSCN(Key Input) In case of interrupt mask enable flag= “0”, program executes just after standby instruction, if flag= “1”...
HMS8132E/HMS81032TL 15.4 Operation of standby mode release After standby mode is released, the operation begins ac- standby mode start (Figure 15-3). cording to content of related interrupt register just before STOP Command Standby Mode Interrupt Request GEN. Int. enable reg. Standby Mode Release I Flag Standby Next Command...
Page 62
HMS81032E/HMS81032TL Internal circuit SLEEP mode STOP mode Oscillator Active Stop Internal CPU Stop Stop Register Retained Retained Retained Retained I/O port Retained Retained Prescaler Active Stop PS10 selected:Active Basic Interval Timer Stop Others: Stop Watch-dog Timer Stop Stop Timer Stop Stop Address Bus,Data Bus Retained...
HMS8132E/HMS81032TL 16. RESET FUNCTION 16.1 External RESET The RESET pin should be held at low for at least 2machine stable system initialization. The RESET pin contains a cycles with the power supply voltage within the operating Schmitt trigger with an internal pull-up resistor. voltage range and must be connected 0.1uF capacitor for RESET 0.1uF capacitor...
Page 64
HMS81032E/HMS81032TL Internal Reset RESET Noise Filter 0.1uF Power on Detect Pulse Generator Clear Clear Clear B.I.T. Basic PS10 Overflow Interval Prescaler Circuit Detection Timer Circuit Figure 16-2 Block Diagram of Power On Reset Circuit Note: When Power On Reset, oscillator stabilization time doesn`t include OSC.
HMS8132E/HMS81032TL Oscillator pin) RESET ADDRESS FFFE FFFF Start DATA MAIN PROGRAM RESET Process Step Stabilization Time ADL and ADH are start addresses of interrupt service routine as vector contents. Figure 16-4 Timing Diagram of Reset 16.3 Low voltage detection mode (1) Low voltage detection condition all port can be selected with Pull-up resistor by Mask op- tion.
Page 66
HMS81032E/HMS81032TL (4) SRAM BACK-UP after Low Voltage Detection. about hours depend on Vdd-GND Capacitor SRAM Data Backup Low Voltage detection point 2V(Min.) 1.7V(typ.20 °C) Power on Reset (SRAM retention) 0.7V(Vret) Power on Reset (SRAM unstable) Time User replaces User removes batteries batteries Figure 16-6 Oscillator stabilizing diagram...
Page 67
HMS8132E/HMS81032TL (5) S/W flow chart example after Reset using SRAM Back-up RESET Stack Pointer initialize Check the SRAM value (RAM Pattern, Checksum) SRAM DATA VALID? Clear all Ram area Use Saved SRAM value Main routine Figure 16-7 S/W flow chart example after Reset using SRAM Back-up Nov.
HMS8132E/HMS81032TL 17.4 PROM Mode Pin Description Standard EPROM Input 28Pin Mode Mode Output Function Number Pin Name Pin Name Type No Connection No Connection Input Address Low Input Enable Input Address High Input Enable Power Positive Power Supply XOUT Power Power Ground A0/A8/D0...
HMS81032E/HMS81032TL 17.5 EPROM Mode Mode setting during power up Mode setting PROM Write & Verify 11.5V PROM Verify or Read 11.5V LOCK Bit Write 11.5V LOCK Bit Read 11.5V ROM Size Write 11.5V ROM Size Read 11.5V Mode setting after power up Mode setting Remark Address High Latch...
Page 73
HMS8132E/HMS81032TL Programming DC charateristics Items Symbol Min. Typ. Max. Unit Test condition Input high voltage VDD+0.3 Input low voltage -0.1 Output high voltage IOH=-2.5mA Output low voltage IOL=1mA VDD current VPP current W E=VIL VDD voltage VPP voltage 11.2 11.5 11.8 VSS voltage GROUND Level...
Page 74
HMS81032E/HMS81032TL Verify or Read DC characteristics (Vdd=5.0V±0.5V, Vpp=11.5V±0.3V, Vss=0V, Ta=25±5 °C) Items Symbol Min. Typ. Max. Unit Test condition VDD Active current IDD1 VE=VIL Input high voltage VDD-0.2 VDD+0.2 Input low voltage -0.2 Output high voltage 0.7VDD IOH=-2.5mA Output low voltage IOL=1mA Verify or Read AC characteristics (Vdd=5.0V±0.5V, Vpp=11.5V±0.3V, Vss=0V, Ta=25±5 °C)
HMS8132E/HMS81032TL 17.6 Timing Diagram in EPROM Mode EPROM Write & Verify (VDD) Min. 50ms 11.5V (TESTB) (RESETB) (REMOUT) Min. Min. Latch Timing 10us (R10) Latch Timing (R11) (R16) (R17) (R20) DOUT [7:0] Mode setting 1Byte PGM Verify Repeat area 1. R0[7:0] address input is latched when AH(R10), AL(R11) is rising. 2.
Page 76
HMS81032E/HMS81032TL EPROM Verify or Read (VDD) Min. 50ms 11.5V (TESTB) (RESETB) (REMOUT) Min. Min. Latch Timing 10us (R10) Latch Timing (R11) (R16) (R17) (R20) DOUT [7:0] Mode setting Verify AH : High Byte Address Input AL : Low Byte Address Input DIN : Data Input DOUT : Data Output Nov.
Page 77
HMS8132E/HMS81032TL Lock Bit Write (VDD) Min. 50ms 11.5V (TESTB) (RESETB) (REMOUT) Min. Min. Latch Timing 10us (R10) (R11) (R16) (R17) (R20) DIN ( 06XH ) [7:0] Mode setting 1. DIN = 06XH : LOCK bit Write Data. ( X means “don’t care” ) Writing time (R16 is `Low`) is 200us, and can not verify locked or not in this mode.
Page 78
HMS81032E/HMS81032TL LOCK Bit Read (VDD) Min. 50ms 11.5V (TESTB) (RESETB) (REMOUT) Min. Min. Latch Timing 10us (R10) (R11) (R16) (R17) (R20) DOUT [7:0] Mode setting Lock bit Read LOCK bit read Normal Locked Nov. 2001 Ver 2.00...
HMS81032E/HMS81032TL 18. GENERAL CIRCUIT DIAGRAM 18.1 General circuit diagram of HMS81032E In case of using high gain Tr for longer transmission distance application. We recommend to attach proper value of capacitor between REMOUT pin of chip and VSS of system to prevent excessive overshoot voltage of system power (over the maximum supply VCC of chip) during signal transmission.
HMS8132E/HMS81032TL 18.2 General circuit diagram of HMS81032TL H M S 81 03 2T L R 14 R 1 3 Infrared L E D R 15 R 1 2 R 16 R 1 1 R 17 R 1 0 V D D R E M O U T 0.1u F R E SE T...
Page 84
HMS81032E/HMS81032TL Nov. 2001 Ver 2.00...
A. MASK ORDER SHEET MASK ORDER & VERIFICATION SHEET E -UE HMS810 Customer should write inside thick line box. 1. Customer Information 2. Device Information 20SOP 20PDIP Company Name 24SOP 24SKDIP Application Package 28SOP YYYY 28SKDIP Order Date 28PIN DIE Tel: Fax: Mask Data...
APPENDIX B. INSTRUCTION B.1 Terminology List Terminology Description Accumulator X - register Y - register Program Status Word #imm 8-bit Immediate data Direct Page Offset Address !abs Absolute Address Indirect expression Register Indirect expression { }+ Register Indirect expression, after that, Register auto-increment .bit Bit Position A.bit...
APPENDIX B.3 Instruction Set Arithmetic / Logic Operation Byte Cycle Flag Mnemonic Operation Code NVGBHIZC ADC #imm Add with carry. A ← ( A ) + ( M ) + C ADC dp ADC dp + X ADC !abs NV--H-ZC ADC !abs + Y ADC [ dp + X ] ADC [ dp ] + Y...
Page 90
APPENDIX Byte Cycle Flag Mnemonic Operation Code NVGBHIZC Divide : YA / X Q: A, R: Y NV--H-Z- EOR #imm Exclusive OR A ← ( A ) ⊕ ( M ) EOR dp EOR dp + X EOR !abs N-----Z- EOR !abs + Y EOR [ dp + X ] EOR [ dp ] + Y...
Page 91
APPENDIX Register / Memory Operation Byte Cycle Flag Mnemonic Operation Code NVGBHIZC LDA #imm Load accumulator A ← ( M ) LDA dp LDA dp + X LDA !abs LDA !abs + Y N-----Z- LDA [ dp + X ] LDA [ dp ] + Y LDA { X } X- register auto-increment : A ←...
Page 92
APPENDIX 16-BIT operation Byte Cycle Flag Mnemonic Operation Code NVGBHIZC 16-Bits add without Carry ADDW dp NV--H-ZC YA ← ( YA ) ( dp +1 ) ( dp ) Compare YA contents with memory pair contents : CMPW dp N-----ZC (YA) −...
Page 93
APPENDIX Branch / Jump Operation Byte Cycle Flag Mnemonic Operation Code NVGBHIZC BBC A.bit,rel Branch if bit clear : -------- if ( bit ) = 0 , then pc ← ( pc ) + rel BBC dp.bit,rel BBS A.bit,rel Branch if bit set : -------- if ( bit ) = 1 , then pc ←...
Need help?
Do you have a question about the HMS81004E and is the answer not in the manual?
Questions and answers