Part Number Hot Search : 
WJA1000 18LD4 5N60D C4082 93LC56A 16237 HC405 14D271
Product Description
Full Text Search
 

To Download GMS82524TK Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  hyundai micro electronics 8-bit single-chip microcontrollers gms82512 gms82516 gms82524  microelectronics semiconductor group of hyundai electronics industrial co., ltd. users manual (ver. 1.00)
version 1.00 published by mcu application team 2000 hyundai microelectronics all right reserved. additional information of this manual may be served by hyundai microelectronics offices in korea or distributors and representatives listed at address directory. hyundai microelectronics 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, hyundai micro electronics is in no way responsible for any violations of patents or other rights of the third party generated by the use of this manual.
hyundai microelectronics gms82512/16/24 feb. 2000 ver 1.00 1 table of contents 1. overview ...........................................1 description .........................................................1 features .............................................................1 development tools ............................................2 ordering information ..........................................2 2. block diagram ................................3 3. pin assignment ...............................4 4. package diagram .............................. 5 5. pin function .....................................6 6. port structures ...........................8 7. electrical characteristics ...10 absolute maximum ratings .............................10 recommended operating conditions ..............10 a/d converter characteristics .........................10 dc electrical characteristics ...........................11 ac characteristics ...........................................12 typical characteristic curves ..........................13 8. memory organization ................15 registers ..........................................................15 program memory .............................................18 data memory ...................................................21 addressing mode .............................................24 9. i/o ports ..........................................28 10. basic interval timer .................31 11. timer/event counter ...............33 8-bit timer / counter mode ..............................35 16-bit timer / counter mode ............................39 8-bit capture mode ..........................................40 16-bit capture mode ........................................41 12. analog digital converter ....43 13. buzzer function ........................45 14. interrupts ...................................47 interrupt sequence .......................................... 49 brk interrupt .................................................. 50 multi interrupt .................................................. 51 external interrupt ............................................. 51 15. watchdog timer ........................54 16. power down operation ..........56 stop mode .................................................... 56 minimizing current consumption .................... 57 17. oscillator circuit ....................59 18. reset ..............................................60 external reset input ........................................ 60 watchdog timer reset ................................... 60 19. power fail processor ............61 20. otp programming ......................63 how to program .............................................. 63 pin function .................................................... 63 programming specification ............................. 65 a. control register list ................. i b. software example ....................... ii 7-segment led display .....................................ii c. instruction ................................... vii terminology list ............................................... vii instruction map ................................................ viii alphabetic order table of instruction ..................ix instruction table by function .......................... xiv d. mask order sheet ......................... xx
hyundai microelectronics gms82512/16/24 feb. 2000 ver 1.00 1 gms82512/16/24 cmos single-chip 8-bit microcontroller with a/d converter 1. overview 1.1 description the gms82512/16/24 are advanced cmos 8-bit microcontrollers with 12k/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 con- verter, programmable buzzer driver, etc. the ram, rom, and i/o are placed on the same memory map in addition to simple instruction set. 1.2 features ? 12k/16k/24k bytes on-chip program memory ? 448 bytes of on-chip data ram (included stack memory) ? minimum instruction execution time 0.5 m m m m s at 8mhz ? one 8-bit basic interval timer ? four 8-bit timer/event counter or two 16-bit timer/event counter ? one 6-bit watchdog timer ? four channel 8-bit a/d converter ? four external interrupt input ports ? buzzer driving port - 500hz ~ 250khz@8mhz ? 35 i/o ports ? eleven interrupt sources - basic interval timer: 1 - external input: 4 - timer/event counter: 4 - adc: 1 - wdt: 1 ? built in noise immunity circuit - noise filter - power fail processor ?power down mode - stop mode ? 2.2v to 5.5v wide operating range ? 1~10mhz wide operating frequency ? 42sdip, 44qfp package types ? available 24k bytes otp version device name rom size ram size otp package gms82512 12k bytes 448 bytes gms82524t 42sdip, 44qfp gms82516 16k bytes 448 bytes gms82524t gms82524 24k bytes 448 bytes gms82524t
gms82512/16/24 hyundai microelectronics 2 feb. 2000 ver 1.00 1.3 development tools the gms825xx is supported by a full-featured macro as- sembler, an in-circuit emulator choice-jr. tm and otp programmers. there are third different type programmers such as emulator add-on board type, single type, gang type. for mode detail, refer to 20. otp programming on page 63. macro assembler operates under the ms-win- dows 95/98 tm . please contact sales part of hyundai microelectronics. 1.4 ordering information device name rom size ram size package mask version gms82512 k gms82512 q gms82516 k gms82516 q gms82524 k gms82524 q 12k bytes 12k bytes 16k bytes 16k bytes 24k bytes 24k bytes 448 bytes 448 bytes 448 bytes 448 bytes 448 bytes 448 bytes 42sdip 44qfp 42sdip 44qfp 42sdip 44qfp otp version gms82524t k gms82524t q 24k bytes otp 24k bytes otp 448 bytes 448 bytes 42sdip 44qfp
hyundai microelectronics gms82512/16/24 feb. 2000 ver 1.00 3 2. block diagram alu a interrupt controller data memory 8-bit adc 8-bit counter timer/ program memory data table pc 8-bit basic timer interval watchdog timer pc r4 r5 r0 psw system controller timing generator system clock controller clock generator reset test x in x out r40 / int0 r41 / int1 r42 / int2 r43 / int3 r44 / ec0 r00~r07 v dd v ss power supply r54 / wdto r55 / buz r2 r20~r27 buzzer driver r6 r64 / an4 r65 / an5 r66 / an6 r67 / an7 (448 bytes) av dd adc power supply stack pointer x y r3 r30~r37
gms82512/16/24 hyundai microelectronics 4 feb. 2000 ver 1.00 3. pin assignment r30 v dd test av dd r67 r66 r65 r64 r55 r54 r44 r43 r42 r41 r40 reset an7 an6 an5 an4 buz wdto ec0 int3 int2 int1 int0 xin xout v ss r27 r26 r31 r32 r33 r34 r35 r36 r37 r00 r01 r02 r03 r04 r05 r06 r07 r20 r21 r22 r23 r24 r25 42sdip 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 gms82512/16/24 (top view) (top view) r21 r22 r23 r24 r25 r26 r27 v ss xout xin reset r37 r00 r01 r02 r03 r04 r05 r06 r07 n.c. * r20 r66 r65 r64 n.c. * r55 r54 r44 r43 r42 r41 r40 1 2 3 4 5 6 7 8 9 10 11 r36 r35 r34 r33 r32 r31 r30 v dd test av dd r67 33 32 31 30 29 28 27 26 25 24 23 17 16 15 14 13 12 34 35 36 37 38 39 40 41 42 43 44 gms82512/16/24 44qfp an6 an5 an4 buz wdto ec0 int3 int2 int1 int0 an7 18 19 20 21 22 n.c. * : n o connection
hyundai microelectronics gms82512/16/24 feb. 2000 ver 1.00 5 4. package diagram 44qfp 2.35 max. see detail a 1.03 0.73 0-7 0.25 0.10 1.60 typ. detail a unit: mm 0.45 0.30 0.80 typ. 2.10 1.95 0.23 0.13 10.10 9.90 13.45 12.95 10.10 9.90 13.45 12.95 unit: inch 1.465 1.455 0.022 0.016 0.045 0.035 0.070 typ. 0.140 0.120 min. 0.015 0.545 0.535 0.600 typ. 0-15 42sdip 0 . 0 1 2 0 . 0 0 8 0.190 max.
gms82512/16/24 hyundai microelectronics 6 feb. 2000 ver 1.00 5. pin function v dd : supply voltage. v ss : circuit ground. test : used for test mode. for normal operation, it should be connected to v dd . reset : reset the mcu. x in : input to the inverting oscillator amplifier and input to the internal main clock operating circuit. x out : output from the inverting oscillator amplifier. r00~r07 : r0 is an 8-bit cmos bidirectional i/o port. r0 pins 1 or 0 written to the port direction register, can be used as outputs or inputs. r20~r27 : r2 is an 8-bit cmos bidirectional i/o port. r2 pins 1 or 0 written to the port direction register can be used as outputs or inputs. r30~r37 : r3 is an 8-bit cmos bidirectional i/o port. r3 pins 1 or 0 written to the port direction register can be used as outputs or inputs. r40~r44 : r4 is an 5-bit cmos bidirectional i/o port. r4 pins 1 or 0 written to the port direction register can be used as outputs or inputs. in addition, r4 serves the functions of the various follow- ing special features. r54~r55 : r5 is an 2-bit cmos bidirectional i/o port. r5 pins 1 or 0 written to the port direction register can be used as outputs or inputs. in addition, r5 serves the functions of the various follow- ing special features. r64~r67 : r6 is an 4-bit cmos bidirectional i/o port. r6 pins 1 or 0 written to the port direction register can be used as outputs or inputs. in addition, r6 is shared with the adc input. av dd : supply voltage to the ladder resistor of adc cir- cuit. to enhance the resolution of analog to digital convert- er, use independent power source as well as possible, other than digital power source. port pin alternate function r40 r41 r42 r43 r44 int0 (external interrupt 0) int1 (external interrupt 1) int2 (external interrupt 2) int3 (external interrupt 3) ec0 (event counter input 0) port pin alternate function r54 r55 wdto (watchdog timer output) buz (buzzer driver output) port pin alternate function r64 r66 r66 r67 an4 (analog input 4) an5 (analog input 5) an6 (analog input 6) an7 (analog input 7)
hyundai microelectronics gms82512/16/24 feb. 2000 ver 1.00 7 pin name in/out function basic alternate v dd - supply voltage v ss - circuit ground test i controls test mode of the chip, for normal operation, it should be connected at v dd . reset i reset signal input x in i oscillation input x out o oscillation output r00~r07 i/o 8-bit general i/o ports r20~r27 i/o 8-bit general i/o ports r30~r33 i/o(i) 8-bit general i/o ports r34~r37 i/o 8-bit general i/o ports r40 (int0) i/o (i) 8-bit general i/o ports external interrupt 0 input r41 (int1) i/o (i) external interrupt 1 input r42 (int2) i/o (i) external interrupt 2 input r43 (int3) i/o (i) external interrupt 3 input r44 (ec0 ) i/o (i) timer/counter 0 external input r54 (wdto) i/o (o) 8-bit general i/o ports watchdog timer overflow output r55 (buz) i/o (o) buzzer driving output r64~r67 (an4~an7) i/o (i) 8-bit general i/o ports analog voltage input av dd - supply voltage input pin for adc table 5-1 port function description
gms82512/16/24 hyundai microelectronics 8 feb. 2000 ver 1.00 6. port structures r00~r07, r20~r27, r30~37 r40/int0, r41/int1, r42/int2, r43/int3, r44/ ec0 r54/wdto, r55/buz r64/an7 ~ r67/an7 x in , x out reset pin data reg. dir. rd v dd vss reg. data bus mux mux data bus v dd v ss pin data reg. direction reg. rd pmr selection alternate function ex) int0 mux data bus v dd v ss pin data reg. direction reg. rd mux selection secondary function mux v dd v ss pin data bus data reg. direction reg. to a/d converter digital enable channel sel. a/d enable rd xin v dd v ss xout v ss stop reset v dd v ss
hyundai microelectronics gms82512/16/24 feb. 2000 ver 1.00 9 test test v dd v ss otp version: disconnected mask version: connected
gms82512/16/24 hyundai microelectronics 10 feb. 2000 ver 1.00 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 ss ) ..................................................................-0.3 to v dd +0.3 maximum current out of v ss pin .......................... 150 ma maximum current into v dd pin .............................. 80 ma maximum current sunk by (i ol per i/o pin) .......... 20 ma maximum output current sourced by (i oh per i/o pin) ................................................................................... 8 ma maximum current ( s i ol ) ...................................... 100 ma maximum current ( s i oh )........................................ 50 ma note: stresses above those listed under absolute maxi- mum ratings may cause permanent damage to the de- vice. this is a stress rating only and functional operation of the device at any other conditions above those indicated in the operational sections of this specification is not implied. exposure to absolute maximum rating conditions for ex- tended periods may affect device reliability. 7.2 recommended operating conditions 7.3 a/d converter characteristics (t a =25 c, v ss =0v, v dd =5.12v@f xin =8mhz, v dd =3.072v@f xin =4mhz) parameter symbol condition specifications unit min. max. supply voltage v dd f xin =1 ~ 10 mhz f xin =1 ~ 8 mhz f xin =1 ~ 4 mhz 4.5 2.7 2.2 5.5 5.5 5.5 v operating frequency f xin v dd =4.5~5.5v v dd =2.7~5.5v v dd =2.2~5.5v 1 1 1 10 8 4 mhz operating temperature t opr normal version temperature extention version -20 -40 85 85 c parameter symbol specifications unit min. typ. 1 max. f xin =4mhz f xin =8mhz analog input voltage range v ain v ss - av dd av dd v non-linearity error n nle - 1.0 1.5 1.5 lsb differential non-linearity error n dnle - 1.0 1.5 1.5 lsb zero offset error n zoe - 0.5 1.5 1.5 lsb full scale error n fse - 0.35 0.5 0.5 lsb gain error n ge - 1.0 1.5 1.5 lsb overall accuracy n acc - 1.0 1.5 1.5 lsb av dd input current i ref -0.51.01.0 ma conversion time t conv --4020 m s
hyundai microelectronics gms82512/16/24 feb. 2000 ver 1.00 11 7.4 dc electrical characteristics (t a =-20~85 c, v dd =2.7~5.5v, ta= -20~85 c, f xin =8mhz, v ss =0v) , analog power supply input range av dd 0.9v dd v dd 1.1v dd v 1. data in typ column is at 25 c unless otherwise stated. these parameters are for design guidance only and are not tested. parameter symbol condition specifications unit min. typ. 1 1. data in typ. column is at 4.5v, 25 c unless otherwise stated. these parameters are for design guidance only and are not tested. max. input high voltage v ih1 v dd =4.5 v dd =2.7 x in , reset , r4, r5, r6 0.8v dd - v dd +0.3 v v ih2 r0, r2, r3 0.7v dd - v dd +0.3 input low voltage v il1 v dd =4.5 v dd =2.7 x in , reset , r4, r5, r6 - 0.2v dd v v il2 r0, r2, r3 - 0.3v dd output high voltage v oh v dd =4.5 v dd =2.7 i oh1 =-2ma r0,r2,r3,r4,r5 r6 v dd -1.0 --v output low voltage v ol v dd =4.5 v dd =2.7 i ol1 =5ma r0,r2,r3,r4,r5 r6 - -1.0v power fail detect voltage v pfd v pfd =3.0v v pfd =2.4v @ t a =25 c0.9v pfd 1.1v pfd v input high leakage current i ih1 v in =v dd all input pins -5.0 - 5.0 m a input low leakage current i il v in =v ss all input pins -5.0 - 5.0 m a hysteresis v t+ , v t- reset , ec0 , sin, sclk, int0~int3 0.3 0.8 v power current i dd1 f xin =8mhz all input = v ss c rystal o scillator, c l1 =c l2 =30pf@8mhz -820ma i dd2 f xin =4mhz 410ma i stop all input = v ss -110 m a parameter symbol specifications unit min. typ. 1 max. f xin =4mhz f xin =8mhz
gms82512/16/24 hyundai microelectronics 12 feb. 2000 ver 1.00 7.5 ac characteristics (t a =-20~+85 c, v dd =5v 10%, v ss =0v) figure 7-1 timing chart parameter symbol pins specifications unit min. typ. max. operating frequency f xin x in 1.0 - 10.0 mhz oscillation stabilizing time t st x in , x out --20ms external clock pulse width t cpw x in 40 - - ns external clock transi- tion time t rcp, t fcp x in --20ns interrupt pulse width t iw int0, int1, int2, int3 2 - - t sys reset input width t rst reset 8- - t sys event counter input pulse width t ecw ec0 2- - t sys event counter transi- tion time t rec, t fec ec0 --20ns t rcp t fcp xin int0~int3 0.5v v dd -0.5v 0.2v dd 0.8v dd 0.2v dd reset t rec t fec 0.2v dd 0.8v dd ec0 t iw t iw t rst t ecw t ecw t sys = 1/f xin t cpw t cpw
hyundai microelectronics gms82512/16/24 feb. 2000 ver 1.00 13 7.6 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 dd range). this is for information only and devices are guaranteed to operate properly only within the specified range. the data presented in this section is a statistical summary of data collected on units from different lots over a period of time. typical represents the mean of the distribution while max or min represents (mean + 3 s ) and (mean - 3 s ) respectively where s is standard deviation v dd - v ih2 4 3 2 1 0 (v) v ih2 23 45 6 v dd (v) v dd - v ih1 4 3 2 1 0 (v) v ih1 23 45 6 v dd (v) ta=25 c 1 f xin =8mhz ta=25 c f xin =8mhz xin, reset , r0, r2, r3 pins i oh - v oh -12 -9 -6 -3 0 0.3 0.6 0.9 1.2 1.5 (v) ta=25 c v dd =4.5v r0~r6 pins (ma) i oh v dd -v oh i ol - v ol1 20 15 10 5 0 (ma) i ol 0.2 0.4 0.6 0.8 1.0 v ol (v) ta=25 c v dd =4.5v r0~r6 pins i oh - v oh -12 -9 -6 -3 0 0.3 0.6 0.9 1.2 1.5 (v) ta=25 c v dd =3.0v r0~r6 pins (ma) i oh v dd -v oh i ol - v ol2 20 15 10 5 0 (ma) i ol 0.2 0.4 0.6 0.8 1.0 v ol (v) ta=25 c v dd =3.0v r0~r6 pins r4, r5, r6 pins
gms82512/16/24 hyundai microelectronics 14 feb. 2000 ver 1.00 ta= -20~85 c ta=25 c i dd - v dd 20 15 10 5 0 (ma) i dd 23 45 6 v dd (v) normal operation 10 6 4 2 0 (mhz) f xin 23 45 6 v dd (v) operating area i stop - v dd 0.4 0.3 0.2 0.1 0 ( m a) i dd 23 45 6 v dd (v) stop mode 85 c 25 c -20 c f xin = 8mhz 4mhz v dd - v il2 4 3 2 1 0 (v) v il2 23 45 6 v dd (v) v dd - v il1 4 3 2 1 0 (v) v il2 23 45 6 v dd (v) ta=25 c 1 f xin =8mhz ta=25 c f xin =8mhz r0, r2, r3 pins 8 xin, reset , r4, r5, r6 pins
hyundai microelectronics gms82512/16/24 feb. 2000 ver 1.00 15 8. memory organization the gms82512/16/24 has separate address spaces for pro- gram memory and data memory. program memory can only be read, not written to. it can be up to 24k bytes of program memory. data memory can be read and written to up to 448 bytes including the stack area. 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). the program counter consists of 16-bit register. figure 8-1 configuration of registers accumulator: the accumulator is the 8-bit general pur- pose register, used for data operation such as transfer, tem- porary saving, and conditional judgement, etc. the accumulator can be used as a 16-bit register with y register as shown below. figure 8-2 configuration of ya 16-bit register x, y registers : in the addressing mode which uses these index registers, the register contents are added to the spec- ified address, which becomes the actual address. these modes are extremely effective for referencing subroutine tables and memory tables. the index registers also have in- crement, decrement, comparison and data transfer func- tions, and they can be used as simple accumulators. stack pointer : the stack pointer is an 8-bit register used for occurrence interrupts and calling out subroutines. stack pointer identifies the location in the stack to be accessed (save or restore). generally, sp is automatically updated when a subroutine call is executed or an interrupt is accepted. however, if it is used in excess of the stack area permitted by the data memory allocating configuration, the user-processed data may be lost. the stack can be located at any position within 100 h to 1ff h of the internal data memory. the sp is not initialized by hardware, requiring to write the initial value (the loca- tion with which the use of the stack starts) by using the ini- tialization routine. normally, the initial value of fe h is used. note: the stack pointer must be initialized by software be- cause its value is undefined after reset. example: to initialize the sp ldx #0feh txsp ; sp ? feh address 01ff h can not be used as stack. don not use 1ff h , or malfunction would be occurred. program counter : the program counter is a 16-bit wide which consists of two 8-bit registers, pch and pcl. this counter indicates the address of the next instruction to be executed. in reset state, the program counter has reset rou- tine address (pc h :0ff h , pc l :0fe h ). program status word : the program status word (psw) contains several bits that reflect the current state of the cpu. the psw is described in figure 8-3. it contains the negative flag, the overflow flag, the break flag the half carry (for bcd operation), the interrupt enable flag, the zero flag, and the carry flag. [carry flag c] this flag stores any carry or not borrow from the alu of cpu after an arithmetic operation and is also changed by the shift instruction or rotate instruction. accumulator x register y register stack pointer program counter program status word x a sp y pcl psw pch two 8-bit registers can be used as a ya 16-bit register y a y a sp 01 h stack address (100 h ~ 1fe h ) bit 15 bit 0 87 hardware fixed 00 h ~fe h
gms82512/16/24 hyundai microelectronics 16 feb. 2000 ver 1.00 [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. figure 8-3 psw (program status word) register [interrupt disable flag i] this flag enables/disables all interrupts except interrupt caused by reset or software brk instruction. all inter- rupts are disabled when cleared to 0. this flag immedi- ately becomes 0 when an interrupt is served. it is set by the ei instruction and cleared by the di instruction. [half carry flag h] after operation, this is set when there is a carry from bit 3 of alu or there is no borrow from bit 4 of alu. this bit can not be set or cleared except clrv instruction with overflow flag (v). [break flag b] this flag is set by software brk instruction to distinguish brk from tcall instruction with the same vector ad- dress. [direct page flag g] this flag assigns ram page for direct addressing mode. in the direct addressing mode, addressing area is from zero page 00 h to 0ff h when this flag is "0". if it is set to "1", addressing area is assigned 100 h to 1ff h . it is set by setg instruction and cleared by clrg. [overflow flag v] this flag is set to 1 when an overflow occurs as the result of an arithmetic operation involving signs. an overflow occurs when the result of an addition or subtraction ex- ceeds +127(7f h ) or -128(80 h ). the clrv instruction clears the overflow flag. there is no set instruction. when the 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. n negative flag v g b h i z c msb lsb reset value: 00 h psw overflow flag brk flag carry flag receives zero flag interrupt enable flag carry out half carry flag receives carry out from bit 1 of addition operlands select direct page when g=1, page is selected to page 1
hyundai microelectronics gms82512/16/24 feb. 2000 ver 1.00 17 figure 8-4 stack operation at execution of a call/tcall/pcall pcl pch 01fb sp after execution sp before execution 01fc 01fc 01fd 01fe 01fe push down at acceptance of interrupt pcl pch 01fb 01fb 01fc 01fd 01fe 01fe push down psw at execution of ret instruction pcl pch 01fb 01fe 01fc 01fd 01fe 01fc pop up at execution of ret instruction pcl pch 01fb 01fe 01fc 01fd 01fe 01fb pop up psw 0100h 01feh stack depth at execution of push instruction a 01fb 01fd 01fc 01fd 01fe 01fe push down sp after execution sp before execution push a (x,y,psw) at execution of pop instruction a 01fb 01fe 01fc 01fd 01fe 01fd pop up pop a (x,y,psw)
gms82512/16/24 hyundai microelectronics 18 feb. 2000 ver 1.00 8.2 program memory a 16-bit program counter is capable of addressing up to 64k bytes, but this device has 24k bytes program memory space only physically implemented. accessing a location above ffff h will cause a wrap-around to 0000 h . figure 8-5, shows a map of program memory. after reset, the cpu begins execution from reset vector which is stored in address fffe h and ffff h as shown in figure 8-6. as shown in figure 8-5, each area is assigned a fixed loca- tion in program memory. program memory area contains the user program. figure 8-5 program memory map page call (pcall) area contains subroutine program to reduce program byte length by using 2 bytes pcall in- stead of 3 bytes call instruction. if it is frequently called, it is more useful to save program byte length. table call (tcall) causes the cpu to jump to each tcall address, where it commences the execution of the service routine. the table call service area spaces 2-byte for every tcall: 0ffc0 h for tcall15, 0ffc2 h for tcall14, etc., as shown in figure 8-7. example: usage of tcall the interrupt causes the cpu to jump to specific location, where it commences the execution of the service routine. the external interrupt 0, for example, is assigned to loca- tion 0fffa h . the interrupt service locations spaces 2-byte interval: 0fff8 h and 0fff9 h for external interrupt 1, 0fffa h and 0fffb h for external interrupt 0, etc. any area from 0ff00 h to 0ffff h , if it is not going to be used, its service location is available as general purpose program memory. figure 8-6 interrupt vector area interrupt vector area c000 h feff h ff00 h ffc0 h ffdf h ffe0 h ffff h pcall area d000 h a000 h tcall area gms82512, 12k rom gms82516, 16k rom gms82524, 24k rom 0ffe0h e2 address vector area memory e4 e6 e8 ea ec ee f0 f2 f4 f6 f8 fa fc fe - - - basic interval timer - - - external interrupt 2 timer/counter 1 interrupt external interrupt 0 - reset vector area external interrupt 1 watchdog timer interrupt - means reserved area. note: timer/counter 2 interrupt external interrupt 3 timer/counter 0 interrupt timer/counter 3 interrupt a/d converter
hyundai microelectronics gms82512/16/24 feb. 2000 ver 1.00 19 figure 8-7 pcall and tcall memory area pcall ? ? ? ? rel 4f35 pcall 35h tcall ? ? ? ? n 4a tcall 4 0ffc0 h c1 address program memory c2 c3 c4 c5 c6 c7 c8 0ff00 h address pcall area memory 0ffff h pcall area (256 bytes) * means that the brk software interrupt is using same address with tcall0. note: tcall 15 tcall 14 tcall 13 tcall 12 tcall 11 tcall 10 tcall 9 tcall 8 tcall 7 tcall 6 tcall 5 tcall 4 tcall 3 tcall 2 tcall 1 tcall 0 / brk * c9 ca cb cc cd ce cf d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 da db dc dd de df 4f ~ ~ ~ ~ next 35 0ff35 h 0ff00 h 0ffff h 11111111 11010110 01001010 pc: fh fh dh 6h 4a ~ ~ ~ ~ 25 0ffd6 h 0ff00 h 0ffff h d1 next 0ffd7 h ? 0d125 h reverse
gms82512/16/24 hyundai microelectronics 20 feb. 2000 ver 1.00 example: the usage software example of vector address for gms82524. org 0ffe0h dw not_used dw not_used dw not_used dw bit_timer ; basic interval timer dw wd_timer ; watchdog timer dw adc ; adc dw timer3 ; timer-3 dw timer2 ; timer-2 dw timer1 ; timer-1 dw timer0 ; timer-0 dw int3 ; int.3 dw int2 ; int.2 dw int1 ; int.1 dw int0 ; int.0 dw not_used ; - dw reset ; reset org 0a000h ; 24k rom start address ; org 0c000h ; 16k rom start address ; org 0d000h ; 12k rom start address ;******************************************* ; main program * ;******************************************* ; reset: di ;disable all interrupts clrg ldx #0 ram_clr: lda #0 ;ram clear(!0000h->!00bfh) sta {x}+ cmpx #0c0h bne ram_clr ; ldx #0feh ;stack pointer initialize txsp ; ldm r0, #0 ;normal port 0 ldm r0dd,#82h ;normal port direction : : : ldm tdr0,#250 ;8us x 250 = 2000us ldm tm0,#1fh ;start timer0, 8us at 8mhz ldm irqh,#0 ldm irql,#0 ldm ienh,#0c8h ;enable timer0, int0, int1 ldm ienl,#0 ldm ieds,#55h ;select falling edge detect on int pin ldm pmr4,#3h ;set external interrupt pin(int0, int1) ei ;enable master interrupt : : : : : not_used:nop reti
hyundai microelectronics gms82512/16/24 feb. 2000 ver 1.00 21 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. figure 8-8 data memory map user memory the gms825xx has 448 8 bits for the user memory (ram). control registers the control registers are used by the cpu and peripheral function blocks for controlling the desired operation of the device. therefore these registers contain control and status bits for the interrupt system, the timer/ counters, analog to digital converters and i/o ports. the control registers are in address range of 0c0 h to 0ff h . note that unoccupied addresses may not be implemented on the chip. read accesses to these addresses will in gen- eral return random data, and write accesses will have an in- determinate effect. more detailed informations of each register are explained in each peripheral section. note: write only registers can not be accessed by bit ma- nipulation instruction. do not use read-modify-write instruc- tion. use byte manipulation instruction, for example ldm. example; to write at ckctlr ldm clctlr,#09h ;divide ratio( ? 32) stack area the stack provides the area where the return address is saved before a jump is performed during the processing routine at the execution of a subroutine call instruction or the acceptance of an interrupt. when returning from the processing routine, executing the subroutine return instruction [ret] restores the contents of the program counter from the stack; executing the interrupt return instruction [reti] restores the contents of the pro- gram counter and flags. the save/restore locations in the stack are determined by the stack pointed (sp). the sp is automatically decreased after the saving, and increased before the restoring. this means the value of the sp indicates the stack location number for the next save. refer to figure 8-4 on page 17. user memory control registers or stack area 0000 h 00bf h 00c0 h 00ff h 0100 h 01ff h page0 user memory page1 when g-flag=0, when g-flag=1 this page is selected
gms82512/16/24 hyundai microelectronics 22 feb. 2000 ver 1.00 address register name symbol r/w initial value page 76543210 00c0 r0 port data register r0 r/w undefined page 28 00c1 r0 port i/o direction register r0dd w 0 0 0 0 0 0 0 0 page 28 00c4 r2 port data register r2 r/w undefined page 28 00c5 r2 port i/o direction register r2dd w 0 0 0 0 0 0 0 0 page 28 00c6 r3 port data register r3 r/w undefined page 28 00c7 r3 port i/o direction register r3dd w 0 0 0 0 0 0 0 0 page 28 00c8 r4 port data register r4 r/w undefined page 29 00c9 r4 port i/o direction register r4dd w - - - 0 0 0 0 0 page 29 00ca r5 port data register r5 r/w undefined page 30 00cb r5 port i/o direction register r5dd w - - 0 0 - - - - page 30 00cc r6 port data register r6 r/w undefined page 30 00cd r6 port i/o direction register r6dd w 0 0 0 0 - - - - page 30 00d0 r4 port mode register pmr4 w - - - 0 0 0 0 0 page 29, page 53 00d1 r5 port mode register pmr5 w - - 0 0 - - - - page 30, page 45 00d3 basic interval timer mode register bitr r undefined page 32 clock control register ckctlr w - - 0 1 0 1 1 1 page 32 00e0 watchdog timer register wdtr w - 0 1 1 1 1 1 1 page 54 00e2 timer mode register 0 tm0 r/w 0 0 0 0 0 0 0 0 page 34 00e3 timer mode register 2 tm2 r/w 0 0 0 0 0 0 0 0 page 34 00e4 timer 0 data register tdr0 w undefined page 34 timer 0 counter register t0 r undefined page 34 00e5 timer 1 data register tdr1 w undefined page 34 timer 1 counter register t1 r undefined page 34 00e6 timer 2 data register tdr2 w undefined page 34 timer 2 counter register t2 r undefined page 34 00e7 timer 3 data register tdr3 w undefined page 34 timer 3 counter register t3 r undefined page 34 00e8 a/d converter mode register adcm r/w - - 0 0 0 0 0 1 page 44 00e9 a/d converter data register adr r undefined page 44 00ec buzzer driver register bur w undefined page 45 00f4 interrupt enable register low ienl r/w 0 0 0 - - - - - page 48 00f5 interrupt request flag register low irql r/w 0 0 0 - - - - - page 47 00f6 interrupt enable register high ienh r/w 0 0 0 0 0 0 0 0 page 48 00f7 interrupt request flag register high irqh r/w 0 0 0 0 0 0 0 0 page 47 00f8 external interrupt edge selection register ieds w 0 0 0 0 0 0 0 0 page 53 table 8-1 control registers
hyundai microelectronics gms82512/16/24 feb. 2000 ver 1.00 23 00f9 power fail detection register pfdr r/w - - - - 1 1 0 0 page 61 address register name symbol r/w initial value page 76543210 table 8-1 control registers registers are controlled by byte manipulation instruction such as ldm etc., do not use bit manipulation w registers are controlled by both bit and byte manipulation instruction. r/w instruction such as set1, clr1 etc. if bit manipulation instruction is used on these registers, content of other seven bits are may varied to unwanted value. - : this bit location is reserved.
gms82512/16/24 hyundai microelectronics 24 feb. 2000 ver 1.00 8.4 addressing mode the gms800 series mcu uses six addressing modes; ? register addressing ? immediate addressing ? direct page addressing ? absolute addressing ? indexed addressing ? register-indirect addressing (1) register addressing register addressing accesses the a, x, y, c and psw. (2) immediate addressing ? ? ? ? #imm in this mode, second byte (operand) is accessed as a data immediately. example: 0435 adc #35h when g-flag is 1, then ram address is defined by 16-bit address which is composed of 8-bit ram paging register (rpr) and 8-bit immediate data. example: g=1 e45535 ldm 35h,#55h (3) direct page addressing ? ? ? ? dp in this mode, a address is specified within direct page. example; g=0 c535 lda 35h ;a ? ram[35h] 35 a+35h+c ? a 04 memory e4 0f100h data 55h ~ ~ ~ ~ data 0135h 35 0f102h 55 0f101h ? data 35 35h 0e551h data ? a ? ~ ~ ~ ~ c5 0e550h
hyundai microelectronics gms82512/16/24 feb. 2000 ver 1.00 25 (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, it is possible to access to whole memory area. adc, and, cmp, cmpx, cmpy, eor, lda, ldx, ldy, or, sbc, sta, stx, sty example; 0735f0 adc !0f035h ;a ? rom[0f035h] the operation within data memory (ram) asl, bit, dec, inc, lsr, rol, ror example; addressing accesses the address 0135 h regard- less of g-flag. 983501 inc !0135h ;a ? rom[135h] (5) indexed addressing x indexed direct page (no offset) ? ? ? ? {x} in this mode, a address is specified by the x register. adc, and, cmp, eor, lda, or, sbc, sta, xma example; x=15 h , g=1 d4 lda {x} ;acc ? ram[x]. x indexed direct page, auto increment ? ? ? ? {x}+ in this mode, a address is specified within direct page by the x register and the content of x is increased by 1. lda, sta example; g=0, x=35 h db lda {x}+ x indexed direct page (8 bit offset) ? ? ? ? dp+x this address value is the second byte (operand) of com- mand plus the data of  -register. and it assigns the mem- ory in direct page. adc, and, cmp, eor, lda, ldy, or, sbc, sta sty, xma, asl, dec, inc, lsr, rol, ror example; g=0, x=0f5 h 07 0f100h ~ ~ ~ ~ data 0f035h f0 0f102h 35 0f101h ? a+data+c ? a address: 0f035 98 0f100h ~ ~ ~ ~ data 135h 01 0f102h 35 0f101h ? data+1 ? data address: 0135 data d4 115h 0e550h data ? a ? ~ ~ ~ ~ data db 35h data ? a ? ~ ~ ~ ~ 36h ? x
gms82512/16/24 hyundai microelectronics 26 feb. 2000 ver 1.00 c645 lda 45h+x y indexed direct page (8 bit offset) ? ? ? ? dp+y this address value is the second byte (operand) of com- mand plus the data of y-register, which assigns memory in direct page. this is same with above (2). use y register instead of x. y indexed absolute ? ? ? ? !abs+y sets the value of 16-bit absolute address plus y-register data as memory.this addressing mode can specify memo- ry in whole area. example; y=55 h d500fa lda !0fa00h+y (6) indirect addressing direct page indirect ? ? ? ? [dp] assigns data address to use for accomplishing command which sets memory data (or pair memory) by operand. also index can be used with index register x,y. jmp, call example; g=0 3f35 jmp [35h] x indexed indirect ? ? ? ? [dp+x] processes memory data as data, assigned by 16-bit pair memory which is determined by pair data [dp+x+1][dp+x] operand plus  x-register data in direct page. adc, and, cmp, eor, lda, or, sbc, sta example; g=0, x=10 h 1625 adc [25h+x] y indexed indirect ? ? ? ? [dp]+y processes memory data as data, assigned by the data [dp+1][dp] of 16-bit pair memory paired by operand in di- rect page  plus y-register data. adc, and, cmp, eor, lda, or, sbc, sta example; g=0, y=10 h data 45 3ah 0e551h data ? a ? ~ ~ ~ ~ c6 0e550h 45h+0f5h=13ah d5 0f100h data ? a ~ ~ ~ ~ data 0fa55h 0fa00h+55h=0fa55h fa 0f102h 00 0f101h ? 0a 35h jump to ~ ~ ~ ~ 35 0fa00h e3 36h ? 3f 0e30ah next ~ ~ ~ ~ address 0e30ah 05 35h 0e005h ~ ~ ~ ~ 25 0fa00h e0 36h 16 0e005h data ~ ~ ~ ~ a + data + c ? a 25 + x(10) = 35 h ?
hyundai microelectronics gms82512/16/24 feb. 2000 ver 1.00 27 1725 adc [25h]+y absolute indirect ? ? ? ? [!abs] the program jumps to address specified by 16-bit absolute address. jmp example; g=0 1f25e0 jmp [!0c025h] 05 25h 0e005h + y(10) ~ ~ ~ ~ 25 0fa00h e0 26h ? 17 0e015h data ~ ~ ~ ~ = 0e015h a + data + c ? a 25 0e025h jump to ~ ~ ~ ~ e0 0fa00h e7 0e026h ? 25 0e725h next ~ ~ ~ ~ 1f program memory address 0e30ah
gms82512/16/24 hyundai microelectronics 28 feb. 2000 ver 1.00 9. i/o ports the gms825xx has six ports (r0, r2, r3, r4, r5, and r6).these ports pins may be multiplexed with an alternate function for the peripheral features on the device. all pins have data direction registers which can define these ports as output or input. a 1 in the port direction register configure the corresponding port pin as output. conversely, write 0 to the corresponding bit to specify it as input pin. for example, to use the even numbered bit of r0 as output ports and the odd numbered bits as input ports, write 55 h to address 0c1 h (r0 port direction reg- ister) during initial setting as shown in figure 9-1. all the port direction registers in the gms825xx have 0 written to them by reset function. on the other hand, its in- itial status is input. figure 9-1 example of port i/o assignment r0 and r0dd register: r0 is an 8-bit cmos bidirection- al i/o port (address 0c0 h ). each i/o pin can independently used as an input or an output through the r0dd register (address 0c1 h ). r2 and r2dd register: r2 is an 8-bit cmos bidirection- al i/o port (address 0c4 h ). each i/o pin can independently used as an input or an output through the r2dd register (address 0c5 h ). r3 and r3dd register: r3 is an 8-bit cmos bidirection- al i/o port (address 0c6 h ). each i/o pin can independently used as an input or an output through the r3dd register (address 0c7 h ). i: input port write 55 h to port r0 direction register 0 1 0 1 0 1 0 1 i o i o i o i o r0 data r1 data r0 direction r1 direction 0c0 h 0c1 h 0c2 h 0c3 h 76543210 bit 76543210 port o: output port r0 data register r0 address: 0c0 h reset value: undefined r07 r06 r05 r04 r03 r02 r01 r00 port direction r0 direction register r0dd address: 0c1 h reset value: 00 h 0: input 1: output input / output data r2 data register r2 address: 0c4 h reset value: undefined r27 r26 r25 r24 r23 r22 r21 r20 port direction r2 direction register r2dd address: 0c5 h reset value: 00 h 0: input 1: output input / output data r3 data register r3 address: 0c6 h reset value: undefined r37 r36 r35 r34 r33 r32 r31 r30 port direction r3 direction register r3dd address: 0c7 h reset value: 00 h 0: input 1: output input / output data
hyundai microelectronics gms82512/16/24 feb. 2000 ver 1.00 29 r4 and r4dd register: r4 is an 5-bit cmos bidirection- al i/o port (address 0c8 h ). each i/o pin can independently used as an input or an output through the r4dd register (address 0c9 h ). in addition, port r4 is multiplexed with various special features. the control register pmr4 (address 0d0 h ) con- trols the selection of alternate function. after reset, this value is 0, port may be used as normal i/o port. to use alternate function such as external interrupt or ex- ternal counter input, write 1 in the corresponding bit of pmr4. regardless of the direction register r4dd, pmr4 is select- ed to use as alternate functions, port pin can be used as a corresponding alternate features. r4 port mode register pmr4 address: 0d0 h reset value: 00 h 0: r40 1: int0 0 0: r41 1: int1 0: r42 1: int2 0: r43 1: int3 0: r44 1: ec0 1 2 3 4 edge selection register ieds address: 0f8h reset value: 00h 0 1 2 3 4 5 6 7 int0 int1 int2 int3 external interrupt edge select 00: reserved 01: falling (1-to-0 transition) 10: rising (0-to-1 transition) 11: both (rising & falling) r4 data register r4 address: 0c8 h reset value: undefined - --r44r43 r42 r41 r40 port direction r4 direction register r4dd address: 0c9 h reset value: 00 h 0: input 1: output input / output data --- --- port pin alternate function r40 r41 r42 r43 r44 int0 (external interrupt 0) int1 (external interrupt 1) int2 (external interrupt 2) int3 (external interrupt 3) ec0 (external count input to timer/ counter 0)
gms82512/16/24 hyundai microelectronics 30 feb. 2000 ver 1.00 r5 and r5dd register: r5 is an 2-bit cmos bidirection- al i/o port (address 0ca h ). each i/o pin can independent- ly used as an input or an output through the r5dd register (address 0cb h ). the control register pmr5 (address d1 h ) controls the se- lection alternate function. after reset, this value is 0, port may be used as general i/o ports. to use buzzer function, write 1 to the pmr5 and the pin r55 must be defined as output mode (the bit 5 of r5dd=1) r6 and r6dd register: r6 is an 4-bit cmos bidirection- al i/o port (address 0cc h ). each i/o pin can independent- ly used as an input or an output through the r6dd register (address 0cd h ). r6dd (address cd h ) controls the direction of the r6 pins, even when they are being used as analog inputs. the user must make sure to keep the pins configured as inputs when using them as analog inputs. port pin alternate function r54 r55 wdto (watchdog timer output) buz (square-wave output for buzzer) r5 port mode register pmr5 address: 0d1 h reset value: --00---- b - - - - r54/wdto selection buz - - 0: r54 1: wdto (output) r55/buz selection 0: r55 1: buz (output) wdto r5 data register r5 address: 0ca h reset value: undefined - - r55 r54 - - - - port direction r5 direction register r5dd address: 0cb h reset value: 00 h 0: input 1: output input / output data - - - - - - port pin alternate function r64 r65 r66 r67 an4 (adc input 4) an5 (adc input 5) an6 (adc input 6) an7 (adc input 7) r6 data register r6 address: 0cc h reset value: undefined r67 r66 r65 r64 port direction r6 direction register r6dd address: 0cd h reset value: 0000---- b 0: input 1: output input / output data ---- -- --
hyundai microelectronics gms82512/16/24 feb. 2000 ver 1.00 31 10. basic interval timer the gms825xx has one 8-bit basic interval timer that is free-run and can not stop. block diagram is shown in fig- ure 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 from ff h to 00 h , this overflow causes the interrupt to be generated. the basic interval timer is controlled by the clock control register (ckctlr) shown in figure 10-2. source clock can be selected by lower 3 bits of ckctlr. bitr and ckctlr are located at same address, and ad- dress 0d3 h is read as a bitr, and written to ckctlr. figure 10-1 block diagram of basic interval timer table 10-1 basic interval timer interrupt time mux basic interval timer interrupt bitr select input clock 3 basic interval timer source clock 8-bit up-counter bts[2:0] btcl ? 2048 ? 1024 ? 512 ? 256 ? 128 ? 64 ? 32 ? 16 to watchdog timer (wdtck) ckctlr clear overflow internal bus line clock control register [0d3 h ] [0f9 h ] bitif read x in pin prescaler ckctlr [2:0] source clock interrupt (overflow) period (ms) @ f xin = 8mhz 000 001 010 011 100 101 110 111 f xin ? 16 f xin ? 32 f xin ? 64 f xin ? 128 f xin ? 256 f xin ? 512 f xin ? 1024 f xin ? 2048 0.512 1.024 2.048 4.096 8.192 16.384 32.768 65.536
gms82512/16/24 hyundai microelectronics 32 feb. 2000 ver 1.00 figure 10-2 bitr: basic interval timer mode register example 1: interrupt request flag is generated every 8.192ms at 4mhz. : ldm ckctlr,#1bh set1 bite ei : example 2: interrupt request flag is generated every 8.192ms at 8mhz. : ldm ckctlr,#1ch set1 bite ei : btcl 76543210 wdton - - bts1 basic interval timer source clock select 000: f xin ? 16 001: f xin ? 32 010: f xin ? 64 011: f xin ? 128 100: f xin ? 256 101: f xin ? 512 110: f xin ? 1024 111: f xin ? 2048 clear bit 0: normal operation (free-run) 1: clear 8-bit counter (bitr) to 0. this bit becomes 0 automatically initial value: --01 0111 b address: 0d3 h after one machine cycle, and starts counting. ckctlr initial value: undefined address: 0d3 h bitr both register are in same address, when write, to be a ckctlr, when read, to be a bitr. caution: 8-bit free-run binary counter enpck bts0 bts2 btcl btcl 76543210 enable peripheral clock 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.
hyundai microelectronics gms82512/16/24 feb. 2000 ver 1.00 33 11. timer/event counter the gms825xx 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. and timer 2 and timer 3 are can be used either two 8-bit timer or one 16-bit timer with combine them. in the timer function, the register is increased every in- ternal clock input. thus, one can think of it as counting in- ternal clock input. since a least clock consists of 4 and most clock consists of 64 oscillator periods, the count rate is 1/4 to 1/64 of the oscillator frequency. in the counter function, the register is incremented in re- sponse to a 1-to-0 (falling edge) transition at its corre- sponding external input pin, ec0 . in addition the capture function, the register is incre- mented in response external or internal clock sources same with timer or counter function. when external clock edge input, the count register is captured into timer data register correspondingly. it has four operating modes: 8-bit timer/counter, 16-bit timer/counter, 8-bit capture, 16-bit capture which are selected by bit in timer mode register tm0 and tm2 as shown in table 11-1. in operation of timer 2, timer 3, their operations are same with timer 0, timer 1, respectively as shown in table 11- 2. tm0 timer 0 timer 1 cap 0 t1st t1sl [1:0] t0st t0cn t0sl[1:0] 0x 01 or 10 or 11 x x 01 or 10 or 11 8-bit timer 8-bit timer 0 x x x 00 8-bit event counter 8-bit timer 1 x x x 01 or 10 or 11 8-bit capture (internal clock) 8-bit timer 1 x x x 00 8-bit capture (external clock) 8-bit timer 0x 00 x x 01 or 10 or 11 16-bit timer 0 x x x 00 16-bit event counter 1 x x x 01 or 10 or 11 16-bit capture (internal clock) 1 x x x 00 16-bit capture (external clock) table 11-1 tm0 timer mode register tm2 timer 2 timer 3 cap 2 t3st t3sl [1:0] t2st t2cn t2sl[1:0] 0x 01 or 10 or 11 x x 01 or 10 or 11 8-bit timer 8-bit timer 0 x x x 00 reserved 8-bit timer 1 x x x 01 or 10 or 11 8-bit capture (internal clock) 8-bit timer 1 x x x 00 8-bit capture (external clock) 8-bit timer 0x 00 x x 01 or 10 or 11 16-bit timer 0 x x x 00 16-bit event counter 1 x x x 01 or 10 or 11 16-bit capture (internal clock) 1 x x x 00 16-bit capture (external clock) table 11-2 tm2 timer mode register
gms82512/16/24 hyundai microelectronics 34 feb. 2000 ver 1.00 figure 11-1 tm0, tm2 registers btcl 76543210 t3st cap2 t2sl1 initial value: 00 h address: 0e3 h tm2 t2sl0 t2cn t2st t3sl1 t3sl0 bit name bit posi- tion description cap2 tm2.7 0: timer/counter mode 1: capture mode selection flag t3st tm2.6 0: when cleared, stop the counting. 1: when set, timer 3 count register is cleared and start again. t3sl1 t3sl0 tm2.5 tm2.4 00: 16-bit mode (clock source is selected by t2sl1, t2sl0) 01: 8-bit mode, clock source is f xin ? 4 10: 8-bit mode, clock source is f xin ? 16 11: 8-bit mode, clock source is f xin ? 64 t2st tm2.3 0: when cleared, stop the counting. 1: when set, timer 2 count register is cleared and start again. t2cn tm2.2 0: stop the timer 1: a logic 1 starts the timer. t2sl1 t2sl0 tm2.1 tm2.0 00: reserved 01: 8-bit timer, clock source is f xin ? 4 10: 8-bit timer, clock source is f xin ? 16 11: 8-bit timer, clock source is f xin ? 64 timer 2 btcl 76543210 t1st cap0 t0sl1 initial valu e: 00 h address: 0e2 h tm0 t0sl0 t0cn t0st t1sl1 t1sl0 bit name bit position description cap0 tm0.7 0: timer/counter mode 1: capture mode selection flag t1st tm0.6 0: when cleared, stop the counting. 1: when set, timer 1 count register is cleared and start again. t1sl1 t1sl0 tm0.5 tm0.4 00: 16-bit mode (clock source is selected by t0sl1, t0sl0) 01: 8-bit mode, clock source is f xin ? 4 10: 8-bit mode, clock source is f xin ? 16 11: 8-bit mode, clock source is f xin ? 64 t0st tm0.3 0: when cleared, stop the counting. 1: when set, timer 0 count register is cleared and start again. t0cn tm0.2 0: stop the timer 1: a logic 1 starts the timer. t0sl1 t0sl0 tm0.1 tm0.0 00: ec0 (external clock) 01: 8-bit timer, clock source is f xin ? 4 10: 8-bit timer, clock source is f xin ? 16 11: 8-bit timer, clock source is f xin ? 64 timer 1 timer 0 76543210 initial value: undefined address: 0e4 h ~ 0e7 h tdr0~tdr3 read: count value read write: compare data write r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w timer 3
hyundai microelectronics gms82512/16/24 feb. 2000 ver 1.00 35 11.1 8-bit timer / counter mode the gms825xx 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- 2. to use as an 8-bit timer/counter mode, bit cap0 of tm0 is cleared to 0 and bits t1sl1, t1sl0 of tm0 or bits t3sl1, t3sl0 of tm2 should not set to zero. these timers have each 8-bit count register and data register. the count register is increased by every internal or external clock in- put. the internal clock has a prescaler divide ratio option of 4, 16, 64 (selected by control bits txsl1, txsl0 of reg- ister tmx). figure 11-2 8-bit timer/counter 0, 1 example 1: timer0 = 4ms 8-bit timer mode at 4mhz timer1 = 1ms 8-bit timer mode at 4mhz ldm tdr0,#250 ldm tdr1,#250 ldm tm0,#0110_1111b set1 t0e set1 t1e ei example 2: timer0 = 8-bit event counter mode timer1 = 1ms 8-bit timer mode at 4mhz ldm tdr0,#250 ldm tdr1,#250 ldm tm0,#0110_1100b set1 t0e set1 t1e ei ec0 pin ? 4 ? 16 ? 64 xin pin mux prescaler t0if clear 0: stop 1: clear and start t0st t0sl[1:0] 00 01 10 11 timer 0 interrupt t0cn mux t1if clear 0: stop 1: clear and start t1st t1sl[1:0] 01 10 11 timer 1 interrupt ? 4 ? 16 ? 64 tdr0 (8-bit) tdr1 (8-bit) t1 (8-bit) t0 (8-bit) comparator comparator timer 0 timer 1 t1o pin f/f btcl 76543210 t1st cap0 t0sl1 initial value: 00 h address: 0e2 h tm0 t0sl0 t0cn t0st t1sl1 t1sl0 0x xx x x x means dont care 01 or 10 or 11
gms82512/16/24 hyundai microelectronics 36 feb. 2000 ver 1.00 note: the contents of timer data register tdrx should be initialized 1 h ~ff h , not 0 h , because it is undefined after re- set. in the timer 0, timer register t0 increments from 00 h until it matches tdr0 and then reset to 00h. the match output of timer 0 generates timer 0 interrupt (latched in t0if bit) as tdrx and tx register are in same address, when read- ing it as a tx, written to tdrx. in counter function, the counter is increased every 1-to-0 (falling edge) transition of ec0 pin. in order to use counter function, the bit 4 of the port mode register pmr4 are set to 1. the timer 0 can be used as a counter by pin ec0 input, but timer 1 can input by internal clock. figure 11-3 8-bit timer/counter 2, 3 example 3: timer2 = 8-bit timer mode, 2ms interval at 8mhz timer3 = 8-bit timer mode, 500us interval at 8mhz ldm tdr2,#250 ldm tdr3,#250 ldm tm2,#0110_1111b set1 t2e set1 t3e ei example 4: timer2 = 8-bit event counter mode timer3 = 500us 8-bit timer mode at 8mhz ldm tdr2,#250 ldm tdr3,#250 ldm tm2,#0110_1100b set1 t2e set1 t3e ei ? 4 ? 16 ? 64 xin pin mux prescaler t2if clear 0: stop 1: clear and start t2st t2sl[1:0] 00 01 10 11 timer 2 interrupt t2cn mux t3if clear 0: stop 1: clear and start t3st t3sl[1:0] 01 10 11 timer 3 interrupt ? 4 ? 16 ? 64 tdr2 (8-bit) tdr3 (8-bit) t3 (8-bit) t2 (8-bit) comparator comparator timer 2 timer 3 t3o pin f/f btcl 76543210 t3st cap2 t2sl1 initial value: 00 h address: 0e3 h tm2 t2sl0 t2cn t2st t3sl1 t3sl0 0x xx x x x means dont care 01 or 10 or 11 reserved
hyundai microelectronics gms82512/16/24 feb. 2000 ver 1.00 37 8-bit timer mode in the timer mode, the internal clock is used for counting up. thus, you can think of it as counting internal clock in- put. the contents of tdr n are compared with the contents of up-counter, t n . if match is found, a timer 1 interrupt (t1if) is generated and the up-counter is cleared to 0. counting up is resumed after the up-counter is cleared. as the value of tdr n is changeable by software, time in- terval is set as you want  figure 11-4 timer mode timing chart figure 11-5 timer count example value of tm[1:0] clock source resolution (at f xin =8 mhz) maximum time setting (at f xin =8 mhz) 00 01 10 11 f ec1 f xin ? 4 f xin ? 16 f xin ? 64 1/f ec1 0.5 2 8 sec us us us 1/f ec1 256 128 512 2048 sec us us us table 11-1 timer source clock interrupt time 0 n-2 2 0 n 3 n-1 n source clock up-counter tdr1 t1if interrupt start count 1 23 1 4 match detect counter clear ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ timer 1 (t1if) interrupt tdr1 time occur interrupt occur interrupt occur interrupt interrupt period u p - c o u n t ~ ~ ~ ~ 0 1 2 3 4 5 6 7a 7d 7c count pulse = 8 m s x 125 7b match example: make 1ms  interrupt using by timer0 at 8mhz ldm tm0,#1fh ; divide by 64 ldm tdr0,#125 ; 8us x 125= 1ms set1 t0e ; enable timer 0 interrupt ei ; enable master interrupt period when tdr0 = 125 d = 7d h f xin = 8 mhz interrupt period = 8 106 hz 1 64 125 = 1 ms tm0 = 0001 1111 b (8-bit timer mode, prescaler divide ratio = 64) 8 m s (tdr0 = t0) 7d 0
gms82512/16/24 hyundai microelectronics 38 feb. 2000 ver 1.00 8-bit event counter mode in this mode, counting up is started by an external trigger. this trigger means falling edge of the ec0 pin input. source clock is used as an internal clock selected with tim- er mode register tm0. the contents of timer data register tdr n (n = 0,1) are compared with the contents of the up- counter t n . if a match is found, an timer interrupt request flag t n if is generated, and the counter is cleared to 0. the counter is restart and count up continuously by every falling edge of the ec0 pin input. the maximum frequency applied to the ec0 pin is f xin /2 [hz]. in order to use event counter function, the bit 4 of the port mode register pmr4(address 0d0 h ) is required to be set to 1. after reset, the value of timer data register tdr n is unde- fined, it should be initialized to between 1 h ~ff h  not to "0"the interval period of timer is calculated as below equation. figure 11-6 event counter mode timing chart figure 11-7 count operation of timer / event counter period (sec) 1 f xin ---------- - 2 divide ratio tdrn = 0 1 2 1 0 n 2 ~ ~ ~ ~ ~ ~ n-1 n ~ ~ ~ ~ ~ ~ ec0 pin input up-counter tdr1 t1if interrupt start count timer 1 (t1if) interrupt tdr1 time occur interrupt occur interrupt stop clear & start disable enable start & stop t1st t1cn control count u p-c oun t ~ ~ ~ ~ t1st = 0 t1st = 1 t1cn = 0 t1cn = 1
hyundai microelectronics gms82512/16/24 feb. 2000 ver 1.00 39 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 h until it matches tdr0, tdr1 and then resets to 0000 h . 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. even if the timer 0 (including the timer 1) is used as a 16- bit timer, the timer 2 and timer 3 can still be used as either two 8-bit timer or one 16-bit timer by setting the tm2. re- versely, even if the timer 2 (including the timer 3) is used as a 16-bit timer, the timer 0 and timer 1 can still be used as 8-bit timer independently. figure 11-8 16-bit timer/counter ec0 pin ? 4 ? 16 ? 64 xin pin mux prescaler t0if clear 0: stop 1: clear and start t0st t0sl[1:0] 00 01 10 11 timer 0 interrupt t0cn tdr1 + tdr0 comparator timer 0 + timer 1 ? timer 0 (16-bit) higher byte lower byte (16-bit) compare data t1 + t0 (16-bit) 1 0 (not timer 1 interrupt) edge detector btcl 76543210 t1st cap0 t0sl1 initial value: 00 h address: 0e2 h tm0 t0sl0 t0cn t0st t1sl1 t1sl0 0x xx x x 00 x means dont care ? 4 ? 16 ? 64 xin pin mux prescaler t2if clear 0: stop 1: clear and start t2st t2sl[1:0] 00 01 10 11 timer 2 interrupt t2cn tdr3 + tdr2 comparator timer 2 + timer 3 ? timer 2 (16-bit) higher byte lower byte (16-bit) compare data t3 + t2 (16-bit) 1 0 (not timer 3 interrupt) reserved btcl 76543210 t3st cap2 t2sl1 initial value: 00 h address: 0e3 h tm2 t2sl0 t2cn t2st t3sl1 t3sl0 0x xx x x 00 x means dont care
gms82512/16/24 hyundai microelectronics 40 feb. 2000 ver 1.00 11.3 8-bit capture mode the timer 0 capture mode is set by bit cap0 of timer mode register tm0 (bit cap2 of timer mode register tm2 for timer 2) as shown in figure 21. in this mode, timer 1 still operates as an 8-bit timer/counter. as mentioned above, not only timer 0 but timer 2 can also be used as a capture mode. in 8-bit capture mode, timer 1 and timer 3 are can not be used as a capture mode. the timer/counter register is incremented in response in- ternal or external input. this counting function is same with normal timer mode, but timer interrupt is not gener- ated. timer/counter still does the above, but with the add- ed feature that a edge transition at external input int n pin causes the current value in the timer counter register (t0,t2), to be captured into registers cdr n (cdr0, cdr2), respectively. after captured, timer counter regis- ter is cleared and restarts by hardware. note: the cdrn and tdrn are in same address.in the capture mode, reading operation is read the cdrn, not tdrn because path is opened to the cdrn. it has three transition modes: "falling edge", "rising edge", "both edge" which are selected by interrupt edge selection register ieds. refer to 14.4 external interrupt on page 51. in addition, the transition at int n pin generate an inter- rupt. figure 11-9 8-bit capture mode ec0 pin ? 4 ? 16 ? 64 xin pin mux prescaler int0if 0: stop 1: clear and start t0st t0sl[1:0] 00 01 10 11 int0 interrupt t0cn cdr0 (8-bit) t0 (8-bit) timer 0 btcl 76543210 t1st cap0 t0sl1 initial value: 00 h address: 0e2 h tm0 t0sl0 t0cn t0st t1sl1 t1sl0 1x xx x x x means dont care 01 or 10 or 11 01 10 11 int0 pin capture to timer1 ieds[1:0] edge detector 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.
hyundai microelectronics gms82512/16/24 feb. 2000 ver 1.00 41 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. figure 11-10 16-bit capture mode ec0 pin ? 4 ? 16 ? 64 xin pin mux prescaler int0if 0: stop 1: clear and start t0st t0sl[1:0] 00 01 10 11 int0 interrupt t0cn btcl 76543210 t1st cap0 t0sl1 initial value: 00 h address: 0e2 h tm0 t0sl0 t0cn t0st t1sl1 t1sl0 1x xx x x x means dont care 01 10 11 int0 pin capture ieds[1:0] edge detector this figure is a example of using the timer0, 1. in the timer2, 3, operation is same like timer0,1, each registers and flags may be changed with for timer2,3. cdr1 + cdr0 higher byte lower byte (16-bit) capture data t1 + t0 (16-bit) 0 0 timer 0 + timer 1 ? timer 0 (16-bit)
gms82512/16/24 hyundai microelectronics 42 feb. 2000 ver 1.00 example 1: timer0 = 16-bit timer mode, 0.5s at 8mhz timer2 = 2ms 8-bit timer mode at 8mhz timer3 = 250us 8-bit timer mode at 8mhz ldm tdr0,#23h ldm tdr1,#0f4h ldm tm0,#0fh ldm tdr2,#249 ldm tdr3,#124 ldm tm2,#0110_1111b set1 t0e set1 t2e set1 t3e ei : : example 2: timer0 = 8-bit timer mode, 2ms interval at 8mhz timer2 = 16-bit event counter mode ldm tdr0,#249 ldm tm0,#0111_1111b ldm tdr2,#3fh ldm tdr3,#2ah ldm tm2,#0100_1100b set1 t0e set1 t2e ei : : example 3: timer0 = 8-bit timer mode, 2ms interval at 8mhz timer2 = 8-bit capture mode ldm tdr0,#250 ldm tm0,#0111_1111b set1 t0e ldm tdr2,#40h ldm tdr3,#2ah ldm tm2,#1111_1111b set1 t2e ldm ieds,#xx11_xxxxb ldm pmr4,#xxxx_x1xxb set1 int2e ei : : x: dont care. example 4: timer0 = 8-bit timer mode, 2ms interval at 8mhz timer2 = 16-bit capture mode ldm tdr0,#249 ldm tm0,#0111_1111b set1 t0e ldm tdr2,#40h ldm tdr3,#2ah ldm tm2,#1100_1111b set1 t2e ldm ieds,#xx11_xxxxb ldm pmr4,#xxxx_x1xxb set1 int2e ei : : x: dont care.
hyundai microelectronics gms82512/16/24 feb. 2000 ver 1.00 43 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. the analog supply voltage is connected to av dd of ladder resistance of a/d module. the a/d module has two registers which are the control register adcm and a/d result register adr. the register adcm, shown in figure 12-2, controls the operation of the a/d converter module. the port pins can be configured as analog inputs or digital i/o. to use analog inputs, i/o is selected input mode by r3dd or r6dd direction register. how to use a/d converter the processing of conversion is start when the start bit adst is set to 1. after one cycle, it is cleared by hard- ware. the register adr contains the results of the a/d conversion. when the conversion is completed, the result is loaded into the adr, the a/d conversion status bit adsf is set to 1, and the a/d interrupt flag aif is set. the block diagram of the a/d module is shown in figure 12-1. the a/d status bit adsf is set automatically when a/d conversion is completed, cleared when a/d conver- sion is in process. the conversion time takes maximum 20 us (at f xin =8 mhz). figure 12-1 a/d block diagram r30/an0 r31/an1 r32/an2 r33/an3 r64/an4 r65/an5 r66/an6 r67/an7 s/h sample & hold 0 1 aden av dd 8-bit dac ladder resistor adif a/d interrupt successive approximation circuit adr a/d result register address: e9 h reset value: undefined 000 001 010 011 100 101 110 111 ads[2:0]
gms82512/16/24 hyundai microelectronics 44 feb. 2000 ver 1.00 figure 12-2 a/d converter control register btcl 76543210 - - adst a/d status bit analog input channel select initial value: --00 0001 b address: 0e8 h adcm adsf a/d converter enable bit 0: a/d converter module turn off and current is not flow. 1: enable a/d converter r/w r/w r/w r/w r/w r 000: channel 0 (an0) 001: channel 1 (an1) 010: channel 2 (an2) 011: channel 3 (an3) 100: channel 4 (an4) 101: channel 5 (an5) 110: channel 6 (an6) 111: channel 7 (an7) 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. ads1 ads0 aden ads2 initial value: undefined address: 0e9 h adr a/d conversion data btcl 76543210 rrrr rr r r
hyundai microelectronics gms82512/16/24 feb. 2000 ver 1.00 45 13. buzzer function the buzzer driver block consists of 6-bit binary counter, buzzer register, and clock source selector. it generates square-wave which has very wide range frequency (500hz ~ 250khz at f xin = 8mhz) by user software. a 50% duty pulse can be output to r55/buz pin to use for piezo-electric buzzer drive . pin r55 is assigned for output port of buzzer driver by setting the bit 5 of pmr5 (address d1 h ) to 1. at this time, the pin r55 must be defined as output mode (the bit 5 of r5dd=1). example: 2.4khz output at 8mhz. ldm r5dd,#xx1x_xxxxb ldm bur,#9ah ldm pmr5,#xx1x_xxxxb x means dont care the bit 0 to 5 of bur determines output frequency for buzzer driving. equation of frequency calculation is shown below. f buz : buzzer frequency f xin : oscillator frequency divide ratio: prescaler divide ratio by buck[1:0] bur: lower 6-bit value of bur. buzzer period value. the frequency of output signal is controlled by the buzzer control register bur.the bit 0 to bit 5 of bur determine output frequency for buzzer driving. figure 13-1 block diagram of buzzer driver figure 13-2 pmr5 and buzzer register f buz f xin 2 divideratio bur ------------------------------------------------------------- = prescaler ? 16 ? 64 ? 32 ? 128 bur r55/buz pin pmr5 internal bus line r55 port data xin pin 6-bit binary 2 6 [0ec h ] [0d1 h ] 0 1 f/f ? 2 comparator compare data 6-bit counter mux 00 01 10 11 port selection bur[5:0] bur address: 0ec h reset value: undefined w wwww w source clock select 00: ? 16 01: ? 32 10: ? 64 11: ? 128 buzzer period data r55/buz selection pmr5 address: 0d1 h reset value: --00 ---- b w - - 0: r55 port (turn off buzzer) 1: buz port (turn on buzzer) ww -- - - w r54/wdto selection 0: r54 1: wdto (output) buck1 buck0
gms82512/16/24 hyundai microelectronics 46 feb. 2000 ver 1.00 note: bur is undefined after reset, so it must be initialized to between 1 h and 3f h by software. note that bur is a write-only register. the 6-bit counter is cleared and starts the counting by writ- ing signal at bur register. it is incremental from 00 h until it matches 6-bit bur value. when main-frequency is 8mhz, buzzer frequency is shown as below table. [khz] bur [5:0] bur[7:6] bur [5:0] bur[7:6] 00 01 10 11 00 01 10 11 00 01 02 03 04 05 06 07 - 250.000 125.000 83.333 62.500 50.000 41.667 35.714 - 125.000 62.500 41.667 31.250 25.000 20.833 17.857 - 62.500 31.250 20.833 15.625 12.500 10.417 8.929 - 31.250 15.625 10.417 7.813 6.250 5.208 4.464 20 21 22 23 24 25 26 27 7.813 7.576 7.353 7.143 6.944 6.757 6.579 6.410 3.906 3.788 3.676 3.571 3.472 3.378 3.289 3.205 1.953 1.894 1.838 1.786 1.736 1.689 1.645 1.603 0.977 0.947 0.919 0.893 0.868 0.845 0.822 0.801 08 09 0a 0b 0c 0d 0e 0f 31.250 27.778 25.000 22.727 20.833 19.231 17.857 16.667 15.625 13.889 12.500 11.364 10.417 9.615 8.929 8.333 7.813 6.944 6.250 5.682 5.208 4.808 4.464 4.167 3.906 3.472 3.125 2.841 2.604 2.404 2.232 2.083 28 29 2a 2b 2c 2d 2e 2f 6.250 6.098 5.952 5.814 5.682 5.556 5.435 5.319 3.125 3.049 2.976 2.907 2.841 2.778 2.717 2.660 1.563 1.524 1.488 1.453 1.420 1.389 1.359 1.330 0.781 0.762 0.744 0.727 0.710 0.694 0.679 0.665 10 11 12 13 14 15 16 17 15.625 14.706 13.889 13.158 12.500 11.905 11.364 10.870 7.813 7.353 6.944 6.579 6.250 5.952 5.682 5.435 3.906 3.676 3.472 3.289 3.125 2.976 2.841 2.717 1.953 1.838 1.736 1.645 1.563 1.488 1.420 1.359 30 31 32 33 34 35 36 37 5.208 5.102 5.000 4.902 4.808 4.717 4.630 4.545 2.604 2.551 2.500 2.451 2.404 2.358 2.315 2.273 1.302 1.276 1.250 1.225 1.202 1.179 1.157 1.136 0.651 0.638 0.625 0.613 0.601 0.590 0.579 0.568 18 19 1a 1b 1c 1d 1e 1f 10.417 10.000 9.615 9.259 8.929 8.621 8.333 8.065 5.208 5.000 4.808 4.630 4.464 4.310 4.167 4.032 2.604 2.500 2.404 2.315 2.232 2.155 2.083 2.016 1.302 1.250 1.202 1.157 1.116 1.078 1.042 1.008 38 39 3a 3b 3c 3d 3e 3f 4.464 4.386 4.310 4.237 4.167 4.098 4.032 3.968 2.232 2.193 2.155 2.119 2.083 2.049 2.016 1.984 1.116 1.096 1.078 1.059 1.042 1.025 1.008 0.992 0.558 0.548 0.539 0.530 0.521 0.512 0.504 0.496 table 13-1 buzzer frequency
hyundai microelectronics gms82512/16/24 feb. 2000 ver 1.00 47 14. interrupts the gms825xx interrupt circuits consist of interrupt en- able register (ienh, ienl), interrupt request flags of irqh, irql, priority circuit, and master enable flag (i flag of psw). thirteen interrupt sources are provided. the configuration of interrupt circuit is shown in figure 14-2. the external interrupts int0 ~ int3 each can be transi- tion-activated (1-to-0 or 0-to-1 transition) by selection ieds. the flags that actually generate these interrupts are bit int0f, int1f, int2f and int3f in register irqh. when an external interrupt is generated, the flag that generated it is cleared by the hardware when the service routine is vec- tored to only if the interrupt was transition-activated. the timer 0 ~ timer 3 interrupts are generated by txif which is set by a match in their respective timer/counter register. the basic interval timer interrupt is generated by bitif which is set by an overflow in the timer register. the ad converter interrupt is generated by adif which is set by finishing the analog to digital conversion. the watchdog timer interrupt is generated by wdtif which set by a match in watchdog timer register. the basic interval timer interrupt is generated by bitif which are set by a overflow in the timer counter register. the interrupts are controlled by the interrupt master enable flag i-flag (bit 2 of psw on page 16), the interrupt enable register (ienh, ienl), and the interrupt request flags (in irqh and irql) except power-on reset and software brk interrupt. below table shows the interrupt priority. vector addresses are shown in figure 8-6 on page 18. in- terrupt enable registers are shown in figure 14-3. these registers are composed of interrupt enable flags of each in- terrupt source and these flags determines whether an inter- rupt will be accepted or not. when enable flag is 0, a corresponding interrupt source is prohibited. note that psw contains also a master enable bit, i-flag, which dis- ables all interrupts at once. figure 14-1 interrupt request flag reset/interrupt symbol priority hardware reset external interrupt 0 external interrupt 1 external interrupt 2 external interrupt 3 timer/counter 0 timer/counter 1 timer/counter 2 timer/counter 3 adc interrupt basic interval timer watchdog timer reset int0 int1 int2 int3 timer 0 timer 1 timer 2 timer 3 adc bit wdt 1 2 3 4 5 6 7 8 9 10 11 12 int3if r/w int0if timer/counter 3 interrupt request flag initial value: 0000 0000 b address: 0f7 h irqh int1if msb lsb t2if t3if t0if t1if int2if r/w r/w timer/counter 2 interrupt request flag timer/counter 1 interrupt request flag external interrupt 3 request flag r/w adif initial value: 000- ---- b address: 0f5 h irql wdtif msb lsb - - - bitif timer/counter 0 interrupt request flag r/w r/w - r/w r/w r/w r/w r/w basic interval timer interrupt request flag watchdog timer interrupt request flag a/d converter interrupt request flag external interrupt 3 request flag external interrupt 3 request flag external interrupt 3 request flag -
gms82512/16/24 hyundai microelectronics 48 feb. 2000 ver 1.00 . figure 14-2 block diagram of interrupt figure 14-3 interrupt enable flag timer 0 int2 int1 int0 int0if ienh interrupt enable interrupt enable irqh irql interrupt vector address generator internal bus line register (lower byte) internal bus line register (higher byte) release stop to cpu interrupt master enable flag i-flag ienl priority control i-flag is in psw, it is cleared by di, set by ei instruction. when it goes interrupt service, i-flag is cleared by hardware, thus any other interrupt are inhibited. when interrupt service is completed by reti instruction, i-flag is set to 1 by hardware. [0f6 h ] [0f4 h ] [0f7 h ] [0f5 h ] int1if int2if int3if t0if t3if t2if int3 timer 1 timer 3 timer 2 t1if a/d converter adif bitif watchdog timer bit wdtif int3e r/w int0e timer/counter 3 interrupt enable flag initial value: 0000 0000 b address: 0f6 h ienh int1e msb lsb t2e t3e t0e t1e int2e r/w r/w timer/counter 2 interrupt enable flag timer/counter 1 interrupt enable flag external interrupt 3 enable flag r/w ade initial value: 000- ---- b address: 0f4 h ienl wdte msb lsb - - - bite timer/counter 0 interrupt enable flag r/w r/w - r/w r/w r/w r/w r/w basic interval timer interrupt enable flag watchdog timer interrupt enable flag a/d converter interrupt enable flag external interrupt 2 enable flag external interrupt 1 enable flag external interrupt 0 enable flag 0: disable 1: enable value -
hyundai microelectronics gms82512/16/24 feb. 2000 ver 1.00 49 14.1 interrupt sequence an interrupt request is held until the interrupt is accepted or the interrupt latch is cleared to 0 by a reset or an in- struction. interrupt acceptance sequence requires 8 f xin (2 m s at f main =4.19mhz) after the completion of the current instruction execution. the interrupt service task is termi- nated upon execution of an interrupt return instruction [reti]. interrupt acceptance 1. the interrupt master enable flag (i-flag) is cleared to 0 to temporarily disable the acceptance of any follow- ing maskable interrupts. when a non-maskable inter- rupt is accepted, the acceptance of any following interrupts is temporarily disabled. 2. interrupt request flag for the interrupt source accepted is cleared to 0. 3. the contents of the program counter (return address) and the program status word are saved (pushed) onto the stack area. the stack pointer decreases 3 times. 4. the entry address of the interrupt service program is read from the vector table address and the entry address is loaded to the program counter. 5. the instruction stored at the entry address of the inter- rupt service program is executed. figure 14-4 timing chart of interrupt acceptance and interrupt return instruction a interrupt request is not accepted until the i-flag is set to 1 even if a requested interrupt has higher priority than that of the current interrupt being serviced. when nested interrupt service is required, the i-flag should be set to 1 by ei instruction in the interrupt service program. in this case, acceptable interrupt sources are se- lectively enabled by the individual interrupt enable flags. saving/restoring general-purpose register during interrupt acceptance processing, the program counter and the program status word are automatically saved on the stack, but accumulator and other registers are not saved itself. these registers are saved by the software if necessary. also, when multiple interrupt services are nested, it is necessary to avoid using the same data memory v.l. system clock address bus pc sp sp-1 sp-2 v.h. new pc v.l. data bus not used pch pcl psw adl op code adh instruction fetch 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. basic interval timer 012 h 0e3 h 0ffe6 h 0ffe7 h 0e h 2e h 0e312 h 0e313 h entry address correspondence between vector table address for bit interrupt and the entry address of the interrupt service program. vector table address
gms82512/16/24 hyundai microelectronics 50 feb. 2000 ver 1.00 area for saving registers. the following method is used to save/restore the general- purpose registers. example: register save using push and pop instructions general-purpose register save/restore using push and pop instructions; 14.2 brk interrupt software interrupt can be invoked by brk instruction, which has the lowest priority order. interrupt vector address of brk is shared with the vector of tcall 0 (refer to program memory section). when brk interrupt is generated, b-flag of psw is set to distin- guish brk from tcall 0. each processing step is determined by b-flag as shown in figure 14-5. figure 14-5 execution of brk/tcall0 intxx: push a push x push y ;save acc. ;save x reg. ;save y reg. interrupt processing pop y pop x pop a reti ;restore y reg. ;restore x reg. ;restore acc. ;return main task interrupt service task saving registers restoring registers acceptance of interrupt interrupt return b-flag brk interrupt routine reti tcall0 routine ret brk or tcall0 =0 =1
hyundai microelectronics gms82512/16/24 feb. 2000 ver 1.00 51 14.3 multi interrupt if two requests of different priority levels are received si- multaneously, the request of higher priority level is ser- viced. if requests of the interrupt are received at the same time simultaneously, an internal polling sequence deter- mines by hardware which request is serviced. figure 14-6 execution of multi interrupt however, multiple processing through software for special features is possible. generally when an interrupt is accept- ed, the i-flag is cleared to disable any further interrupt. but as user sets 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 a push x push y ldm ienh,#80h ; enable int0 only ldm ienl,#0 ; disable other ei ; enable interrupt : : : : : : ldm ienh,#0ffh ; enable all interrupts ldm ienl,#0f0h pop y pop x pop a reti 14.4 external interrupt the external interrupt on int0, int1, int2 and int3 pins are edge triggered depending on the edge selection register ieds (address 0f8 h ) as shown in figure 14-7. the edge detection of external interrupt has three transition enable int0 timer 1 service int0 service main program service occur timer1 interrupt occur int0 ei disable other enable int0 enable other in this example, the int0 interrupt can be serviced without any pending, even timer1 is in progress. because of re-setting the interrupt enable registers ienh,ienl and master enable ei in the timer1 routine.
gms82512/16/24 hyundai microelectronics 52 feb. 2000 ver 1.00 activated mode: rising edge, falling edge, and both edge. figure 14-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 1 corre- spondingly. example: to use as an int0 and int2 : : ; **** set port as an input port r40,r42 ldm r4dd,#1111_1010b ; ; **** set port as an external interrupt port ldm pmr4,#05h ; ; **** set falling-edge detection ldm ieds,#0001_0001b : : : response time the int0 ~ int3 edge are latched into int1if ~ int3if at every machine cycle. the values are not actually polled by the circuitry until the next machine cycle. if a request is active and conditions are right for it to be acknowledged, a hardware subroutine call to the requested service routine will be the next instruction to be executed. the div itself takes twelve cycles. thus, a minimum of twelve complete machine cycles elapse between activation of an external interrupt request and the beginning of execution of the first instruction of the service routine. figure 14-8shows interrupt response timings. figure 14-8 interrupt response timing diagram int0if int0 pin int0 interrupt int1if int1 pin int1 interrupt int2if int2 pin int2 interrupt ieds [0f8h] int3if int3 pin int3 interrupt edge selection register 2 2 2 2 interrupt goes active interrupt latched interrupt processing interrupt routine 8 f xin max. 12 f xin
hyundai microelectronics gms82512/16/24 feb. 2000 ver 1.00 53 figure 14-9 pmr4 and ieds registers btcl wwwww - - - int1s 0: r40 1: int0 initial value: 00 h address: 0d0 h pmr4 ec0s int0s int2s int3s 0: r41 1: int1 0: r42 1: int2 0: r43 1: int3 0: r44 1: ec0 lsb msb btcl wwwwwwww ied2h ied3l ied3h ied0h initial value: 00 h address: 0f8 h ieds ied2l ied0l ied1l ied1h lsb msb edge selection register 00: reserved 01: falling (1-to-0 transition) 10: rising (0-to-1 transition) 11: both (rising & falling) int0 int1 int2 int3
gms82512/16/24 hyundai microelectronics 54 feb. 2000 ver 1.00 15. 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. when the watchdog timer is not being used for malfunc- tion detection, it can be used as a timer to generate an in- terrupt at fixed intervals. figure 15-1 block diagram of watchdog timer watchdog timer control figure 15-2 shows the watchdog timer control register. the watchdog timer is automatically disabled after reset. the cpu malfunction is detected during setting of the de- tection time, selecting of output, and clearing of the binary counter. clearing the binary counter is repeated within the detection time. if the malfunction occurs for any cause, the watchdog tim- er output will become active at the rising overflow from the binary counters unless the binary counter is cleared. at this time, when wdton=1, a reset is generated, which drives the reset pin to low to reset the internal hardware. when wdton=0, a watchdog timer interrupt (wdtif) is generated. the watchdog timer temporarily stops counting in the stop mode, and when the stop mode is released, it au- tomatically restarts (continues counting). figure 15-2 wdtr: watchdog timer data register to reset cpu basic interval timer count source enable watchdog 6-bit compare data comparator watchdog timer interrupt clear clear wdtif counter (8-bit) wdtcl 0 1 wdton in ckctlr [0d3 h ] overflow watchdog timer register wdtr internal bus line 6 [0e0 h ] 76543210 wdtcl - clear count flag 0: free-run count initial value: -011_1111 b address: 0e0 h wdtr ww ww 1: when the wdtcl is set to 1, binary counter is cleared to 0. and the wdtcl becomes 0 automatically after one machine cycle. counter count up again. 6-bit compare data wwww note: the wdton bit is in register ckctlr.
hyundai microelectronics gms82512/16/24 feb. 2000 ver 1.00 55 example: sets the watchdog timer detection time to 0.5 sec at 4.19mhz enable and disable watchdog watchdog timer is enabled by setting wdton (bit 5 in ckctlr) to 1. wdton is initialized to 0 during re- set and it should be set to 1 to operate after reset is re- leased. example: enables watchdog timer for reset : ldm ckctlr,#xx1x_xxxxb; wdton ? 1 : : the watchdog timer is disabled by clearing bit 5 (wd- ton) of ckctlr. the watchdog timer is halted in stop mode and restarts automatically after stop mode is re- leased. watchdog timer interrupt the watchdog timer can be also used as a simple 6-bit tim- er by clearing bit5 of ckctlr to 0. the interval of watchdog timer interrupt is decided by basic interval tim- er. interval equation is shown as below. the stack pointer (sp) should be initialized before using the watchdog timer output as an interrupt source. example: 6-bit timer interrupt set up. ldm ckctlr,#xx0xxxxxb; wdton ? 0 ldm wdtr,#7fh ; wdtcl ? 1 : figure 15-3 watchdog timer timing if the watchdog timer output becomes active, a reset is gen- erated, which drives the reset pin low to reset the inter- nal hardware. the main clock oscillator also turns on when a watchdog timer reset is generated in sub clock mode. ldm ckctlr,#3fh ; select 1/2048 clock source , wdton ? 1, clear counter ldm wdtr,#04fh ldm wdtr,#04fh ; clear counter : : : : ldm wdtr,#04fh ; clear counter : : : : ldm wdtr,#04fh ; clear counter within wdt detection time within wdt detection time t wdtr interval of bit = 2 3 n source clock binary-counter wdtr wdtif interrupt wdtr ? 0100_0011 b 1 0 match detect counter clear 1 2 30 bit overflow 3 wdt reset reset
gms82512/16/24 hyundai microelectronics 56 feb. 2000 ver 1.00 16. power down operation gms825xx 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. stop mode is entered by stop instruction. 16.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. in the stop mode, the on-chip main-frequency oscillator is stopped. with the clock frozen, all functions are stopped, but the on- chip ram and control registers are held. the port pins output the values held by their respective port data register, the port direction registers. the status of peripherals during stop mode is shown below. note: since the x in pin is connected internally to gnd to avoid current leakage due to the crystal oscillator in stop mode, do not use stop instruction when an external clock is used as the main system clock. in the stop mode of operation, v dd can be reduced to min- imize power consumption. be careful, however, that v dd is not reduced before the stop mode is invoked, and that v dd is restored to its normal operating level before the stop mode is terminated. the reset should not be activated before v dd is restored to its normal operating level, and must be held active long enough to allow the oscillator to restart and stabilize. and after stop instruction, at least two or more nop in- struction should be written as shown in example below. example: ldm ckctlr,#0000_1110b stop nop nop : the interval timer register ckctlr should be initial- ized (0f h or 0e h ) by software in order that oscillation sta- bilization time should be longer than 20ms before stop mode. figure 16-1 stop mode release timing by external interrupt peripheral stop mode cpu all cpu operations are disabled ram retain x in pin low x out pin high oscillation stop i/o ports retain control registers retain release method by reset, by external interrupt before executing stop instruction, basic interval timer must be set oscillator (x in pin) ~ ~ n 0 bit counter n+1 n+2 n+3 ~ ~ normal operation stop operation normal operation 1 fe ff 0 12 ~ ~ ~ ~ ~ ~ t st > 20ms ~ ~ ~ ~ external interrupt internal clock clear stop instruction executed ~ ~ ~ ~ ~ ~ properly by software to get stabilization time which is longer than 20ms. by software ~ ~
hyundai microelectronics gms82512/16/24 feb. 2000 ver 1.00 57 release the stop mode the exit from stop mode is using hardware reset or exter- nal interrupt. to release stop mode, corresponding interrupt should be enabled before stop mode. reset redefines all the control registers but does not change the on-chip ram. external interrupts allow both on-chip ram and control registers to retain their values. start-up is performed to acquire the time for stabilizing os- cillation. during the start-up, the internal operations are all stopped. 16.2 minimizing current consumption the stop mode is designed to reduce power consumption. to minimize current drawn during stop mode, the user should turn-off output drivers that are sourcing or sinking current, if it is practical. note: in the stop operation, the power dissipation asso- ciated with the oscillator and the internal hardware is low- ered; however, the power dissipation associated with the pin interface (depending on the external circuitry and pro- gram) is not directly determined by the hardware operation of the stop feature. this point should be little current flows when the input level is stable at the power voltage level (v dd /v ss ); however, when the input level becomes higher than the power voltage level (by approximately 0.3v), a cur- rent begins to flow. therefore, if cutting off the output tran- sistor at an i/o port puts the pin signal into the high- impedance state, a current flow across the ports input tran- sistor, requiring it to fix the level by pull-up or other means. it should be set properly in order that current flow through port doesn't exist. first conseider the setting to input mode. be sure that there is no current flow after considering its relationship with external circuit. in input mode, the pin impedance viewing from external mcu is very high that the current doesnt flow. but input voltage level should be v ss or v dd . be careful that if unspecified voltage, i.e. if unfirmed voltage level (not v ss or v dd ) is applied to input pin, there can be little current (max. 1ma at around 2v) flow. if it is 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 event mcu status before event chip function after event pc oscillator circuit reset dont care vector on stop instruction normal operation n +1 off external interrupt normal operation vector on external interrupt wake up stop, i flag = 1 stop, i flag = 0 vector n + 1 on on table 16-1 wake-up and reset function table
gms82512/16/24 hyundai microelectronics 58 feb. 2000 ver 1.00 is external pull-down register, it is set to low. figure 16-2 application example of unused input port figure 16-3 application example of unused output port input pin v dd gnd i v dd x weak pull-up current flows v dd internal pull-up input pin i v dd x very weak current flows v dd o o open open i=0 o i=0 o gnd when port is configure as an input, input level should be closed to 0v or 5v to avoid power consumption. output pin gnd i in the left case, much current flows from port to gnd. x on off output pin gnd i in the left case, tr. base current flows from port to gnd. i=0 x off on v dd l on off open gnd v dd l on off to avoid power consumption, there should be low output on off o o v dd o to the port.
hyundai microelectronics gms82512/16/24 feb. 2000 ver 1.00 59 17. oscillator circuit the gms825xx has two oscillation circuits internally. x in and x out are input and output for frequency, respectively, inverting amplifier which can be configured for being used as an on-chip oscillator, as shown in figure 17-1. figure 17-1 oscillation circuit oscillation circuit is designed to be used either with a ce- ramic resonator or crystal oscillator. since each crystal and ceramic resonator have their own characteristics, the user should consult the crystal manufacturer for appropriate values of external components. oscillation circuit is designed to be used either with a ce- ramic resonator or crystal oscillator. since each crystal and ceramic resonator have their own characteristics, the user should consult the crystal manufacturer for appropriate values of external components. in addition, see figure 17-2 for the layout of the crystal. note: minimize the wiring length. do not allow the wiring to intersect with other signal conductors. do not allow the wir- ing to come near changing high current. set the potential of the grounding position of the oscillator capacitor to that of v ss . do not ground it to any ground pattern where high cur- rent is present. do not fetch signals from the oscillator. figure 17-2 layout of oscillator pcb circuit x out x in v ss recommend c1,c2 = 30pf10pf c1 c2 x out x in external clock open external oscillator crystal or ceramic oscillator 8mhz crystal oscillator x out x in
gms82512/16/24 hyundai microelectronics 60 feb. 2000 ver 1.00 18. reset the gms825xx have two types of reset generation proce- dures; one is an external reset input, the other is a watch- dog timer reset. table 18-1 shows on-chip hardware ini- tialization by reset action. table 18-1 initializing internal status by reset action 18.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 reset pin low for at least 8 oscillator periods, within the operating voltage range and oscillation stable, it is applied, and the internal state is initialized. after reset, 64ms (at 4 mhz) add with 7 oscillator periods are required to start ex- ecution as shown in figure 18-2. internal ram is not affected by reset. when v dd is turned on, the ram content is indeterminate. therefore, this ram should be initialized before read or tested it. when the reset pin input goes to high, the reset opera- tion is released and the program execution starts at the vec- tor address stored at addresses fffe h - ffff h . a connection for simple power-on-reset is shown in figure 18-1. figure 18-1 simple power-on-reset circuit figure 18-2 timing diagram after reset 18.2 watchdog timer reset refer to 15. watchdog timer on page 54. on-chip hardware initial value on-chip hardware initial value program counter (pc) (ffff h ) - (fffe h ) watchdog timer disable g-flag (g) 0 control registers refer to table 8-1 on page 22 peripheral clock off power fail detector disable 7036p v cc 10uf + 10k w to the reset pin main program oscillator (x in pin) ? ? fffe ffff stabilization time t st = 62.5ms at 4.19mhz reset address data 1 2 3 4 5 6 7 ?? start ? ? ? fe ? adl adh op bus bus reset process step ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ t st = x 256 f main ? 1024 1
hyundai microelectronics gms82512/16/24 feb. 2000 ver 1.00 61 19. power fail processor the gms825xx has an on-chip power fail detection cir- cuitry to immunize against power noise. a configuration register, pfdr, can enable or disable the power fail detect circuitry. whenever v dd falls close to or below power fail voltage for 100ns, the power fail situation may reset or freeze mcu according to pfr bit of pfdr. refer to 7.4 dc electrical characteristics on page 11. in the in-circuit emulator, power fail function is not imple- mented and user can not experiment with it. therefore, af- ter final development of user program, this function may be experimented or evaluated. note: user can select power fail voltage level according to pfv bit of pfdr at the otp(gms82524t) but must select the power fail voltage level to define pfd option of mask order & verification sheet at the mask chip(gms825xx). because the power fail voltage level of mask chip (gms825xx) is determined according to mask option re- gardless of pfv bit of pfdr note: if power fail voltage is selected to 3.0v on 3v oper- ation, mcu is freezed at all the times . table 19-1 power fail processor figure 19-1 power fail voltage detector register power failfunction otp mask enable/disable by pfd flag by pfd flag level selection by pfv flag by mask option 76543210 pfs initial value: ---- 1100 b address: 0f9 h pfdr r/w r/w r/w pfd operation mode 0: normal operation regardless of power fail 1: mcu will be reset by power fail detection disable flag 0: power fail detection enable 1: power fail detection disable power fail status 0: normal operate 1: set to 1 if power fail is detected pfr pfv power fail voltage selection flag 0: 2.4v 1: 3.0v r/w
gms82512/16/24 hyundai microelectronics 62 feb. 2000 ver 1.00 figure 19-2 example s/w of reset flow by power fail figure 19-3 power fail processor situations funtion execution initialize ram data pfs =1 no reset vector initialize all ports initialize registers ram clear yes skip the initial routine pfs = 0 internal reset internal reset internal reset v dd v dd v dd v pfd max v pfd min v pfd max v pfd min v pfd max v pfd min 64ms 64ms t <64ms 64ms when pfr = 1
hyundai microelectronics gms82512/16/24 feb. 2000 ver 1.00 63 20. otp programming the gms82524t is otp (one time programmable) mi- crocontroller. its internal user memory is constructed with eprom (electrically programmable read only memo- ry). the otp micorcontroller is generally used for chip evalu- ation, first production, small amount production, fast mass production, etc. blank otps internal eprom is filled by 00 h , not ff h . note: in any case, you have to use *.otp file, not *.hex file. after assemble, both otp and hex file are generated by automatically. the hex file is used during porgram em- ulation on emulator. 20.1 how to program to program the otp devices, user can use hme own pro- grammer or third party universal programmer shown as listed below. hme own programmer list manufacturer: hyundai microelectronics programmer: choice-dr writer choice-sigma, choice-gang4 the choice-dr writer is single writer and physically add- on adapter board type, it should be used with choice-dr emulator. however, the choice-sigma is stand alone hme universal single programmer for any hme otp devices, also the choice-gang4 can program four otps at once. ask to hme sales part which is listed on appendix of this manual. third party programmer list manufacturer: hi-lo systems programmer: all-11, all-07 website : http: //www.hilosystems.com.tw socket adapters are supported by third party programmers manufacturer. the other third party will be registered and being under development. programming procedure 1. select device gms82524t. 2. load the *.otp file to the programmer. the file is com- posed of motorola-s1 format. 3. set the programming address range as below table. 4. mount the socket adapter on the programmer. 5. start program/verify. 20.2 pin function v pp (program voltage) v pp is the input for the program voltage for programming the eprom. ce (chip enable) ce is the input for programming and verifying internal eprom. oe (output enable) oe is the input of data output control signal for verify. a0~a15 (address bus) a0~a15 are address input pins for internal eprom. d0~d7 (eprom data bus) these are data bus for internal eprom. n.c. (no connection) gms82524t address set value bufferstart address 2000h buffer end address 7fffh device start address a000h
gms82512/16/24 hyundai microelectronics 64 feb. 2000 ver 1.00 a1 a2 a3 a4 a5 a6 a7 d0 d1 d2 d3 d4 d5 d6 d7 a8 a9 a10 a11 a12 a13 42sdip 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 gms82524t (top view) a0 v dd v pp gnd ce oe n.c. * a15 a14 (top view) a9 a10 a11 a12 a13 a14 a15 a7 d0 d1 d2 d3 d4 d5 d6 d7 n.c. a8 1 2 3 4 5 6 7 8 9 10 11 a6 a5 a4 a3 a2 a1 a0 v dd 33 32 31 30 29 28 27 26 25 24 23 17 16 15 14 13 12 34 35 36 37 38 39 40 41 42 43 44 gms82524t 44qfp 18 19 20 21 22 n.c. * v pp ce oe v dd n.c. * n.c. * : no connection
hyundai microelectronics gms82512/16/24 feb. 2000 ver 1.00 65 20.3 programming specification device operation mode (t a = 25 c 5 c) device characteristics (v ss =0v, t a = 25 c 5 c) mode ce oe a0~a15 v pp v dd o0~o7 read mode x 1 x 1 v dd 2 5.0v dout output disable mode v ih v ih x 1 v dd 2 5.0v hi-z programming mode v il v ih x 1 v pp 2 v dd 2 din program verify x 1 x 1 v pp 2 v dd 2 dout 1. x = either v il or v ih . 2. see dc characteristics table for v dd and v pp voltage during programming. symbol item min typ max unit test condition v pp quick pulse programming 11.50 11.75 12.0 v v dd 1 quick pulse programming 5.75 6.0 6.25 v i pp 2 v pp supply current 50 ma ce =v il i dd 2 v dd supply current 30 ma v ih input high voltage 0.8v dd v v il input low voltage 0.2v dd v v oh output high voltage v dd -0.1 v i oh = -2.5ma v ol output low voltage 0.4 v i ol = 2.1ma i il input leakage current 5 m a 1. v dd must be applied simultaneously or before v pp and removed simultaneously or after v pp . 2. the maximum current value is with outputs o0 to o7 unloaded.
gms82512/16/24 hyundai microelectronics 66 feb. 2000 ver 1.00 switching waveforms reading waveforms 1. the input timing reference level is 1.0v for a v il and 4.0v for a v ih at v dd =5.0v. 2. to read the output data, transition requires on the oe form the high to the low after address setup time t as . waveform must be steady inputs outputs will be steady may change will be changing from h to l from h to l may change will be changing from l to h from l to h do not care any changing state change permitted unknown does not apply center line is high impedance off state addresses valid addresses valid output v ih v il v ih v il v ih v il oe output t as t oe t dh high-z see note (2)
hyundai microelectronics gms82512/16/24 feb. 2000 ver 1.00 67 programming algorithm waveforms 1. the input timing reference level is 1.0v for a v il and 4.0v for a v ih at v dd =5.0v. addresses valid addresses v ih v il t dh high-z t ah t dfp program program verify data in/out v pp v dd ce oe t as t ds t vps t vds t pw data in stable data out valid t oes t oe v ih v il 12.75v v dd 6.25v 5.0v v ih v il v ih v il
gms82512/16/24 hyundai microelectronics 68 feb. 2000 ver 1.00 ac reading characteristics (v ss =0v, t a = 25 c 5 c) note: v dd must be applied simultaneously or before v pp and removed simultaneously or after v pp . ac programming characteristics (v ss =0v, t a = 25 c 5 c) * ac condition of test input rise and fall times (10% to 90%) ........................... 20ns input pulse levels ............................................................. 0.45v to 4.55v input timing reference level............................................ 1.0v to 4.0v output timing reference level ......................................... 1.0v to 4.0v v dd must be applied simultaneously or before v pp and removed simultaneously or after v pp . symbol item min typ max unit test condition t as address setup time 2 m s t oe quick pulse programming 200 ns t dh v pp supply current 050ns symbol item min typ max unit test condition* t as address setup time 2 m s t oes oe setup time 2 m s t ds data setup time 2 m s t ah address hold time 0 m s t dh data hold time 2 m s t dfp output delay disable time 0 130 ns t vps v pp setup time 2 m s t vds v dd setup time 2 m s t pw program pulse width 95 100 105 m s t oe data output delay time 150 ns
hyundai microelectronics gms82512/16/24 feb. 2000 ver 1.00 69 table 20-1 programming algorithm start address=first location v cc =6.0v  5v v pp =11.75  5v x=0 program one 100 m s pulse increment x x=25? no yes verify one byte last address? v cc =v pp =5.0v compare all bytes to original data device failed device passed verify byte increment address no yes fail pass fail pass fail pass
appendix
gms82512/16/24 hyundai microelectronics i feb. 2000 ver 1.00 a. control register list address register name symbol r/w initial value page 76543210 00c0 r0 port data register r0 r/w undefined page 28 00c1 r0 port i/o direction register r0dd w 0 0 0 0 0 0 0 0 page 28 00c4 r2 port data register r2 r/w undefined page 28 00c5 r2 port i/o direction register r2dd w 0 0 0 0 0 0 0 0 page 28 00c6 r3 port data register r3 r/w undefined page 28 00c7 r3 port i/o direction register r3dd w 0 0 0 0 0 0 0 0 page 28 00c8 r4 port data register r4 r/w undefined page 29 00c9 r4 port i/o direction register r4dd w - - - 0 0 0 0 0 page 29 00ca r5 port data register r5 r/w undefined page 30 00cb r5 port i/o direction register r5dd w - - 0 0 - - - - page 30 00cc r6 port data register r6 r/w undefined page 30 00cd r6 port i/o direction register r6dd w 0 0 0 0 - - - - page 30 00d0 r4 port mode register pmr4 w - - - 0 0 0 0 0 page 29, page 53 00d1 r5 port mode register pmr5 w - - 0 0 - - - - page 30, page 45 00d3 basic interval timer mode register bitr r undefined page 32 clock control register ckctlr w - - 0 1 0 1 1 1 page 32 00e0 watchdog timer register wdtr w - 0 1 1 1 1 1 1 page 54 00e2 timer mode register 0 tm0 r/w 0 0 0 0 0 0 0 0 page 34 00e3 timer mode register 2 tm2 r/w 0 0 0 0 0 0 0 0 page 34 00e4 timer 0 data register tdr0 w undefined page 34 timer 0 counter register t0 r undefined page 34 00e5 timer 1 data register tdr1 w undefined page 34 timer 1 counter register t1 r undefined page 34 00e6 timer 2 data register tdr2 w undefined page 34 timer 2 counter register t2 r undefined page 34 00e7 timer 3 data register tdr3 w undefined page 34 timer 3 counter register t3 r undefined page 34 00e8 a/d converter mode register adcm r/w - - 0 0 0 0 0 1 page 44 00e9 a/d converter data register adr r undefined page 44 00ec buzzer driver register bur w undefined page 45 00f4 interrupt enable register low ienl r/w 0 0 0 - - - - - page 48 00f5 interrupt request flag register low irql r/w 0 0 0 - - - - - page 47 00f6 interrupt enable register high ienh r/w 0 0 0 0 0 0 0 0 page 48 00f7 interrupt request flag register high irqh r/w 0 0 0 0 0 0 0 0 page 47 00f8 external interrupt edge selection register ieds w 0 0 0 0 0 0 0 0 page 53 00f9 power fail detection register pfdr r/w - - - - 1 1 0 0 page 61
hyundai microelectronics gms82512/16/24 feb. 2000 ver 1.00 ii b. software example b.1 7-segment led display ;***************************************************************************** ; title: gms82516 (gms800 series) demonstration program * ; company: hyundai micro electronics * ; contents: decimal up/down counter * ; programmer: hme mcu application team * ;***************************************************************************** ; ;******** define i/o port & function register address ********* ; r0 equ 0c0h ;port r0 register r0dd equ 0c1h ;port r0 data i/o direction register ; r2 equ 0c4h ;port r2 register r2dd equ 0c5h ;port r2 data i/o direction register ; r3 equ 0c6h ;port r3 register r3dd equ 0c7h ;port r3 data i/o direction register ; r4 equ 0c8h ;port r4 register r4dd equ 0c9h ;port r4 data i/o direction register ; r5 equ 0cah ;port r5 register r5dd equ 0cbh ;port r5 data i/o direction register ; r6 equ 0cch ;port r6 register r6dd equ 0cdh ;port r6 data i/o direction register ; pmr4 equ 0d0h ;port r4 mode register ec0s equ 4,0d0h ;event counter 0 selection int3s equ 3,0d0h ;external int.3 selection int2s equ 2,0d0h ;external int.2 selection int1s equ 1,0d0h ;external int.1 selection gms82512/16/24 led display gnd r00 r01 r02 r03 r04 r05 r06 a b c d e f g 330 w 7 4.7k w 4.7k w r23 r22 r20/int0 r21/int1 up/down s/w clear s/w 2n2222 2n2222 v dd test 5v 5v gnd v ss
gms82512/16/24 hyundai microelectronics iii feb. 2000 ver 1.00 int0s equ 0,0d0h ;external int.0 selection ; pmr5 equ 0d1h ;port r5 mode register buzs equ 5,0d1h ;buzzer selection wdts equ 4,0d1h ;watch dog timer selection ; ckctlr equ 0d3h ;clock control register bitr equ 0d3h ;basic interval timer register ; wdtr equ 0e0h ;watch dog timer register ; tm0 equ 0e2h ;timer0 mode register tm2 equ 0e3h ;timer2 mode register ; tdr0 equ 0e4h ;tomer0 data register tdr1 equ 0e5h ;tomer1 data register tdr2 equ 0e6h ;tomer2 data register tdr3 equ 0e7h ;tomer3 data register ; adcm equ 0e8h ;a/d converter mode register adr equ 0e9h ;a/d con. register ; bur equ 0ech ;buzzer data register ; ienl equ 0f4h ;int. enable register low ae equ 7,0f4h ;a/d con. int. enable wdte equ 6,0f4h ;w.d.t. int. enable bite equ 5,0f4h ;b.i.t. int. enable ; irql equ 0f5h ;int. request flag register low ar equ 7,0f5h ;a/d con. int. request flag wdtrf equ 6,0f5h ;w.d.t. int. request flag bitrf equ 5,0f5h ;b.i.t. int. request flag ; ienh equ 0f6h ;int. enable register high int0e equ 7,0f6h ;external int.0 enable int1e equ 6,0f6h ;external int.1 enable int2e equ 5,0f6h ;external int.2 enable int3e equ 4,0f6h ;external int.3 enable t0e equ 3,0f6h ;timer0 int. enable t1e equ 2,0f6h ;timer1 int. enable t2e equ 1,0f6h ;timer2 int. enable t3e equ 0,0f6h ;timer3 int. enable ; irqh equ 0f7h ;int. request flag register high int0r equ 7,0f7h ;external int.0 request flag int1r equ 6,0f7h ;external int.1 request flag int2r equ 5,0f7h ;external int.2 request flag int3r equ 4,0f7h ;external int.3 request flag t0r equ 3,0f7h ;timer0 int. request flag t1r equ 2,0f7h ;timer1 int. request flag t2r equ 1,0f7h ;timer2 int. request flag t3r equ 0,0f7h ;timer3 int. request flag ; ieds equ 0f8h ;external int. edge selection pfdr equ 0f9h ;power fail detection register ; ;*********** macro definition ************ ; reg_save macro ;save registers to stacks push a push x push y endm ; reg_restore macro ;restore register from stacks pop y pop x pop a endm ; ;*********** constant definition *********** ; seg_port equ r0 ;7-segment output port strobe_port equ r2 ;strobe signal port ; ;************************************************************************** ; ram allocation * ;**************************************************************************
hyundai microelectronics gms82512/16/24 feb. 2000 ver 1.00 iv digit10 ds 1 ;dig10 display data digit1 ds 1 ;seg1 display data strobe ds 1 ;strobe signal data tmr_500ms ds 1 ;500ms time counter flags ds 1 ;function flags up_f equ 0,flags ;1=down,0=up f_500ms equ 1,flags ; ; ;************************************************************************** ; interrupt vector table * ;************************************************************************** ; org0ffe4h dw not_used ; serial i/o dw not_used ; basic interval timer dw not_used ; watch dog timer dw not_used ; a/d con. dw not_used ; timer-3 dw not_used ; timer-2 dw not_used ; timer-1 dw tmr0_int ; timer-0 dw not_used ; int.3 dw not_used ; int.2 dw int_1 ; int.1 dw int_0 ; int.0 dw not_used ; dw reset ; reset ; ;************************************************************************** ; main program * ;************************************************************************** ; org 0c000h ;program start address ; reset: di ;disable all interrupts ldx #0 ram_clr: lda #0 ;ram clear(!0000h->!00bfh) sta {x}+ ;m(x) <- a, then x <- x+1 cmpx #0c0h ;x = #0c0h ? bne ram_clr ; ldx #0feh ;stack pointer initial txsp ;sp. <- #0feh ldm r0,#0 ;i/o port data clear ldm r2,#0 ldm r0dd,#0ffh ;7-seg. data output mode ldm r2dd,#00fh ;7-seg. strobe output mode ldm strobe,#0000_1011b ldm tdr0,#250 ;8us x 250 = 2000us ldm tm0,#0001_1111b ;timer0(8bit),8us,start count-up ldm irqh,#0 ;clear all interrupts requeat flags ldm irql,#0 ldm ienh,#1100_1000b ;enablet0,int0,int1,interrupt ldm ienl,#00h ldm ieds,#0101_0101b ;external int. falling edge select ldm pmr4,#03h ;general port or int? set1 up_f ei ;enable interrupts ; loop: nop if f_500ms == 1 clr1 f_500ms call inc_dec 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 * ;*********************************************** ; inc_dec: bbc up_f,down ;check down mode or up mode ;
gms82512/16/24 hyundai microelectronics v feb. 2000 ver 1.00 ;************************** ;* up count * ;************************** ; setc lda #0 ; digit1 <- digit1 + 1 adc digit1 if a == #0ah setc lda #0 endif sta digit1 ; store result into digit1 ; lda #0 ; when overflow is set, adc digit10 ; digit10 <- digit10 + 1 if a == #10 lda #0 endif sta digit10 ret ; ;************************** ;* down count * ;************************** ; down: clrc lda digit1 ; digit1 <- digit1 - 1 sbc #0 if a == #0ffh lda #9 clrc else setc endif sta digit1 ; store result into digit1 ; lda digit10 ; when overflow is set, sbc #0 ; digit10 <- digit10 - 1 if a == #0ffh lda #9 endif sta digit10 ret ; ;************************************************************************** ; timer0,interrupt routine(2ms)& int0,int1 * ;************************************************************************** ; tmr0_int: reg_save ;save registers to stacks call dsply ;segments data port output call make_500msfalg ;250ms mesurement reg_restore ;restore registers from stacks reti ; ;************************************************************************** ; external interrupt 0 (up/down key) * ;************************************************************************** ; int_0: not1 up_f ;int0 service routine reti ;toggle the up/down mode ; ;************************************************************************** ; external interrupt 1 (clear key) * ;************************************************************************** ; int_1: ldm digit1,#0 ;int1 service routine ldm digit10,#0 ldm tmr_500ms,#0 ;0.5sec restart reti ; ;*********************************************************************** ; subject: seven segment display (dsply) * ;*********************************************************************** ; entry: digit10 or digit1 * ; return: output seg_port (r00~r07), * ; strobe_port (r22,r23) * ; scratch: strobe * ;*********************************************************************** ; description: after read internal ram data, output data to the port *
hyundai microelectronics gms82512/16/24 feb. 2000 ver 1.00 vi ;*********************************************************************** ; dsply: ldm strobe_port,#03h ;segment all turn off not1 strobe.2 ;toggle strobe0 not1 strobe.3 ;toggle strobe1 if strobe.3 = 1 ;test if r23 is high. ldy digit1 else ldy digit10 endif lda !font+y sta seg_port ;segment data output lda strobe sta strobe_port ;current digit turn on ret ;quit ; ;*********************************************** ; subject: set falg at every 500ms * ;*********************************************** ; entry: none * ; return: 500ms flag (f_500ms) * ;*********************************************** ; make_500msfalg: inc tmr_500ms ;count up every 2ms lda tmr_500ms if a == #250 ;compare 0.5s ldm tmr_500ms,#0 ;clear 0.5sec. counter set1 f_500ms ;set 0.5sec. flag endif ret ; ;************************************************************************** ; 7-segment pattern data * ; _a_ * ; f | g |b * ; |---| * ; e |___|c * ; d .h * ;************************************************************************** ; segment: hgfe dcba to be displayed digit number font db 0011_1111b ; 0 db 0000_0110b ; 1 db 0101_1011b ; 2 db 0100_1111b ; 3 db 0110_0110b ; 4 db 0110_1101b ; 5 db 0111_1100b ; 6 db 0000_0111b ; 7 db 0111_1111b ; 8 db 0110_0111b ; 9 ; ;************************************************************************** ; not_used: nop ;discard unexpected interrupts reti ; end ;notice program end
gms82512/16/24 hyundai microelectronics vii feb. 2000 ver 1.00 c. instruction c.1 terminology list terminology description aa - register xx - register yy - register psw program status word c carry flag of psw v overflow flag of psw n negative flag of psw i master interrupt enable flag of psw z zero flag of psw h half carry flag of psw b break flag of psw (software interrupt) g g flag of psw(direct page) pc program counter sp stack pointer #imm 8-bit immediate data dp direct page offset address !abs absolute address [ ] indirect address { } register indirect address { }+ register indirect address, register auto-increment .bit bit position a.bit bit position of a-register dp.bit bit position of direct page memory m.bit bit position of memory (000 h ~ 0fff h ) rel relative addressing data upage u - page(0ff00 h ~ 0ffff h ) offset address n table call number (0 ~ 15) x indicate upper nibble of op code y indicate upper nibble of op code  assignment / transfer / shift left  shift right  exchange h,h hexadecimal d,d decimal b,b binary ( ) contents of + addition - subtraction x multiplication / division = equal  not equal  logical and v logical or ? exclusive or (overline) logical not bit position 0 bit position 1
hyundai microelectronics gms82512/16/24 feb. 2000 ver 1.00 viii c.2 instruction map low 00000 00 00001 01 00010 02 00011 03 00100 04 00101 05 00110 06 00111 07 01000 08 01001 09 01010 0a 01011 0b 01100 0c 01101 0d 01110 0e 01111 0f high 000 - set1 dp.bit bbs a.bit,rel bbs dp.bit,rel adc #imm adc dp adc dp+x adc !abs asl a asl dp tcall 0 seta1 .bit bit dp pop a push a brk 001 clrc // // // sbc #imm sbc dp sbc dp+x sbc !abs rol a rol dp tcall 2 clra1 .bit com dp pop x push x bra rel 010 clrg // // // cmp #imm cmp dp cmp dp+x cmp !abs lsr a lsr dp tcall 4 not1 m.bit tst dp pop y push y pcall upage 011 di // // // or #imm or dp or dp+x or !abs ror a ror dp tcall 6 or1 or1b cmpx dp pop psw push psw ret 100 clrv // // // and #imm and dp and dp+x and !abs inc a inc dp tcall 8 and1 and1b cmpy dp cbne dp+x txsp inc x 101 setc // // // eor #imm eor dp eor dp+x eor !abs dec a dec dp tcall 10 eor1 eor1b dbne dp xma dp+x tspx dec x 110 setg // // // lda #imm lda dp lda dp+x lda !abs txa ldy dp tcall 12 ldc ldcb ldx dp ldx dp+y xcn das 111 ei // // // ldm dp,#imm sta dp sta dp+x sta !abs tax sty dp tcall 14 stc m.bit stx dp stx dp+y xas stop low 10000 10 10001 11 10010 12 10011 13 10100 14 10101 15 10110 16 10111 17 11000 18 11001 19 11010 1a 11011 1b 11100 1c 11101 1d 11110 1e 11111 1f high 000 bpl rel clr1 dp.bit bbc a.bit,rel bbc dp.bit,rel adc {x} adc !abs+y adc [dp+x] adc [dp]+y asl !abs asl dp+x tcall 1 jmp !abs bit !abs addw dp ldx #imm jmp [!abs] 001 bvc rel // // // sbc {x} sbc !abs+y sbc [dp+x] sbc [dp]+y rol !abs rol dp+x tcall 3 call !abs test !abs subw dp ldy #imm jmp [dp] 010 bcc rel // // // cmp {x} cmp !abs+y cmp [dp+x] cmp [dp]+y lsr !abs lsr dp+x tcall 5 mul tclr1 !abs cmpw dp cmpx #imm call [dp] 011 bne rel // // // or {x} or !abs+y or [dp+x] or [dp]+y ror !abs ror dp+x tcall 7 dbne y cmpx !abs ldya dp cmpy #imm reti 100 bmi rel // // // and {x} and !abs+y and [dp+x] and [dp]+y inc !abs inc dp+x tcall 9 div cmpy !abs incw dp inc y tay 101 bvs rel // // // eor {x} eor !abs+y eor [dp+x] eor [dp]+y dec !abs dec dp+x tcall 11 xma {x} xma dp decw dp dec y tya 110 bcs rel // // // lda {x} lda !abs+y lda [dp+x] lda [dp]+y ldy !abs ldy dp+x tcall 13 lda {x}+ ldx !abs stya dp xay daa 111 beq rel // // // sta {x} sta !abs+y sta [dp+x] sta [dp]+y sty !abs sty dp+x tcall 15 sta {x}+ stx !abs cbne dp xyx nop
gms82512/16/24 hyundai microelectronics ix feb. 2000 ver 1.00 c.3 alphabetic order table of instruction no. mnenonic op code byte no. cycle no operation flag nvgbhizc 1 adc #imm 04 2 2 add with carry. nv - - h - zc 2 adc dp 05 2 3 a  a + (m) + c 3 adc dp + x 06 2 4 4 adc !abs 07 3 4 5 adc !abs+y 15 3 5 6 adc [dp+x] 16 2 6 7 adc [dp]+y 17 2 6 8 adc {x} 14 1 3 9 addw dp 1d 2 5 16-bits add without carry : ya  ya + (dp+1)(dp) nv - - h - zc 10 and #imm 84 2 2 logical and n - - - - - z - 11 and dp 85 2 3 a  a  (m) 12 and dp + x 86 2 4 13 and !abs 87 3 4 14 and !abs+y 95 3 5 15 and [dp+x] 96 2 6 16 and [dp] + y 97 2 6 17 and {x} 94 1 3 18 and1 m.bit 8b 3 4 bit and c-flag : c  c  (m.bit) - - - - - - - c 19 and1b m.bit 8b 3 4 bit and c-flag and not : c  c  ( m.bit ) - - - - - - - c 20 asl a 08 1 2 arithmetic shift left n - - - - - zc 21 asl dp 09 2 4 22 asl dp + x 19 2 5 23 asl !abs 18 3 5 24 bbc a.bit,rel y2 2 4/6 branch if bit clear : - - - - - - - - 25 bbc dp.bit,rel y3 3 5/7 if(bit) = 0, then pc  pc + rel 26 bbs a.bit,rel x2 2 4/6 branch if bit clear : - - - - - - - - 27 bbs dp.bit,rel x3 3 5/7 if(bit) = 1, then pc  pc + rel 28 bcc rel 50 2 2/4 branch if carry bit clear : if(c) = 0, then pc  pc + rel mm - - - - z - 29 bcs rel d0 2 2/4 branch if carry bit set : if (c) =1, then pc  pc + rel - - - - - - - - 30 beq rel f0 2 2/4 branch if equal : if (z) = 1, then pc  pc + rel - - - - - - - - 31 bit dp 0c 2 4 bit test a with memory : mm - - - - z - 32 bit !abs 1c 3 5 z  a  m, n  (m 7 ), v  (m 6 ) 33 bmi rel 90 2 2/4 branch if munus : if (n) = 1, then pc  pc + rel - - - - - - - - 34 bne rel 70 2 2/4 branch if not equal : if (z) = 0, then pc  pc + rel - - - - - - - - 35 bpl rel 10 2 2/4 branch if not minus : if (n) = 0, then pc  pc + rel - - - - - - - - 36 bra rel 2f 2 4 branch always : pc  pc + rel - - - - - - - - 37 brk 0f 1 8 software interrupt: - - - 1 - 0 - - b  1, m(sp)  (pc h ), sp  sp - 1, m(s)  (pc l ), sp  s - 1, m(sp)  psw, sp  sp - 1, pc l  (0ffde h ), pc h  (0ffdf h ) 38 bvc rel 30 2 2/4 branch if overflow bit clear : - - - - - - - - if (v) = 0, then pc  pc + rel 39 bvs rel b0 2 2/4 branch if overflow bit set : - - - - - - - - if (v) = 1, then pc  pc + rel c 7 6 5 4 3 2 1 0           " 0 "
hyundai microelectronics gms82512/16/24 feb. 2000 ver 1.00 x 40 call !abs 3b 3 8 subroutine call - - - - - - - - 41 call [dp] 5f 2 8 m(sp)  (pc h ), sp  sp-1, m(sp)  (pc l ), sp  sp-1 if !abs, pc  abs ; if [dp], pc l  (dp), pc h  (dp+1) 42 cbne dp,rel fd 3 5/7 compare and branch if not equal ; - - - - - - - - 43 cbne dp + x, rel 8d 3 6/8 if a 1 (m), then pc  pc + rel. 44 clr1 dp.bit y1 2 4 clear bit : (m.bit)  0 - - - - - - - - 45 clr1a a.bit 2b 2 2 clear a.bit : (a.bit)  0 - - - - - - - - 46 clrc 20 1 2 clear c-flag : c  0 - - - - - - - 0 47 clrg 40 1 2 clear g-flag : g  0 - - 0 - - - - - 48 clrv 80 1 2 clear v-flag : v  0 - 0 - - 0 - - - 49 cmp #imm 44 2 2 compare accumulator contents with memory contents n - - - - - zc 50 cmp dp 45 2 3 a - (m) 51 cmp dp + x 46 2 4 52 cmp !abs 47 3 4 53 cmp !abs + y 55 3 5 54 cmp [dp + x] 56 2 6 55 cmp [dp] + y 57 2 6 56 cmp {x} 54 1 3 57 cmpw dp 5d 2 4 compare ya contents with memory pair contents : n - - - - - zc ya - (dp+1)(dp) 58 cmpx #imm 5e 2 2 compare x contents with memory contents n - - - - - zc 59 cmpx dp 6c 2 3 x - (m) 60 cmpx !abs 7c 3 4 61 cmpy #imm 7e 2 2 compare y contents with memory contents n - - - - - zc 62 cmpy dp 8c 2 3 y - (m) 63 cmpy !abs 9c 3 4 64 com dp 2c 2 4 1s complement : (dp)  ( dp ) n - - - - - z - 65 daa df 1 3 decimal adjust for addition n - - - - - zc 66 das cf 1 3 decimal adjust for substraction n - - - - - zc 67 dbne dp,rel ac 3 5/7 decrement and branch if not equal : - - - - - - - - 68 dbne y,rel 7b 2 4/6 if (m) 1 0, then pc  pc + rel. 69 dec a a8 1 2 decrement n - - - - - z - 70 dec dp a9 2 4 m  m - 1 71 dec dp + x b9 2 5 72 dec !abs b8 3 5 73 dec x af 1 2 74 dec y be 1 2 75 decw dp bd 2 6 decrement memory pair : (dp+1)(dp)  {(dp+1)(dp)} - 1 n - - - - - z - 76 di 60 1 3 disable interrupts : i  0 - - - - - 0 - - 77 div 9b 1 12 divide : ya  a  q:a, r:y nv - - h - z - 78 ei e0 1 3 enable interrupts : i  1 - - - - - 1 - - no. mnenonic op code byte no. cycle no operation flag nvgbhizc
gms82512/16/24 hyundai microelectronics xi feb. 2000 ver 1.00 79 eor #imm a4 2 2 exclusive or n - - - - - z - 80 eor dp a5 2 3 a  a ? (m) 81 eor dp + x a6 2 4 82 eor !abs a7 3 4 83 eor !abs + y b5 3 5 84 eor [ dp + x] 96 2 6 85 eor [dp] + y 97 2 6 86 eor {x} 94 1 3 87 eor1 m.bit ab 3 5 bit exclusive-or c-flag : c  c ? (m.bit) - - - - - - - c 88 eor1b m.bit ab 3 5 bit exclusive-or c-flag and not : c  c ? ( m.bit ) - - - - - - - c 89 inc a 88 1 2 increment n - - - - - zc 90 inc dp 89 2 4 (m)  (m) + 1 n - - - - - z - 91 inc dp + x 99 2 5 92 inc !abs 98 3 5 93 inc x 8f 1 2 94 inc y 9e 1 2 95 incw dp 9d 2 6 increment memory pair : (dp+1)(dp)  {(dp+1)(dp)} + 1 n - - - - - z - 96 jmp !abs 1b 3 3 unconditional jump - - - - - - - - 97 jmp [!abs] 1f 3 5 pc  jump address 98 jmp [dp] 3f 2 4 99 lda #imm c4 2 2 load accumulator n - - - - - z - 100 lda dp c5 2 3 a  (m) 101 lda dp + x c6 2 4 102 lda !abs c7 3 4 103 lda !abs + y d5 3 5 104 lda [dp + x] d6 2 6 105 lda [dp]+y d7 2 6 106 lda {x} d4 1 3 107 lda {x}+ db 1 4 x-register auto-increment : a  (m), x  x + 1 108 ldc m.bit cb 3 4 load c-flag : c  (m.bit) - - - - - - - c 109 ldcb m.bit cb 3 4 load c-flag with not : c  ( m.bit ) - - - - - - - c 110 ldm dp,#imm e4 3 5 load memory with immediate data : (m)  imm - - - - - - - - 111 ldx #imm 1e 2 2 load x-register n - - - - - z - 112 ldx dp cc 2 3 x  (m) 113 ldx dp + y cd 2 4 114 ldx !abs dc 3 4 115 ldy #imm 3e 2 2 load x-register n - - - - - z - 116 ldy dp c9 2 3 y  (m) 117 ldy dp + y d9 2 4 118 ldy !abs d8 3 4 119 ldya dp 7d 2 5 load ya : ya  (dp+1)(dp) n - - - - - z - 120 lsr a 48 1 2 logical shift right n - - - - - zc 121 lsr dp 49 2 4 122 lsr dp + x 59 2 5 123 lsr !abs 58 3 5 124 mul 5b 1 9 multiply : ya  y x a n - - - - - z - 125 nop ff 1 2 no operation - - - - - - - - 126 not1 m.bit 4b 3 5 bit complement : (m.bit)  ( m.bit ) - - - - - - - - no. mnenonic op code byte no. cycle no operation flag nvgbhizc 7 6 5 4 3 2 1 0  c " 0 "         
hyundai microelectronics gms82512/16/24 feb. 2000 ver 1.00 xii 127 or #imm 64 2 2 logical or n - - - - - z - 128 or dp 65 2 3 a  a v (m) 129 or dp + x 66 2 4 130 or !abs 67 3 4 131 or !abs + y 75 3 5 132 or [dp +x} 76 2 6 133 or [dp] + y 77 2 6 134 or {x} 74 1 3 135 or1 m.bit 6b 3 5 bit or c-flag : c  c v (m.bit) - - - - - - - c 136 or1b m.bit 6b 3 5 bit or c-flag and not : c  c v ( m.bit ) - - - - - - - c 137 pcall 4f 2 6 u-page call : m(sp)  (pc h ), sp  sp -1, - - - - - - - - m(sp)  (pc l ), sp  sp -1, pc l  (upage), pc h  "off h " 138 pop a 0d 1 4 pop from stack - - - - - - - - 139 pop x 2d 1 4 sp  sp + 1, reg.  m(sp) 140 pop y 4d 1 4 141 pop psw 6d 1 4 (restored) 142 push a 0e 1 4 push to stack - - - - - - - - 143 push x 2e 1 4 m(sp)  reg. sp  sp - 1 144 push y 4e 1 4 145 push psw 6e 1 4 146 ret 6f 1 5 return from subroutine : - - - - - - - - sp  sp+1, pc l  m(sp), sp  sp+1, pc h  m(sp) 147 reti 7f 1 6 return from interrupt : (restored) sp  sp+1, psw  m(sp), sp  sp+1,pc l  m(sp), sp  sp+1, pc h  m(sp) 148 rol a 28 1 2 rotate left through carry n - - - - - zc 149 rol dp 29 2 4 150 rol dp + x 39 2 5 151 rol !abs 38 3 5 152 ror a 68 1 2 rotate right through carry n - - - - - zc 153 ror dp 69 2 4 154 ror dp + x 79 2 5 155 ror !abs 78 3 5 156 sbc #imm 24 2 2 substract with carry nv - - hzc 157 sbc dp 25 2 3 a  a - (m) - ( c ) 158 sbc dp + x 26 2 4 159 sbc !abs 27 3 4 160 sbc !abs + y 35 3 5 161 sbc [dp + x] 36 2 6 162 sbc [dp] + y 37 2 6 163 sbc {x} 34 1 3 164 set1 dp.bit x1 2 4 set bit : (m.bit)  1 - - - - - - - - 165 seta1 a.bit 0b 2 2 set a.bit : (a.bit)  1 - - - - - - - - 166 setc a0 1 2 set c-flag : c  1 - - - - - - - 1 167 setg c0 1 2 set g-flag : g  1 - - 1 - - - - - no. mnenonic op code byte no. cycle no operation flag nvgbhizc c 7 6 5 4 3 2 1 0          7 6 5 4 3 2 1 0 c         
gms82512/16/24 hyundai microelectronics xiii feb. 2000 ver 1.00 168 sta dp e5 2 3 store accumulator contents in memory - - - - - - - - 169 sta dp + x e6 2 4 (m)  a 170 sta !abs e7 3 4 171 sta !abs + y f5 3 5 172 sta [dp + x] f6 2 6 173 sta [dp] + y f7 2 6 174 sta {x} f4 1 3 175 sta {x}+ fb 1 4 x-register auto-increment : (m)  a, x  x + 1 176 stc m.bit eb 3 6 store c-flag : (m.bit)  c - - - - - - - - 177 stop 00 1 3 stop mode (halt cpu, stop oscillator) - - - - - - - - 178 stx dp ec 2 4 store x-register contents in memory - - - - - - - - 179 stx dp + y ed 2 5 (m)  x 180 stx !abs fc 3 5 181 sty dp e9 2 4 store y-register contents in memory - - - - - - - - 182 sty dp + x f9 2 5 (m)  y 183 sty !abs f8 3 5 184 stya dp dd 2 5 store ya : (dp+1)(dp)  ya - - - - - - - - 185 subw dp 3d 2 5 16-bits substract without carry : ya  ya - (dp+1)(dp) nv - - h - zc 186 tax e8 1 2 transfer accumulator contents to x-register : x  a n - - - - - z - 187 tay 9f 1 2 transfer accumulator contents to y-register : y  a n - - - - - z - 188 tcall n na 1 8 table call : - - - - - - - - m(sp)  (pc h ), sp  sp -1, m(sp)  (pc l ), sp  sp -1 pc l  (table vector l), pc h  (table vector h) 189 tclr1 !abs 5c 3 6 test and clear bits with a :  a - (m), (m)  (m)  ( a ) n - - - - - z - 190 tset1 !abs 3c 3 6 test and set bits with a :  a - (m), (m)  (m) v (a) n - - - - - z - 191 tspx ae 1 2 transfer stack-pointer contents to x-register : x  sp n - - - - - z - 192 tst dp 4c 2 3 test memory contents for negative or zero : (dp) - 00 h n - - - - - z - 193 txa c8 1 2 transfer x-register contents to accumulator : a  x n - - - - - z - 194 txsp 8e 1 2 transfer x-register contents to stack-pointer : sp  x n - - - - - z - 195 tya bf 1 2 transfer y-register contents to accumulator : a  y n - - - - - z - 196 xax ee 1 4 exchange x-register contents with accumulator : x  a - - - - - - - - 197 xay de 1 4 exchange y-register contents with accumulator : y  a - - - - - - - - 198 xcn ce 1 5 exchange nibbles within the accumulator: n - - - - - z - a 7 ~ a 4  a 3 ~ a 0 199 xma dp bc 2 5 exchange memory contents with accumulator n - - - - - z - 200 xma dp + x ad 2 6 (m)  a 201 xma {x} bb 1 5 202 xyx fe 1 4 exchange x-register contents with y-register : x  y - - - - - - - - no. mnenonic op code byte no. cycle no operation flag nvgbhizc
hyundai microelectronics gms82512/16/24 feb. 2000 ver 1.00 xiv c.4 instruction table by function arithmetic/logic operation no. mnenonic op code byte no. cycle no operation flag nvgbhizc 1 adc #imm 04 2 2 add with carry. nv - - h - zc 2 adc dp 05 2 3 a  a + (m) + c 3 adc dp + x 06 2 4 4 adc !abs 07 3 4 5 adc !abs+y 15 3 5 6 adc [dp+x] 16 2 6 7 adc [dp]+y 17 2 6 8 adc {x} 14 1 3 9 and #imm 84 2 2 logical and n - - - - - z - 10 and dp 85 2 3 a  a  (m) 11 and dp + x 86 2 4 12 and !abs 87 3 4 13 and !abs+y 95 3 5 14 and [dp+x] 96 2 6 15 and [dp] + y 97 2 6 16 and {x} 94 1 3 17 asl a 08 1 2 arithmetic shift left n - - - - - zc 18 asl dp 09 2 4 19 asl dp + x 19 2 5 20 asl !abs 18 3 5 21 cmp #imm 44 2 2 compare accumulator contents with memory contents n - - - - - zc 22 cmp dp 45 2 3 a - (m) 23 cmp dp + x 46 2 4 24 cmp !abs 47 3 4 25 cmp !abs + y 55 3 5 26 cmp [dp + x] 56 2 6 27 cmp [dp] + y 57 2 6 28 cmp {x} 54 1 3 29 cmpx #imm 5e 2 2 compare x contents with memory contents n - - - - - zc 30 cmpx dp 6c 2 3 x - (m) 31 cmpx !abs 7c 3 4 32 cmpy #imm 7e 2 2 compare y contents with memory contents n - - - - - zc 33 cmpy dp 8c 2 3 y - (m) 34 cmpy !abs 9c 3 4 35 com dp 2c 2 4 1s complement : (dp)  ( dp ) n - - - - - z - 36 daa df 1 3 decimal adjust for addition n - - - - - zc 37 das cf 1 3 decimal adjust for substraction n - - - - - zc 38 dec a a8 1 2 decrement n - - - - - z - 39 dec dp a9 2 4 m  m - 1 40 dec dp + x b9 2 5 41 dec !abs b8 3 5 42 dec x af 1 2 43 dec y be 1 2 44 div 9b 1 12 divide : ya  a  q:a, r:y nv - - h - z - c 7 6 5 4 3 2 1 0           " 0 "
gms82512/16/24 hyundai microelectronics xv feb. 2000 ver 1.00 45 eor #imm a4 2 2 exclusive or n - - - - - z - 46 eor dp a5 2 3 a  a ? (m) 47 eor dp + x a6 2 4 48 eor !abs a7 3 4 49 eor !abs + y b5 3 5 50 eor [ dp + x] 96 2 6 51 eor [dp] + y 97 2 6 52 eor {x} 94 1 3 53 inc a 88 1 2 increment n - - - - - zc 54 inc dp 89 2 4 (m)  (m) + 1 n - - - - - z - 55 inc dp + x 99 2 5 56 inc !abs 98 3 5 57 inc x 8f 1 2 58 inc y 9e 1 2 59 lsr a 48 1 2 logical shift right n - - - - - zc 60 lsr dp 49 2 4 61 lsr dp + x 59 2 5 62 lsr !abs 58 3 5 63 mul 5b 1 9 multiply : ya  y x a n - - - - - z - 64 or #imm 64 2 2 logical or n - - - - - z - 65 or dp 65 2 3 a  a v (m) 66 or dp + x 66 2 4 67 or !abs 67 3 4 68 or !abs + y 75 3 5 69 or [dp +x} 76 2 6 70 or [dp] + y 77 2 6 71 or {x} 74 1 3 72 rol a 28 1 2 rotate left through carry n - - - - - zc 73 rol dp 29 2 4 74 rol dp + x 39 2 5 75 rol !abs 38 3 5 76 ror a 68 1 2 rotate right through carry n - - - - - zc 77 ror dp 69 2 4 78 ror dp + x 79 2 5 79 ror !abs 78 3 5 80 sbc #imm 24 2 2 substract with carry nv - - hzc 81 sbc dp 25 2 3 a  a - (m) - ( c ) 82 sbc dp + x 26 2 4 83 sbc !abs 27 3 4 84 sbc !abs + y 35 3 5 85 sbc [dp + x] 36 2 6 86 sbc [dp] + y 37 2 6 87 sbc {x} 34 1 3 88 tst dp 4c 2 3 test memory contents for negative or zero : (dp) - 00 h n - - - - - z - 89 xcn ce 1 5 exchange nibbles within the accumulator: n - - - - - z - a 7 ~ a 4  a 3 ~ a 0 no. mnenonic op code byte no. cycle no operation flag nvgbhizc 7 6 5 4 3 2 1 0  c " 0 "          c 7 6 5 4 3 2 1 0          7 6 5 4 3 2 1 0 c         
hyundai microelectronics gms82512/16/24 feb. 2000 ver 1.00 xvi register / memory operation no. mnenonic op code byte no. cycle no operation flag nvgbhizc 1 lda #imm c4 2 2 load accumulator n - - - - - z - 2 lda dp c5 2 3 a  (m) 3 lda dp + x c6 2 4 4 lda !abs c7 3 4 5 lda !abs + y d5 3 5 6 lda [dp + x] d6 2 6 7 lda [dp]+y d7 2 6 8lda {x} d4 1 3 9 lda {x}+ db 1 4 x-register auto-increment : a  (m), x  x + 1 10 ldm dp,#imm e4 3 5 load memory with immediate data : (m)  imm - - - - - - - - 11 ldx #imm 1e 2 2 load x-register n - - - - - z - 12 ldx dp cc 2 3 x  (m) 13 ldx dp + y cd 2 4 14 ldx !abs dc 3 4 15 ldy #imm 3e 2 2 load x-register n - - - - - z - 16 ldy dp c9 2 3 y  (m) 17 ldy dp + y d9 2 4 18 ldy !abs d8 3 4 19 sta dp e5 2 3 store accumulator contents in memory - - - - - - - - 20 sta dp + x e6 2 4 (m)  a 21 sta !abs e7 3 4 22 sta !abs + y f5 3 5 23 sta [dp + x] f6 2 6 24 sta [dp] + y f7 2 6 25 sta {x} f4 1 3 26 sta {x}+ fb 1 4 x-register auto-increment : (m)  a, x  x + 1 27 stx dp ec 2 4 store x-register contents in memory - - - - - - - - 28 stx dp + y ed 2 5 (m)  x 29 stx !abs fc 3 5 30 sty dp e9 2 4 store y-register contents in memory - - - - - - - - 31 sty dp + x f9 2 5 (m)  y 32 sty !abs f8 3 5 33 tax e8 1 2 transfer accumulator contents to x-register : x  a n - - - - - z - 34 tay 9f 1 2 transfer accumulator contents to y-register : y  a n - - - - - z - 35 tspx ae 1 2 transfer stack-pointer contents to x-register : x  sp n - - - - - z - 36 txa c8 1 2 transfer x-register contents to accumulator : a  x n - - - - - z - 37 txsp 8e 1 2 transfer x-register contents to stack-pointer : sp  x n - - - - - z - 38 tya bf 1 2 transfer y-register contents to accumulator : a  y n - - - - - z - 39 xax ee 1 4 exchange x-register contents with accumulator : x  a - - - - - - - - 40 xay de 1 4 exchange y-register contents with accumulator : y  a - - - - - - - - 41 xma dp bc 2 5 exchange memory contents with accumulator n - - - - - z - 42 xma dp + x ad 2 6 (m)  a 43 xma {x} bb 1 5 44 xyx fe 1 4 exchange x-register contents with y-register : x  y - - - - - - - -
gms82512/16/24 hyundai microelectronics xvii feb. 2000 ver 1.00 16-bit operation bit manipulation no. mnenonic op code byte no. cycle no operation flag nvgbhizc 1 addw dp 1d 2 5 16-bits add without carry : ya  ya + (dp+1)(dp) nv - - h - zc 2 cmpw dp 5d 2 4 compare ya contents with memory pair contents : n - - - - - zc ya - (dp+1)(dp) 3 decw dp bd 2 6 decrement memory pair : (dp+1)(dp)  {(dp+1)(dp)} - 1 n - - - - - z - 4 incw dp 9d 2 6 increment memory pair : (dp+1)(dp)  {(dp+1)(dp)} + 1 n - - - - - z - 5ldya dp 7d 2 5 load ya : ya  (dp+1)(dp) n - - - - - z - 6stya dp dd 2 5 store ya : (dp+1)(dp)  ya - - - - - - - - 7 subw dp 3d 2 5 16-bits substract without carry : ya  ya - (dp+1)(dp) nv - - h - zc no. mnenonic op code byte no. cycle no operation flag nvgbhizc 1 and1 m.bit 8b 3 4 bit and c-flag : c  c  (m.bit) - - - - - - - c 2 and1b m.bit 8b 3 4 bit and c-flag and not : c  c  ( m.bit ) - - - - - - - c 3 bit dp 0c 2 4 bit test a with memory : mm - - - - z - 4 bit !abs 1c 3 5 z  a  m, n  (m 7 ), v  (m 6 ) 5 clr1 dp.bit y1 2 4 clear bit : (m.bit)  0 - - - - - - - - 6 clr1a a.bit 2b 2 2 clear a.bit : (a.bit)  0 - - - - - - - - 7clrc 20 1 2 clear c-flag : c  0 - - - - - - - 0 8clrg 40 1 2 clear g-flag : g  0 - - 0 - - - - - 9clrv 80 1 2 clear v-flag : v  0 - 0 - - 0 - - - 10 eor1 m.bit ab 3 5 bit exclusive-or c-flag : c  c ? (m.bit) - - - - - - - c 11 eor1b m.bit ab 3 5 bit exclusive-or c-flag and not : c  c ? ( m.bit ) - - - - - - - c 12 ldc m.bit cb 3 4 load c-flag : c  (m.bit) - - - - - - - c 13 ldcb m.bit cb 3 4 load c-flag with not : c  ( m.bit ) - - - - - - - c 14 not1 m.bit 4b 3 5 bit complement : (m.bit)  ( m.bit ) - - - - - - - - 15 or1 m.bit 6b 3 5 bit or c-flag : c  c v (m.bit) - - - - - - - c 16 or1b m.bit 6b 3 5 bit or c-flag and not : c  c v ( m.bit ) - - - - - - - c 17 set1 dp.bit x1 2 4 set bit : (m.bit)  1 - - - - - - - - 18 seta1 a.bit 0b 2 2 set a.bit : (a.bit)  1 - - - - - - - - 19 setc a0 1 2 set c-flag : c  1 - - - - - - - 1 20 setg c0 1 2 set g-flag : g  1 - - 1 - - - - - 21 stc m.bit eb 3 6 store c-flag : (m.bit)  c - - - - - - - - 22 tclr1 !abs 5c 3 6 test and clear bits with a :  a - (m), (m)  (m)  ( a ) n - - - - - z - 23 tset1 !abs 3c 3 6 test and set bits with a :  a - (m), (m)  (m) v (a) n - - - - - z -
hyundai microelectronics gms82512/16/24 feb. 2000 ver 1.00 xviii branch / jump operation control operation & etc. no. mnenonic op code byte no. cycle no operation flag nvgbhizc 1 bbc a.bit,rel y2 2 4/6 branch if bit clear : - - - - - - - - 2 bbc dp.bit,rel y3 3 5/7 if(bit) = 0, then pc  pc + rel 3 bbs a.bit,rel x2 2 4/6 branch if bit clear : - - - - - - - - 4 bbs dp.bit,rel x3 3 5/7 if(bit) = 1, then pc  pc + rel 5 bcc rel 50 2 2/4 branch if carry bit clear : if(c) = 0, then pc  pc + rel mm - - - - z - 6bcs rel d0 2 2/4 branch if carry bit set : if (c) =1, then pc  pc + rel - - - - - - - - 7 beq rel f0 2 2/4 branch if equal : if (z) = 1, then pc  pc + rel - - - - - - - - 8 bmi rel 90 2 2/4 branch if munus : if (n) = 1, then pc  pc + rel - - - - - - - - 9bne rel 70 2 2/4 branch if not equal : if (z) = 0, then pc  pc + rel - - - - - - - - 10 bpl rel 10 2 2/4 branch if not minus : if (n) = 0, then pc  pc + rel - - - - - - - - 11 bra rel 2f 2 4 branch always : pc  pc + rel - - - - - - - - 12 bvc rel 30 2 2/4 branch if overflow bit clear : - - - - - - - - if (v) = 0, then pc  pc + rel 13 bvs rel b0 2 2/4 branch if overflow bit set : - - - - - - - - if (v) = 1, then pc  pc + rel 14 call !abs 3b 3 8 subroutine call - - - - - - - - 15 call [dp] 5f 2 8 m(sp)  (pc h ), sp  sp-1, m(sp)  (pc l ), sp  sp-1 if !abs, pc  abs ; if [dp], pc l  (dp), pc h  (dp+1) 16 cbne dp,rel fd 3 5/7 compare and branch if not equal ; - - - - - - - - 17 cbne dp + x, rel 8d 3 6/8 if a 1 (m), then pc  pc + rel. 18 dbne dp,rel ac 3 5/7 decrement and branch if not equal : - - - - - - - - 19 dbne y,rel 7b 2 4/6 if (m) 1 0, then pc  pc + rel. 20 jmp !abs 1b 3 3 unconditional jump - - - - - - - - 21 jmp [!abs] 1f 3 5 pc  jump address 22 jmp [dp] 3f 2 4 23 pcall 4f 2 6 u-page call : m(sp)  (pc h ), sp  sp -1, - - - - - - - - m(sp)  (pc l ), sp  sp -1, pc l  (upage), pc h  "off h " 24 tcall n na 1 8 table call : - - - - - - - - m(sp)  (pc h ), sp  sp -1, m(sp)  (pc l ), sp  sp -1 pc l  (table vector l), pc h  (table vector h) no. mnenonic op code byte no. cycle no operation flag nvgbhizc 1 brk 0f 1 8 software interrupt: - - - 1 - 0 - - b  1, m(sp)  (pc h ), sp  sp - 1, m(s)  (pc l ), sp  s - 1, m(sp)  psw, sp  sp - 1, pc l  (0ffde h ), pc h  (0ffdf h ) 2di 60 1 3 disable interrupts : i  0 - - - - - 0 - - 3ei e0 1 3 enable interrupts : i  1 - - - - - 1 - - 4 nop ff 1 2 no operation - - - - - - - -
gms82512/16/24 hyundai microelectronics xix feb. 2000 ver 1.00 5 pop a 0d 1 4 pop from stack - - - - - - - - 6 pop x 2d 1 4 sp  sp + 1, reg.  m(sp) 7 pop y 4d 1 4 8 pop psw 6d 1 4 (restored) 9 push a 0e 1 4 push to stack - - - - - - - - 10 push x 2e 1 4 m(sp)  reg. sp  sp - 1 11 push y 4e 1 4 12 push psw 6e 1 4 13 ret 6f 1 5 return from subroutine : - - - - - - - - sp  sp+1, pc l  m(sp), sp  sp+1, pc h  m(sp) 14 reti 7f 1 6 return from interrupt : (restored) sp  sp+1, psw  m(sp), sp  sp+1,pc l  m(sp), sp  sp+1, pc h  m(sp) 15 stop 00 1 3 stop mode (halt cpu, stop oscillator) - - - - - - - - no. mnenonic op code byte no. cycle no operation flag nvgbhizc
d. mask order sheet mask order & verification sheet gms82512 1. customer information company name application order date yyyy tel: fax: name & signature: .otp file data file name (please check mark ? into ) customer should write inside thick line box. 42sdip 44mqfp ( ) .otp 3.0v yyww korea gms825xx-hh customers logo chollian internet hitel package 24k 12k 16k rom size (bytes) mask data check sum ( ) 2. device information pfd option 2.4v not use mm dd 2000 h (24k) 4000 h (16k) 5000 h (12k) 7fff h 3. marking specification customer logo is not required. yyww korea gms825xx-hh hme customers part number if the customer logo must be used in the special mark, please submit a clean original of the logo. 4. delivery schedule date quantity hme confirmation yyyy mm dd yyyy mm dd customer sample risk order pcs pcs e-mail address: 5. rom code verification yyyy mm dd verification date: please confirm out verification data. check sum: tel: fax: name & signature: e-mail address: yyyy mm dd approval date: i agree with your verification data and confirm you to make mask set. tel: fax: name & signature: e-mail address: 
  
 semiconductor group of hyundai electronics industries co., ltd. 08 or 16 or 24 set ff h in blanked area -hh gms82516 gms82524 feb., 03. 2000


▲Up To Search▲   

 
Price & Availability of GMS82524TK

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X