GMS81508B HYNIX [Hynix Semiconductor], GMS81508B Datasheet

no-image

GMS81508B

Manufacturer Part Number
GMS81508B
Description
HYUNDAI MICRO ELECTRONICS 8-BIT SINGLE-CHIP MICROCONTROLLERS
Manufacturer
HYNIX [Hynix Semiconductor]
Datasheet
User’s Manual (Ver. 1.04)
8-BIT SINGLE-CHIP MICROCONTROLLERS
HYUNDAI MICRO ELECTRONICS
GMS81508B
GMS81516B
GMS81524B
Semiconductor Group of Hyundai Electronics Industrial Co., Ltd.
+ < 8 1 ' $ ,
MicroElectronics

Related parts for GMS81508B

GMS81508B Summary of contents

Page 1

... HYUNDAI MICRO ELECTRONICS 8-BIT SINGLE-CHIP MICROCONTROLLERS GMS81508B GMS81516B GMS81524B User’s Manual (Ver. 1.04) + < MicroElectronics Semiconductor Group of Hyundai Electronics Industrial Co., Ltd. ...

Page 2

Version 1.04 Published by MCU Application Team 1999 HYUNDAI Micro Electronics All right reserved. Additional information of this manual may be served by HYUNDAI Micro Electronics offices in Korea or Distributors and Representatives listed at address directory. HYUNDAI Micro Electronics ...

Page 3

... Timer / Counter Mode ............................42 8-bit Capture Mode ..........................................43 16-bit Capture Mode ........................................44 12. ANALOG DIGITAL CONVERTER......46 13. SERIAL COMMUNICATION ..............48 DEC. 1999 Ver 1.04 GMS81508B/16B/24B Transmission/Receiving Timing ...................... 50 The Serial I/O operation by SRDY pin ............ 50 The method of Serial I/O ................................. 51 The Method to Test Correct Transmission ...... 51 14. PWM OUTPUT ..................................52 15. BUZZER FUNCTION .........................55 16 ...

Page 4

... OVERVIEW 1.1 Description The GMS81508B/16B/24B are advanced CMOS 8-bit microcontrollers with 8K/16K/24K bytes of ROM. The device is one of GMS800 family. This device using the GMS800 family CPU includes several peripheral functions such as Timer, A/D converter, Programmable buzzer driver, Serial I/O communication, Pulse Width Modulation function, etc. The RAM, ROM, and I/O are placed on the same memory map in addition to simple instruction set ...

Page 5

... For mode detail, Refer to “22. OTP PROGRAM- MING” on page 73. Macro assembler operates under the TM MS-Windows 95/98 . Please contact sales part of Hyundai MicroElectronics. 1.4 Ordering Information Device name GMS81508B K GMS81508B Q GMS81508B LQ GMS81516B K Mask version GMS81516B Q GMS81516B LQ GMS81524B K GMS81524B Q GMS81524B LQ GMS81516BT K GMS81516BT Q GMS81516BT LQ ...

Page 6

... Timer/ Watchdog Interface Counter Timer Buzzer R4 Driver R40 / INT0 R41 / INT1 R42 / INT2 R43 / INT3 R44 / EC0 R45 / EC2 R46 / T1O R47 / T3O GMS81508B/16B/24B R20~R27 R30~R37 Data Memory (448 bytes) Program Memory Data Table PC 8-bit 8-bit PWM ADC R5 R6 ...

Page 7

... INT3 R43 25 INT2 R42 26 INT1 R41 27 INT0 28 R40 29 RESET XIN 30 XOUT R36 52 R35 53 R34 54 R33 55 R32 56 R31 57 R30 58 GMS81508B/16B/24B TEST R67 63 R66 64 HYUNDAI MicroElectronics 64 R30 63 R31 62 R32 61 R33 60 R34 59 R35 58 R36 R37 57 56 R00 ...

Page 8

... R37 50 R36 51 R35 52 R34 53 R33 54 R32 55 R31 56 R30 GMS81508B/16B/24B TEST R67 62 R66 63 R65 R64 64 GMS81508B/16B/24B 32 R20 31 R21 30 R22 29 R23 28 R24 27 R25 26 R26 25 R27 XOUT XIN 22 21 RESET 20 R40 INT0 19 R41 INT1 18 R42 INT2 17 R43 ...

Page 9

... GMS81508B/16B/24B 4. PACKAGE DIAGRAM 64SDIP 64MQFP 3.18 max. 6 2.280 2.260 0.070 Typ. 0.022 0.050 0.016 0.030 24.15 23.65 20.10 19.90 SEE DETAIL “A” 1.00 Typ. 0.50 0.35 HYUNDAI MicroElectronics UNIT: INCH 0.750 Typ. 0.680 0.660 0-15 UNIT: MM 0-7 1.03 0.73 1.95 REF DETAIL “A” DEC. 1999 Ver 1.04 ...

Page 10

... HYUNDAI MicroElectronics 64LQFP 1.60 max. DEC. 1999 Ver 1.04 12.00 Typ. 10.00 Typ. SEE DETAIL “A” 0.50 Typ. 0.38 0.22 GMS81508B/16B/24B UNIT: MM 0-7 0.75 0.45 1.00 REF DETAIL “A” 7 ...

Page 11

... GMS81508B/16B/24B 5. PIN FUNCTION V : Supply voltage Circuit ground. SS TEST: Used for Test Mode. For normal operation, it should be connected RESET: Reset the MCU Input to the inverting oscillator amplifier and input to IN the internal main clock operating circuit Output from the inverting oscillator amplifier. ...

Page 12

... I/O ports 8-bit general I/O ports 8-bit general I/O ports General input ports General I/O ports Ground level input pin for ADC Supply voltage input pin for ADC Table 5-1 Port Function Description GMS81508B/16B/24B Function Alternate . DD External interrupt 0 input External interrupt 1 input External interrupt 2 input ...

Page 13

... GMS81508B/16B/24B 6. PORT STRUCTURES R00~R07, R10~R17, R20~R27, R30~37 Data Reg. Dir. Reg. MUX Rd R40/INT0, R41/INT1, R42/INT2, R43/INT3, R44/ EC0, R45/EC2, R50/SIN PMR Selection Data Reg. Direction Reg EX) INT0 Alternate Function R46/T1O, R47/T3O, R51/SOUT, R54/WDTO R55BUZ, R56/PWM0, R57/PWM1 Selection Secondary function Data Reg ...

Page 14

... To A/D converter R64/AN7 ~ R67/AN7 Data Reg. Dir. Reg A/D converter OUT XIN V SS XOUT DEC. 1999 Ver 1.04 RESET TEST V DD Pin Stop GMS81508B/16B/24B V DD RESET OTP version: disconnected Mask version: connected TEST ...

Page 15

... GMS81508B/16B/24B 7. ELECTRICAL CHARACTERISTICS 7.1 Absolute Maximum Ratings Supply voltage ............................................. -0.3 to +7.0 V Storage Temperature .................................. -40 to +125 C Voltage on any pin with respect to Ground (V ..................................................................-0 Maximum current out of V pin .......................... 150 mA SS Maximum current into V pin .............................. Maximum current sunk by (I per I/O Pin) .......... Maximum output current sourced by (I ...

Page 16

... V =V All input pins IN SS RESET, EC0, EC2, T- SIN, SCLK, INT0~INT3 f = input = V XIN SS C rystal O scillator =30pF XIN input = V SS GMS81508B/16B/24B Specifications Max. 1 Typ. f =4MHz f =8MHz XIN XIN V 1. Specifications 1 Min. Typ. 0. ...

Page 17

... GMS81508B/16B/24B 7.5 AC Characteristics (T =-20~+ =5V 10 Parameter Symbol f Operating Frequency XIN Oscillation Stabilizing t ST Time External Clock Pulse t CPW Width External Clock Transi RCP, tion Time t Interrupt Pulse Width IW t RESET Input Width RST Event Counter Input t ECW Pulse Width ...

Page 18

... SCLK SCKW t FSCK SCLK t RSCK s SOUT OUT t SCYC t t RSCK FSCK t SCKW 0. SUS HS t FSIN t DS 0.8V DD 0.2V DD Figure 7-2 Serial I/O Timing Chart GMS81508B/16B/24B Specifications Min. Typ. 2t +200 - SYS t +70 - SYS - - - - 100 - 200 - t +70 - SYS 4t 16t - SYS t -30 SYS t SCKW 0.8V DD 0.2V DD ...

Page 19

... GMS81508B/16B/24B 7.7 Typical Characteristic Curves This graphs and tables provided in this section are for de- sign guidance only and are not tested or guaranteed. In some graphs or tables the data presented are out- side specified operating range (e.g. outside specified V range). This is for information only and devices ...

Page 20

... R0, R1, R2, R3 pins V IL2 f =8MHz (V) XIN Ta= ( STOP 0.4 0.3 0 GMS81508B/16B/24B Operating Area Stop Mode f XIN (MHz) Ta= -20 ...

Page 21

... GMS81508B/16B/24B 8. MEMORY ORGANIZATION The GMS81508B/16B/24B has separate address spaces for Program memory and Data Memory. Program memory can only be read, not written to. It can 24K bytes 8.1 Registers This device has six registers that are the Program Counter (PC), a Accumulator (A), two index registers (X, Y), the Stack Pointer (SP), and the Program Status Word (PSW) ...

Page 22

... BIT instruction is executed, bit 6 of memory is copied to this flag. [Negative flag N] This flag is set to match the sign bit (bit 7) status of the re- sult of a data or arithmetic operation. When the BIT in- struction is executed, bit 7 of memory is copied to this flag. GMS81508B/16B/24B LSB Z C RESET VALUE CARRY FLAG RECEIVES ...

Page 23

... GMS81508B/16B/24B At execution of a CALL/TCALL/PCALL Push 01FE PCH down PCL 01FD 01FC 01FB SP before 01FE execution SP after 01FC execution 01FE 01FD 01FC 01FB SP before execution SP after execution 20 At acceptance of interrupt 01FE PCH 01FE Push 01FD PCL 01FD down 01FC PSW 01FC 01FB ...

Page 24

... Figure 8-6 Interrupt Vector Area GMS81508B/16B/24B for TCALL15, 0FFC2 H and 0FFF9 for External Interrupt for External Interrupt 0, etc 0FFFF , not going Vector Area Memory - - Serial Communication Interface Basic Interval Timer ...

Page 25

... GMS81508B/16B/24B PCALL Area Memory Address 0FF00 H 0FFFF H PCALL rel 4F35 PCALL 35H 0FF00 H 0FF35 NEXT H 0FFFF H 22 Address 0FFC0 PCALL Area CF (256 Bytes Figure 8-7 PCALL and TCALL Memory Area ...

Page 26

... ROM Start address * ;Disable All Interrupts ;RAM Clear(!0000H->!00BFH) ;Stack Pointer Initialize ;Normal Port 0 ;Normal Port Direction ;8us x 250 = 2000us ;Start Timer0, 8us at 8MHz ;Select falling edge detect on INT pin ;Set external interrupt pin(INT0, INT1) ;Enable master interrupt GMS81508B/16B/24B 23 ...

Page 27

... GMS81508B/16B/24B 8.3 Data Memory Figure 8-8 shows the internal Data Memory space availa- ble. Data Memory is divided into four groups, a user RAM, control registers, Stack, and LCD memory. 0000 H User Memory PAGE0 00BF H 00C0 H Control Registers 00FF H 0100 H User Memory PAGE1 or Stack Area ...

Page 28

... T0 TDR1 T1 TDR2 T2 TDR3 T3 ADCM R/W ADR SIOM R/W SIOR R/W BUR PWMR0 Table 8-1 Control Registers GMS81508B/16B/24B Initial Value Page Undefined page page 31 Undefined page page 31 Undefined page ...

Page 29

... GMS81508B/16B/24B Address Register Name 00F1 PWM1 duty register 00F2 PWM control register 00F4 Interrupt enable register low 00F5 Interrupt request flag register low 00F6 Interrupt enable register high 00F7 Interrupt request flag register high 00F8 External interrupt edge selection register 00F9 Power fail detection register Registers are controlled by byte manipulation instruction such as LDM etc ...

Page 30

... RAM paging register (RPR) and 8-bit immediate data. DEC. 1999 Ver 1.04 Example: G=1 E45535 #imm (3) Direct Page Addressing In this mode, a address is specified within direct page. Example; G=0 C535 A GMS81508B/16B/24B LDM 35H,#55H data 0135H data ¨ 55H ~ ~ ~ ~ 0F100H E4 0F101H ...

Page 31

... GMS81508B/16B/24B (4) Absolute Addressing !abs Absolute addressing sets corresponding memory data to Data, i.e. second byte (Operand I) of command becomes lower level address and third byte (Operand II) becomes upper level address. With 3 bytes command possible to access to whole memory area. ADC, AND, CMP, CMPX, CMPY, EOR, LDA, LDX, LDY, OR, SBC, STA, STX, STY Example ...

Page 32

... A Y indexed indirect Processes memory data as Data, assigned by the data [dp+1][dp] of 16-bit pair memory paired by Operand in Di- rect pageplus Y-register data. ADC, AND, CMP, EOR, LDA, OR, SBC, STA Example; G=0, Y=10 GMS81508B/16B/24B JMP [35H] 35H 0A 36H NEXT jump to address 0E30AH ...

Page 33

... GMS81508B/16B/24B 1725 ADC [25H]+Y 25H 05 26H 0E015H data ~ ~ ~ ~ 0FA00H 17 25 Absolute indirect [!abs] The program jumps to address specified by 16-bit absolute address. JMP 30 Example; G=0 1F25E0 0E005H + Y(10) = 0E015H A + data + C A HYUNDAI MicroElectronics JMP [!0C025H] PROGRAM MEMORY 0E025H 25 E7 0E026H ~ ~ ~ ~ jump to address 0E30AH 0E725H ...

Page 34

... I: INPUT PORT ADDRESS: 0C0 H RESET VALUE: Undefined ADDRESS: 0C1 H RESET VALUE Port Direction 0: Input 1: Output GMS81508B/16B/24B ). Each I/O pin can independently ADDRESS: 0C2 R1 Data Register RESET VALUE: Undefined R1 R17 R16 R15 R14 R13 R12 R11 R10 Input / Output data ADDRESS: 0C3 ...

Page 35

... GMS81508B/16B/24B R3 and R3DD register 8-bit CMOS bidirection- al I/O port (address 0C6 ). Each I/O pin can independently H used as an input or an output through the R0DD register (address 0C7 ). H R3 Data Register R3 R37 R36 R35 R34 R33 R32 R31 R30 Input / Output data R3 Direction Register ...

Page 36

... I/O port simultaneously. At least one pin is used as an analog input. Port Direction 0: Input 1: Output ADDRESS: 0D1 H RESET VALUE: --00---- GMS81508B/16B/24B ). Each I/O pin can independent Port Pin Alternate Function R60 AN0 (ADC input 0) R61 AN1 (ADC input 1) R62 AN2 (ADC input 2) ...

Page 37

... GMS81508B/16B/24B 10. BASIC INTERVAL TIMER The GMS815xxB has one 8-bit Basic Interval Timer that is free-run and can not stop. Block diagram is shown in Figure 10-1. In addition, the Basic Interval Timer generates the time base for watchdog timer counting. It also provides a Basic interval timer interrupt (BITIF). As the count overflow ...

Page 38

... If this bit is 0, all peripherals are disabled such as Timer, ADC, PWM, etc. 0: Operate as a 6-bit general timer 1: Enable Watchdog Timer operation See the section “Watchdog Timer” ADDRESS: 0D3 BTCL INITIAL VALUE: Undefined Figure 10-2 BITR: Basic Interval Timer Mode Register GMS81508B/16B/24B ...

Page 39

... GMS81508B/16B/24B 11. TIMER/EVENT COUNTER The GMS815xxB has four Timer/Counter registers. Each module can generate an interrupt to indicate that an event has occurred (i.e. timer match). Timer 0 and Timer 1 are can be used either two 8-bit Tim- er/Counter or one 16-bit Timer/Counter with combine them. Also Timer 2 and Timer 3 are same. ...

Page 40

... XIN 11: 8-bit Timer, Clock source is f XIN ADDRESS: 0E4 INITIAL VALUE: Undefined Read: Count value read Write: Compare data write Figure 11-1 TM0, TM2 Registers GMS81508B/16B/24B ADD RES S: 0E2 H INITIAL V ALUE ADDRESS: 0E3 H INITIAL VALUE: 00 ...

Page 41

... GMS81508B/16B/24B 11.1 8-bit Timer / Counter Mode The GMS815xxB has four 8-bit Timer/Counters, Timer 0, Timer 1, Timer 2, Timer 3. The Timer 0, Timer 1 are shown in Figure . The “timer” or “counter” function is selected by control registers TM0, TM2 as shown in Table 11-1 and Table 11 use as an 8-bit timer/counter mode, bit CAP0 of TM0 is cleared to “ ...

Page 42

... MUX TIMER 3 TDR3 (8-bit) Figure 11-3 8-bit Timer/Counter 2, 3 Example 4: Timer2 = 8-bit event counter mode Timer3 = 500us 8-bit timer mode at 8MHz GMS81508B/16B/24B 1 0 ADDRESS: 0E3 H T2SL0 INITIAL VALUE means don’t care T2ST 0: Stop 1: Clear and start ...

Page 43

... GMS81508B/16B/24B 8-bit Timer Mode In the timer mode, the internal clock is used for counting up. Thus, you can think counting internal clock in- put. The contents of TDRn are compared with the contents of up-counter, Tn. If match is found, a timer 1 interrupt (T1IF) is generated and the up-counter is cleared to 0. ...

Page 44

... Timer is calculated as below equation. /2 XIN Figure 11-6 Event Counter Mode Timing Chart clear & start stop T1ST = 1 T1ST = 0 Figure 11-7 Count Operation of Timer / Event counter GMS81508B/16B/24B 1 ---------- - Period (sec Divide Ratio f XIN enable ...

Page 45

... GMS81508B/16B/24B 11.2 16-bit Timer / Counter Mode The Timer register is being run with all 16 bits. A 16-bit timer/counter register T0, T1 are incremented from 0000 until it matches TDR0, TDR1 and then resets to 0000 The match output generates Timer 0 interrupt. The clock source of the Timer 0 is selected either internal or external clock by bit T0SL1, T0SL0 ...

Page 46

... T0CN MUX Capture To TIMER1 TIMER 0 This figure is a example of using the Timer0. In the Timer2, operation is same like Timer0, each registers and flags may be changed with for Timer2. Figure 11-9 8-bit Capture Mode GMS81508B/16B/24B 1 0 ADDRESS: 0E2 H T0SL1 T0SL0 INITIAL VALUE means don’ ...

Page 47

... GMS81508B/16B/24B 11.4 16-bit Capture Mode 16-bit capture mode is the same as 8-bit capture, except that the Timer register is being run will 16 bits. TM0 Edge Detector EC0 PIN XIN PIN IEDS[1:0] “01” “10” INT0 PIN “11” TIMER 0 + TIMER 1 TIMER 0 (16-bit ...

Page 48

... LDM TM2,#0100_1100B SET1 T0E SET1 T2E Example 3: Timer0 = 8-bit timer mode, 2ms interval at 8MHz Timer2 = 8-bit capture mode DEC. 1999 Ver 1.04 GMS81508B/16B/24B LDM TDR0,#250 LDM TM0,#0111_1111B SET1 T0E LDM TDR2,#40H LDM TDR3,#2AH LDM TM2,#1111_1111B SET1 ...

Page 49

... GMS81508B/16B/24B 12. ANALOG DIGITAL CONVERTER The analog-to-digital converter (A/D) allows conversion of an analog input signal to a corresponding 8-bit digital value. The A/D module has eight analog inputs, which are multiplexed into one sample and hold. The output of the sample and hold is the input into the converter, which gen- erates the result via successive approximation ...

Page 50

... ADDRESS: 0E9 BTCL INITIAL VALUE: Undefined Figure 12-2 A/D Converter Control Register GMS81508B/16B/24B ADDRESS: 0E8 H INITIAL VALUE: --00 0001 B A/D status bit 0: A/D conversion is in progress 1: A/D conversion is completed A/D start bit Setting this bit starts an A/D conversion. After one cycle, bit is cleared to “0” by hardware. ...

Page 51

... GMS81508B/16B/24B 13. SERIAL COMMUNICATION The serial iterface is used to transmit/receive 8-bit data se- rially. This consists of serial I/O data register, serial I/O mode register, clock selection circuit octal counter and control circuit as illustrated in Figure 13-1.Pin R50/SIN, R51/SOUT, R52/SCLK and R53/SRDY pins are con XIN PIN 32 “ ...

Page 52

... R/W R ADDRESS: 0EB BTCL INITIAL VALUE: Undefined Figure 13-2 SCI Control Register GMS81508B/16B/24B ADDRESS: 0EA H INITIAL VALUE: -000 0001 B Serial transmission status bit 0: Serial transmission is in progress 1: Serial transmission is completed Serial transmission start bit Setting this bit starts an Serial transmission. After one cycle, bit is cleared to “0” by hardware. ...

Page 53

... GMS81508B/16B/24B 13.1 Transmission/Receiving Timing The serial transmission is started by setting SIOST(bit1 of SIOM) to “1”. After one cycle of SCK, SIOST is cleared automatically to “0”. The serial output data from 8-bit shift register is output at falling edge of SCLK. And input data Input Clock SCLK PIN SIOST FLAG ...

Page 54

... Serial I/O Interrupt Service Routine 0 SIOSF Write SIOM Normal Operation - SE: Interrupt Enable Register Low IENL(Bit3) - SR: Interrupt Request Flag Register Low IRQL(Bit3) Figure 13-4 Serial Method to Test Transmission GMS81508B/16B/24B Abnormal Overrun Error 51 ...

Page 55

... GMS81508B/16B/24B 14. PWM OUTPUT The GMS815xxB have two channels of built-in pulse width modulation outputs. PWM outputs data are multi- plex to the R56 and R57 port. Bit 6 and bit 7 of R5DD should be set to “1” when PWM is used as an output port. P0CK[1:0] f 256 ...

Page 56

... PWM0 clock selection 00: f 256 XIN 01: f 512 XIN 10: f 1024 XIN 11: f 2048 XIN Figure 14-3 PWM Control Register GMS81508B/16B/24B W 0 ADDRESS: 0F2 H POL0 INITIAL VALUE: 0000 0000 B PWM0 output polarity 0: Active low 1: Active high PWM1 output polarity 0: Active low 1: Active high ...

Page 57

... GMS81508B/16B/24B PWMCR f XIN 8MHz 512 3.264ms PWM1 PWMR1 16.384 54 enable XIN fixed 256 = 61.035Hz 8MHz 16.384ms 33 H ------------ - = 3.264ms 100 H Figure 14-4 Example of Register Setting HYUNDAI MicroElectronics active high 1 fixed 256 256 = 122.07Hz 8.192ms 5.728ms PWM0 PWMR0 B3 H ------------ - 8 ...

Page 58

... Figure 15-1 Block Diagram of Buzzer Driver ADDRESS: 0D1 H RESET VALUE: --00 ---- B BUR - - - R54/WDTO Selection 0: R54 1: WDTO (Output) R55/BUZ Selection 0: R55 port (Turn off buzzer) 1: BUZ port (Turn on buzzer) Figure 15-2 PMR5 and Buzzer Register GMS81508B/16B/24B f XIN ------------------------------------------------------------- f = BUZ 2 DivideRatio : Buzzer frequency : Oscillator frequency 0 2 R55/BUZ PIN 1 F/F ...

Page 59

... GMS81508B/16B/24B Note: BUR is undefined after reset must be initialized to between 1 and 3F by software Note that BUR is a write-only register. BUR[7:6] BUR [5: 250.000 125.000 02 125.000 62.500 03 83.333 41.667 04 62.500 31.250 05 50.000 25.000 06 41.667 20.833 07 35.714 17.857 08 31.250 15.625 09 27.778 13 ...

Page 60

... T1IF T2IF INT2IF T0IF T3IF INT3IF LSB R/W R BITIF SIOIF - LSB Figure 16-1 Interrupt Request Flag GMS81508B/16B/24B Reset/Interrupt Symbol RESET INT0 INT1 INT2 INT3 Timer 0 Timer 1 Timer 2 Timer 3 ADC BIT WDT SCI ADDRESS: 0F7 H INITIAL VALUE: 0000 0000 B Timer/Counter 3 interrupt request flag Timer/Counter 2 interrupt request flag ...

Page 61

... GMS81508B/16B/24B . IRQH [0F7 ] H INT0IF INT0 INT1IF INT1 INT2 INT2IF INT3 INT3IF Timer 0 Timer 1 Timer 2 Timer 3 IRQL [0F5 ] H A/D Converter Watchdog Timer WDTIF BIT Serial Communication R/W R/W IENH INT0E INT1E MSB R/W R/W IENL ADE WDTE MSB 58 Internal bus line [0F6 ] H Interrupt Enable IENH Register (Higher byte) ...

Page 62

... These registers are saved by the software if necessary. Also, when multiple interrupt services are nested necessary to avoid using the same data memory GMS81508B/16B/24B cleared to “0”. and the program status word are saved (pushed) onto the stack area. The stack pointer decreases 3 times. ...

Page 63

... GMS81508B/16B/24B area for saving registers. The following method is used to save/restore the general- purpose registers. Example: Register save using push and pop instructions INTxx: PUSH A ;SAVE ACC. PUSH X ;SAVE X REG. PUSH Y ;SAVE Y REG. interrupt processing POP Y ;RESTORE Y REG. POP X ;RESTORE X REG. POP A ...

Page 64

... I-flag in interrupt routine, some further inter- rupt can be serviced even if certain interrupt is in progress. Example: During Timer1 interrupt is in progress, INT0 in- terrupt serviced without any suspend. TIMER1: PUSH INT0 service The edge detection of external interrupt has three transition GMS81508B/16B/24B A PUSH X PUSH Y ;Enable INT0 only LDM IENH,#80H ...

Page 65

... GMS81508B/16B/24B activated mode: rising edge, falling edge, and both edge. INT0 pin INT1 pin INT2 pin INT3 pin IEDS [0F8H] Figure 16-7 External Interrupt Block Diagram INT0 ~ INT3 are multiplexed with general I/O ports (R40~R43). To use as an external interrupt pin, the bit of R4 port mode register PMR4 should be set to “ ...

Page 66

... IED3L IED2H IED2L IED1H BTCL IED1L INT3 INT2 INT1 Edge selection register 00: Reserved 01: Falling (1-to-0 transition) 10: Rising (0-to-1 transition) 11: Both (Rising & Falling) Figure 16-9 PMR4 and IEDS Registers GMS81508B/16B/24B W W ADDRESS: 0D0 H INT1S INT0S INITIAL VALUE LSB 0: R40 1: INT0 0: R41 1: INT1 0: R42 ...

Page 67

... GMS81508B/16B/24B 17. WATCHDOG TIMER The watchdog timer rapidly detects the CPU malfunction such as endless looping caused by noise or the like, and re- sumes the CPU to the normal state. The watchdog timer signal for detecting malfunction can be selected either a reset CPU or a interrupt request. BASIC INTERVAL TIMER ...

Page 68

... Example: 6-bit timer interrupt set up WDTR “0100_0011 Figure 17-3 Watchdog timer Timing The main clock oscillator also turns on when a watchdog timer reset is generated in sub clock mode. GMS81508B/16B/24B 1, Clear Counter T = WDTR Interval of BIT LDM CKCTLR,#xx0xxxxxB; WDTON LDM WDTR,#7FH ; ...

Page 69

... GMS81508B/16B/24B 18. POWER DOWN OPERATION GMS815xxB has a power-down mode. In power-down mode, power consumption is reduced considerably that in battery operation. Battery life can be extended a lot. 18.1 STOP Mode For applications where power consumption is a critical factor, device provides reduced power of STOP. Start The Stop Operation An instruction that STOP causes to be the last instruction is executed before going into the STOP mode ...

Page 70

... not appropriate to set as an input mode, then set to output mode considering there is no current flow. Setting to High or Low is decided considering its relationship with external circuit. For example, if there is external pull-up re- sistor then it is set to output mode, i.e. to High, and if there GMS81508B/16B/24B Chip function after event PC Oscillator Circuit Vector ...

Page 71

... GMS81508B/16B/24B is external pull-down register set to low. INPUT PIN internal pull- GND X Weak pull-up current flows Figure 18-2 Application Example of Unused Input Port OUTPUT PIN ON OFF i GND X In the left case, much current flows from port to GND. Figure 18-3 Application Example of Unused Output Port ...

Page 72

... Do not fetch signals from the oscillator. DEC. 1999 Ver 1.04 tively, inverting amplifier which can be configured for be- ing used as an on-chip oscillator, as shown in Figure 19-1. X OUT C1,C2 = 30pF±10pF Figure 19-1 Oscillation Circuit GMS81508B/16B/24B Open X OUT X External Clock IN External Oscillator X OUT X IN ...

Page 73

... GMS81508B/16B/24B 20. RESET The GMS815xxB have two types of reset generation pro- cedures; one is an external reset input, the other is a watch- On-chip Hardware Program counter (PC) G-flag (G) Peripheral clock 20.1 External Reset Input The reset input is the RESET pin, which is the input to a Schmitt Trigger. A reset in accomplished by holding the ...

Page 74

... Note: If power fail voltage is selected to 3. oper- ation, MCU is freezed at all the times. R/W R/W R PFV PFD PFR Figure 21-1 Power Fail Voltage Detector Register GMS81508B/16B/24B Power FailFunction OTP Enable/Disable by PFD flag Level Selection by PFV flag Table 21-1 Power fail processor R ADDRESS: 0F9 H PFS INITIAL VALUE: ---- 1100 ...

Page 75

... GMS81508B/16B/24B V DD Internal RESET V DD When PFR = 1 Internal RESET V DD Internal RESET 72 RESET VECTOR PFS =1 NO RAM CLEAR INITIALIZE RAM DATA INITIALIZE ALL PORTS INITIALIZE REGISTERS FUNTION EXECUTION Figure 21-2 Example S/W of RESET flow by Power fail t <64mS Figure 21-3 Power Fail Processor Situations HYUNDAI MicroElectronics ...

Page 76

... OE (Output Enable the input of data output control signal for verify. A0~A15 (Address Bus) A0~A15 are address input pins for internal EPROM. O0~O7 (EPROM Data Bus) These are data bus for internal EPROM. GMS81508B/16B/24B Set Value 4000H 7FFFH C000H Set Value 2000H ...

Page 77

... GMS81508B/16B/24B 64SDIP 64MQFP OPEN 31 32 GND GMS815016BT/24BT GND DD Table 22-1 Socket Adapter Pin Assignment HYUNDAI MicroElectronics ...

Page 78

... HYUNDAI MicroElectronics 64LQFP V V DEC. 1999 Ver 1. GMS81516BT/24BT GND Table 22-2 Socket Adapter Pin Assignment GMS81508B/16B/24B A10 30 A11 29 A12 28 27 A13 A14 26 25 A15 24 OPEN ...

Page 79

... GMS81508B/16B/24B 22.3 Programming Specification DEVICE OPERATION MODE ( ± Mode CE 1 Read Mode X V Output Disable Mode IH V Programming Mode IL 1 Program Verify Either See DC Characteristics Table for V DEVICE CHARACTERISTICS (V =0V ± Symbol Item ...

Page 80

... Does not apply Addresses Valid See note ( High-Z Valid Output and 4.0V for =5.0V GMS81508B/16B/24B OUTPUTS Will be steady Will be changing from Will be changing from Changing state unknown Center line is high impedance “Off” state ...

Page 81

... GMS81508B/16B/24B PROGRAMMING ALGORITHM WAVEFORMS V IH Addresses Data In/Out V IL 12.75V 6.25V The input timing reference level is 1.0V for Program Addresses Valid t AS Data in Stable VPS t VDS t PW and 4.0V for ...

Page 82

AC READING CHARACTERISTICS (V =0V ± Symbol Item t Address setup time AS t Quick Pulse Programming supply current DH PP Note: V must be applied simultaneously or before ...

Page 83

... GMS81508B/16B/24B INCREMENT 80 START ADDRESS=FIRST LOCATION V =6. =11.75 PP X=0 PROGRAM ONE 100 s PULSE INCREMENT X YES X=25? NO FAIL VERIFY ONE BYTE PASS NO LAST ADDRESS? ADDRESS YES V =V =5. COMPARE ALL BYTES TO ORIGINAL DATA PASS DEVICE PASSED Table 22-1 Programming Algorithm HYUNDAI MicroElectronics FAIL VERIFY BYTE PASS ...

Page 84

APPENDIX ...

Page 85

HYUNDAI Micro Electronics A. CONTROL REGISTER LIST Address Register Name 00C0 R0 port data register 00C1 R0 port I/O direction register 00C2 R1 port data register 00C3 R1 port I/O direction register 00C4 R2 port data register 00C5 R2 port ...

Page 86

GMS800 Series Address Register Name 00F2 PWM control register 00F4 Interrupt enable register low 00F5 Interrupt request flag register low 00F6 Interrupt enable register high 00F7 Interrupt request flag register high 00F8 External interrupt edge selection register 00F9 Power fail ...

Page 87

HYUNDAI Micro Electronics B. SOFTWARE EXAMPLE B.1 7-segment LED display 10k UP/DOWN S/W CLEAR S/W GND ;***************************************************************************** ; Title: GMS81516 (GMS800 Series) Demonstration Program ; Company: HYUNDAI Micro Electronics ; Contents: Decimal Up/Down Counter ; Programmer: HME MCU application team ...

Page 88

GMS800 Series T1S EQU 6,0D0H EC2S EQU 5,0D0H EC0S EQU 4,0D0H INT3S EQU 3,0D0H INT2S EQU 2,0D0H INT1S EQU 1,0D0H INT0S EQU 0,0D0H ; PMR5 EQU 0D1H BUZS EQU 5,0D1H WDTS EQU 4,0D1H ; TMR EQU 0D2H ; CKCTLR EQU ...

Page 89

HYUNDAI Micro Electronics PUSH Y ENDM ; REG_RESTORE MACRO POP Y POP X POP A ENDM ; ;*********** CONSTANT DEFINITION ; SEG_PORT EQU R0 STROBE_PORT EQU R2 ; ;************************************************************************** ; RAM ALLOCATION ;************************************************************************** DIGIT10 DS 1 DIGIT1 DS 1 STROBE ...

Page 90

GMS800 Series ; Loop: nop IF F_500ms == 1 clr1 call ENDIF jmp Loop ; ;*********************************************** ; Subject: Inc. or Dec. two digits ;*********************************************** ; Entry: UP_F ; Return: UP_F=1, Increment two digits ; UP_F=0, Decrement two digits ;*********************************************** ; ...

Page 91

HYUNDAI Micro Electronics ;************************************************************************** ; EXTERNAL INTERRUPT 1 (CLEAR KEY) ;************************************************************************** ; INT_1: LDM DIGIT1,#0 LDM DIGIT10,#0 LDM TMR_500MS,#0 RETI ; ;*********************************************************************** ; Subject: Seven Segment Display ;*********************************************************************** ; Entry: DIGIT10 or DIGIT1 ; Return: Output SEG_PORT (R00~R07), ; Strobe_port ...

Page 92

GMS800 Series C. INSTRUCTION C.1 Terminology List Terminology PSW #imm dp !abs [ ] { } { }+ .bit A.bit dp.bit M.bit rel upage viii Accumulator X - ...

Page 93

HYUNDAI Micro Electronics C.2 Instruction Map 00000 00001 00010 00011 LOW HIGH SET1 BBS BBS 000 - dp.bit A.bit,rel dp.bit,rel 001 CLRC 010 CLRG 011 DI 100 CLRV 101 SETC 110 SETG 111 EI 10000 10001 ...

Page 94

GMS800 Series C.3 Instruction Set Arithmetic / Logic Operation Op No. Mnemonic Code 1 ADC #imm 04 2 ADC ADC ADC !abs 07 5 ADC !abs + ADC [ ...

Page 95

HYUNDAI Micro Electronics Op No. Mnemonic Code 44 DIV 9B 45 EOR #imm A4 46 EOR EOR EOR !abs A7 49 EOR !abs + EOR [ ...

Page 96

GMS800 Series Register / Memory Operation Op No. Mnemonic Code 1 LDA #imm C4 2 LDA LDA LDA !abs C7 5 LDA !abs + LDA [ ...

Page 97

HYUNDAI Micro Electronics 16-BIT operation Op No. Mnemonic Code 1 ADDW CMPW DECW INCW LDYA STYA SUBW dp 3D Bit Manipulation Op ...

Page 98

GMS800 Series Branch / Jump Operation Op No. Mnemonic Code 1 BBC A.bit,rel y2 2 BBC dp.bit,rel y3 3 BBS A.bit,rel x2 4 BBS dp.bit,rel x3 5 BCC rel 50 6 BCS rel D0 7 BEQ rel F0 8 BMI ...

Page 99

HYUNDAI Micro Electronics Control Operation & Etc. Op No. Mnemonic Code 1 BRK NOP FF 5 POP POP POP POP PSW 6D 9 ...

Page 100

... Delivery Schedule Customer sample Risk order 5. ROM Code Verification Please confirm out verification data. YYYY Verification date: Check sum: Tel: Fax: E-mail address: Name & Signature: DEC., 10. 1999 GMS81508B -HF GMS81516B GMS81524B 2. Device Information Package Date YYYY MM DD YYYY ...

Related keywords