Part Number Hot Search : 
SW12650 NOA1211 IRFR5505 D8222EFV 2B7SN NOA1211 BRF4802 E005755
Product Description
Full Text Search
 

To Download HT98R068-1 Datasheet File

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


  Datasheet File OCR Text:
  two way radio 8-bit mcu HT98R068-1 revision: 1.10 date: ?e???a?? 1?? ?01? ?e???a?? 1?? ?01?
rev. 1.10 ? ?e???a?? 1?? ?01? rev. 1.10 ? ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu table of contents eates eneal eston lo aam n ssnment n eston bsolte amm atns c caatests c caatests c eletal caatests c eletal caatests oe on eset eletal caatests o oess o caatests sstem tete clocking and pipelining .......................................................................................................... 16 p?og?am co?nte? C pc ........................................................................................................... 17 stack ...................................................................................................................................... 18 a? ithmetic and logic unit C alu ............................................................................................ 18 p?og?am memo?? ......................................................................................................... 19 st??ct??e ................................................................................................................................. 19 special vecto ?s ...................................................................................................................... 19 look-? p ta?le ......................................................................................................................... ?0 ta ?le p?og?am example ......................................................................................................... ?0 data memo?? ................................................................................................................ ?? st??ct??e ................................................................................................................................. ?? special p??pose data memo?? .............................................................................................. ?? special ??nction registe?s ........................................................................................ ?? indi? ect add?essing registe?s C iar0? iar1 .......................................................................... ?? memo?? pointe?s C mp0? mp1 ............................................................................................... ?? acc?m?lato? C acc ................................................................................................................ ?5 p?og?am co?nte? low registe? C pcl ................................................................................... ?5 bank pointe? C bp .................................................................................................................. ?5 stat?s registe? C status ..................................................................................................... ?6 inp?t/o?tp?t po?ts and cont?ol registe?s .............................................................................. ?7 s?stem cont?ol registe? C ctrl0? ctrl1? ctrl? .............................................................. ?8 wake- ?p ??nction registe? C pawk ...................................................................................... ?0 p?ll-high registe? s C papu? pbpu? pcpu? pdpu? pepu .................................................... ?0 oscillato? ...................................................................................................................... ?0 s?stem oscillato? ove?view ................................................................................................... ?0 exte?nal ??768hz c??stal oscillato? C lxt ............................................................................ ?1
rev. 1.10 ? ?e???a?? 1?? ?01? rev. 1.10 ? ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu lxt oscillato ? low powe? ??nction ....................................................................................... ?? operating modes ......................................................................................................... 32 mode t ?pes and selection ..................................................................................................... ?? mode switching ...................................................................................................................... ?4 stand?? c???ent conside?ations ............................................................................................ ?5 wake- ?p ................................................................................................................................. ?5 watchdog timer .......................................................................................................... 36 watchdog time ? ope?ation .................................................................................................... ?6 reset and initialization ............................................................................................... 38 reset ??nctions ..................................................................................................................... ?8 reset initial conditions .......................................................................................................... 41 input/output ports ....................................................................................................... 43 p?ll-high resisto?s ................................................................................................................. 4? po? t a wake-?p ..................................................................................................................... 4? i/o po?t cont?ol registe?s ...................................................................................................... 44 pin-sha?ed ??nctions ............................................................................................................. 44 pin remapping confguration ................................................................................................ 45 i/o pin st??ct??es ................................................................................................................... 46 p?og?amming conside?ations ................................................................................................. 46 timer/event counter s ................................................................................................. 47 confguring the timer/event counter input clock source ..................................................... 47 time ? registe? s C tmr0? tmr1? tmr?l? tmr?h ................................................................ 47 time ? cont? ol registe? s C tmr0c? tmr1c? tmr?c ............................................................ 49 time ? mode ............................................................................................................................ 51 event co?nte? mode .............................................................................................................. 51 p?lse width capt??e mode .................................................................................................... 5? p?escale? ................................................................................................................................ 5? p?d ??nction ......................................................................................................................... 5? i/o inte?facing ......................................................................................................................... 54 p?og?amming conside?ations ................................................................................................. 54 time ? p?og?am example ........................................................................................................ 55 time base .............................................................................................................................. 55 analog to digital converter ........................................................................................ 56 a/d ove?view ......................................................................................................................... 56 a/d conve?te? data registe? s C adrl? adrh ...................................................................... 56 a/d conve?te? cont?ol registe? s C adcr? acsr? ancsr ................................................... 56 a/d inp?t pins ........................................................................................................................ 60 s?mma?? of a/d conve?sion steps ........................................................................................ 60 p?og?amming conside?ations ................................................................................................. 61 a/d t ?ansfe? ??nction ............................................................................................................ 61 a/d p?og?amming example .................................................................................................... 61 interrupts ...................................................................................................................... 64 inte???pt registe? ................................................................................................................... 64
rev. 1.10 4 ?e???a?? 1?? ?01? rev. 1.10 5 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu inte???pt ope?ation ................................................................................................................. 66 inte???pt p?io?it? ...................................................................................................................... 67 exte?nal inte???pt .................................................................................................................... 68 time ?/event co?nte? inte???pt ................................................................................................ 68 time b ase i nte???pt ................................................................................................................ 68 a/d conve?te? i nte???pt .......................................................................................................... 68 a?dio p?ocesso? inte???pt ...................................................................................................... 69 p?og?amming conside?ations ................................................................................................. 69 spi function ................................................................................................................ 69 beep function ............................................................................................................. 70 digital to analog converter C dac ............................................................................ 71 ope?ation ............................................................................................................................... 71 low voltage detector C lvd ....................................................................................... 72 lvd registe ? .......................................................................................................................... 7? lvd ope ?ation ........................................................................................................................ 7? audio process or .......................................................................................................... 73 a?dio receive? ....................................................................................................................... 7? a?dio t ?ansmitte? ................................................................................................................... 75 s?ppo? ted diffe?ent com?ination ??nctions .......................................................................... 77 audio signal routing .................................................................................................. 79 mcu interfacing ........................................................................................................... 79 command g?o?ps .................................................................................................................. 80 cli command g?o?p ............................................................................................................. 81 command g?o?p s?mma?? ................................................................................................... 81 i/o command g?o?p detail .................................................................................................... 8? cli command g?o?p s?mma?? ............................................................................................. 88 application circuits .................................................................................................... 99 instruction set ........................................................................................................... 100 int?od?ction .......................................................................................................................... 100 inst?? ction timing ................................................................................................................. 100 moving and t ?ansfe??ing data .............................................................................................. 100 a?ithmetic ope?ations ........................................................................................................... 100 logical and rotate ope?ations ............................................................................................. 101 b?anches and cont? ol t ?ansfe? ............................................................................................ 101 bit ope?ations ...................................................................................................................... 101 ta ?le read ope?ations ........................................................................................................ 101 othe? ope?ations .................................................................................................................. 101 inst??ction set s?mma?? ...................................................................................................... 10? instruction defnition ................................................................................................ 104 package information ................................................................................................. 114 48-pin lq? p (7mmx7mm) o?tline dimensions ................................................................... 114 64-pin lq? p (7mmx7mm) o?tline dimensions ................................................................... 115
rev. 1.10 4 ?e???a?? 1?? ?01? rev. 1.10 5 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu features operating voltage: 3v~5v up to 0.25s instruction cycle with 16mhz system clock otp program memory:16k x 16 data memory: 1k x8 up to 34 bidirectional i/o lines ocillator type: external 32768hz crystal -- lxt internal pll to generate the system clock C input reference clock : 32768hz C output: 2.048mhz x4/x5/x6/x8 (optional) four operational modes: normal, slow, idle, sleep watchdog timer function with wdt oscillator real time clock function 8 channel 12-bit a/d converter 4 channel 8-bit d / a converter all instructions executed in one or two instruction cycles table read instructions 63 powerful instructions up to 10-level subroutine nesting bit manipulation instruction low voltage reset function low voltage detect function spi interface for external mcu control two 8-bit and signal 16-bit programmable timer/event counter with overfow interrupt and prescaler programmable frequency divider -- pfd pga : 5bit operational amplifer gain setup sub-tone process or C ctcss/dcs encode/decode in-band-tone process or C dtmf encoder/decode C selective call encoder/decoder C user defned tone encoder/decoder audio process or C pre-emphasis/de-emphasis C scramble r C compandor C vox package types: 48/64-pin lqfp
rev. 1.10 6 ?e???a?? 1?? ?01? rev. 1.10 7 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu general description the device is an assp mcu for analog two way radio applications such as frs. this device contains an 8 - bit mcu, audio processor, adc, dac as well as an operational amplifier for peripheral interface s . additionally there are external interrupt functions and 16k of otp program memory and 1k of sram data memory for general mcu control application. the internal audio processor supports various programmable functions. these functions include ctcss/dcss encod ing /decod ing , dtmf encod ing /decod ing , scramble/descramble, vox, compand or and so on. by connecting to a suitable rf module, the device provides a cost effective and fexible audio rf solution. applications should include products in the leisure radio application area such as general mobile radio s , personal mobile radio s , multiple user radio s etc. block diagram                 
      
       
                  
   ?    
rev. 1.10 6 ?e???a?? 1?? ?01? rev. 1.10 7 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu pin assignment                                                                  
        
        
                                                                                                                  ?             ?   ?                                                                                      
        
                                                                      ?   ?                
                       
rev. 1.10 8 ?e???a?? 1?? ?01? rev. 1.10 9 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu pin description pad name function opt i/t o/t description pa0/an0 pa0 papu pawk st cmos gene?al p??pose i/o. registe? ena?led p?ll-?p and wake-?p. an0 ancsr an a/d channel 0 pa1/p ?d/an1 pa1 papu pawk st cmos gene?al p??pose i/o. registe? ena?led p?ll-?p and wake-?p. p?d ctrl0 cmos p?d o?tp?t an1 ancsr an a/d channel 1 pa ?/tmr0/an? pa ? papu pawk st cmos gene?al p??pose i/o. registe? ena?led p?ll-?p and wake-?p an? ancsr an a/d channel ? tmr0 st time ?/event co?nte? 0 clock inp?t pa ?/int/an? pa ? papu pawk st cmos gene?al p??pose i/o. registe? ena?led p?ll-?p and wake-?p. int st exte?nal inte???pt inp?t an? ancsr an a/d channel ? pa4/tmr1 pa4 papu pawk st cmos gene?al p??pose i/o. registe? ena?led p?ll-?p and wake-?p. tmr1 st time ?/event co?nte? 1 clock inp?t pa5/miso pa5 papu pawk st cmos gene?al p??pose i/o. registe? ena?led p?ll-?p and wake-?p. miso spicr o?tp?t data pin of slave spi pa6/tmr ? pa6 papu pawk st cmos gene?al p??pose i/o. registe? ena?led p?ll-?p and wake-?p. tmr? st time ?/event co?nte? ? clock inp?t pa7/ res pa7 pawk st nmos gene?al p??pose i/o. registe? ena?led wake-?p. res co st reset inp?t pb0/dao0 pb0 pbpu st cmos gene?al p??pose i/o. registe? ena?led p?ll-?p. dao0 dacc an dac0 o?tp?t pb1/dao1 pb1 pbpu st cmos gene?al p??pose i/o. registe? ena?led p?ll-?p. dao1 dacc an dac1 o?tp?t pb?/dao? pb? pbpu st cmos gene?al p??pose i/o. registe? ena?led p?ll-?p. dao? dacc an dac? o?tp?t pb?/ dao? pb? pbpu st cmos gene?al p??pose i/o. registe? ena?led p?ll-?p. dao? dacc an dac? o?tp?t pb4/gpio0 pb4 pbpu st cmos gene?al p??pose i/o. registe? ena?led p?ll-?p. gpio0 spicr a?dio p?ocesso? 0 i/o pb5/gpio1 pb5 pbpu st cmos gene?al p??pose i/o. registe? ena?led p?ll-?p. gpio1 spicr audio processor 1 i/o pb6/gpio? pb6 pbpu st cmos gene?al p??pose i/o. registe? ena?led p?ll-?p. gpio? spicr audio processor ? i/o pb7/gpio? pc0 pcpu st cmos gene?al p??pose i/o. registe? ena?led p?ll-?p. gpio? spicr audio processor ? i/o xin xin co lxt low f?eq?enc? c??stal inp?t pin xout xout co lxt low f?eq?enc? c??stal o?tp?t pin
rev. 1.10 8 ?e???a?? 1?? ?01? rev. 1.10 9 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu pad name function opt i/t o/t description pc0/an4 pc1/an5 pc?/an6 pc?/an7 pcn pcpu st cmos gene?al p??pose i/o. registe? ena?led p?ll-?p. ann adcsr an a/d channel 4? 5? 6? 7 pc4/ mosi pc4 pcpu st cmos gene?al p??pose i/o. registe? ena?led p?ll-?p. mosi spicr inp?t data pin of slave spi pc5/ spirq pc5 pcpu st cmos gene?al p??pose i/o. registe? ena?led p?ll-?p. spirq spicr o?tp?t pin of slave spi pc6/ spick pc6 pcpu st cmos gene?al p??pose i/o. registe? ena?led p?ll-?p. spick spicr clock so??ce inp?t pin. pc7/ spiss pc7 pcpu st cmos gene?al p??pose i/o. registe? ena?led p?ll-?p. spiss spicr audio processor select pd0~pd7 pdn pdpu st cmos gene?al p??pose i/o. registe? ena?led p?ll-?p. pe0~pe1 pen pepu st cmos gene?al p??pose i/o. registe? ena?led p?ll-?p. mic_i mic_i mic? ophone op inp?t mic_o mic_o mic? ophone op o?tp?t aux aux a?xilia?? a?dio inp?t audo audo audio o?tp?t mod mod a?dio ?ase?and mod?lation o?tp?t to r? mod?le smod smod s?? a?dio ?ase?and mod?lation o?tp?t demod demod inp?t f?om r? demod?lation o?tp?t vssa1/vssa? vssan analog block gnd vcca1/vcca?/ vcca? vccan analog block vcc vcca4 vccan a?dio p?ocesso? vcc vga vga a? dio adc analog g?o?nd o?tp?t vgare? vgare? a? dio adc analog g?o?nd ?efe?ence ??pass pllc pllc connect to low pass loop flter circuit vdd vdd pwr positive powe? s?ppl? vss vss pwr negative powe? s?ppl ?? gnd note: i/t: input type; o/t: output type opt: optional by confguration option (co) or register option pwr: power; co: confguration option st: schmitt trigger input; cmos: cmos output; n mos : n mos output an: analog input or output lxt: low frequency crystal oscillator
rev. 1.10 10 ?e???a?? 1?? ?01? rev. 1.10 11 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu absolute maximum ratings supply voltage ....................................................................................................... v ss -0.3v to 6.0v input voltage ................................................................................................. v ss -0.3v to v dd +0.3v storage temperature .................................................................................................. -50 c to 125c operating temperature ................................................................................................ -40 c to 85 c note: these are stress ratings only. stresses exceeding the range specified under absolute maximum ratings may cause substantial damage to the device. functional operation of this device at other conditions beyond those listed in the specifcation is not implied and prolonged exposure to extreme conditions may affect device reliability. d.c. characteristics ope? ating tempe?at?? e: -40c to 85c ta=? 5c t ?pical symbol parameter test conditions min. typ. max. unit v dd conditions v dd ope?ating v oltage f sys =??768hz ?.? 5.5 v f sys =?mhz~1?mhz ?.0 5.5 v f sys =16mhz ?.? 5.5 v i dd1 ope?ating c ???ent (??k osc+pll) ?v no load? f sys =4mhz adc? dac disa?le 1 ? ma 5v ?.5 5.0 ma i dd? ope?ating c ???ent (??k osc+pll) ?v no load? f sys =8mhz ? 4 ma 5v adc? dac disa?le 4 8 ma i dd? ope?ating c???ent (??k osc+pll) ?v no load? f sys =10mhz ? 4 ma 5v adc? dac disa?le 4 8 ma i dd4 ope?ating c???ent (??k osc+pll) ?v no load? f sys =1?mhz adc? dac disa?le 6 1? ma i dd5 ope?ating c???ent (??k osc? pll o??) ?v no load? f sys =??768hz adc? dac disa?le ?0 ?0 a 5v 40 60 a i dd6 ope?ating c???ent (a?dio p?ocessing t ??n o n) ?v no load? f sys =8mhz see note ? 15 ma ma i stb1 stand?? c ???ent (wdtosc o n? ??k osc o ff) ?v no load? s?stem halt 5 a 5v 10 a i stb? stand?? c???ent (wdtosc off ? ??k osc off) ?v no load? s?stem halt 1 a 5v ? a i stb? stand?? c???ent (wdtosc off ? ??k osc on) ?v no load? s? stem halt lxt osc slowl? sta?t-?p 5 a 5v 10 a v il1 inp? t low voltage ?o? pa ? pb? pc? pd? pe ? tmr0? tmr1? int 0 0.?v dd v v ih1 inp?t high voltage ?o? pa? pb? pc? pd? petmr0? tmr1? int 0.7v dd v dd v v il? inp? t low voltage ( res ) 0 0.4v dd v v ih? inp? t high voltage ( res ) 0.9v dd v dd v v lvr1 low voltage reset voltage lvr ?.10v option 1.98 ?.10 ?.?? v v lvr ? low voltage reset voltage lvr ?.15v option ?.98 ?.15 ?.?? v v lvr ? low voltage reset voltage lvr 4. ?0v option ?.98 4.?0 4.4? v
rev. 1.10 10 ?e???a?? 1?? ?01? rev. 1.10 11 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu symbol parameter test conditions min. typ. max. unit v dd conditions i oh1 i/o so??ce c???ent (pa ? pb? pc? pd? pe) ?v v oh =0.9v dd -? -4 ma 5v -5 -10 ma i ol1 i/o sink c???ent ( pa ? pb? pc? pd? pe ) ?v v ol =0.1v dd 4 8 ma 5v 10 ?0 ma i ol? pa7 sink c ???ent 5v v ol =0.1v dd ? ? ma r ph p?ll-high resistance (i/o) ?v ?0 60 100 k 5v 10 ?0 50 k v ad ad inp? t voltage 0 v dd v e ad a/d conve?sion e??o? 0.5 1.0 lsb i adc t ad =1 s? onl? 8bit adc ena?le? othe?s disa?le ?v no load 0.5 1.0 ma 5v no load 1.5 ?.0 ma i dac onl? 8 bit dac ena?le? othe?s disa?le ?v no load ?00 a 5v no load 500 a i audoh audo so? ? ce c???ent ?v v oh =0.9v dd -4 ma i audol audo s ink c???ent ?v v ol =0.1v dd 8 ma r aux_on aux inp?t resistance when channel t ??n on ?00 r aux_o?? aux inp?t resistance when channel t ?? n off 1 m r demod_on demod inp?t resistance when mux channel t ??n on ?00 k r demod_o?? demod inp?t resistance when mux channel t ??n off 1 m r mod_on mod o?tp?t resistance when dao1 opa t ??n on ?00 r mod_o?? demod inp?t resistance when dao1 opa t ?? n off 500 k r smod_on demod inp?t resistance when dao? opa t ??n on ?00 r smod_o?? demod inp?t resistance when dao? opa t ?? n off 500 k r l1 load resistance fo? mod? smod ?0 k vag 1/?v dd v vagre ? 0.90 1.15 1.?5 v note: 1. pa0~pa6 is connected to external pull-up resister when res =low. 2. adc/dac in mcu, audio scrambler, ctcss, dcs, compand o r and pre/de-emphasis disabled, but all other digital circuits (including the main clock pll) enabled. a single analogue path is enabled through the device.
rev. 1.10 1? ?e???a?? 1?? ?01? rev. 1.10 1? ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu a.c. characteristics ope? ating tempe?at?? e: -40c to 85c ta=? 5c t ?pical symbol parameter test conditions min. typ. max. unit v dd conditions f sys1 s?stem clock (pll) ?.0v~5.5v ? 1? mhz ?.?v~5.5v ? 16 mhz f sys? s?stem clock (??768 c??stal) ??768 hz f timer time ? i/p ??eq?enc? (tmr) ?.?v~5.5v 0 4000 k hz ?.?v~5.5v 0 8000 khz 4.5v~5.5v 0 1?000 khz t wdtosc watchdog oscillato ? pe?iod ?v 45 90 180 s 5v ?? 65 1?0 s t res1 mcu exte?nal reset low p?lse width 1 s t res? a?dio p?ocesso? reset (auprst) low p?lse width 1 s t sst1 mcu s?stem sta?t-? p time pe?iod powe?-?p? reset o? wake-?p f? om halt mcu f sys = ??768hz 10?4 t sys t sst? a?dio p?ocesso? s?stem sta?t-? p time pe?iod ??om reset spi command availa?le afte? ?elease ?eset ?00 ms t sst? a?dio p?ocesso? s?stem sta?t-? p time pe?iod ??om sleep spi command availa?le f?om wake?p ? s t strt a?dio p?ocesso? s?stem sleep read? time ??om active a?dio p?ocesso? into sleep afte? hold command ? t sys t pst t ?up pll settling time ?o? pll ??eq deviation < 0.1% ?.?v~5.5v 6 10 ms t int inte???pt p?lse width 1 s t lvr low voltage width to reset 0.?5 1.00 ?.00 ms v mic mic inp? t voltage range ?.?v gain= -1 & pgagain= 0db 800 mv v demod demod inp? t voltage range ?.?v pgagain= 0db 800 mv v aux aux inp? t voltage range ?.?v pgagain= 0db 800 mv v audo audio o?tp? t voltage range ?v no load 0.01 0.99 v dd v mod mod o?tp? t voltage range ?v no load 1/4 ?/4 v dd v smod smod o?tp? t voltage range ?v no load 1/4 ?/4 v dd
rev. 1.10 1? ?e???a?? 1?? ?01? rev. 1.10 1? ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu adc electrical characteristics ope? ating tempe?at?? e: -40c to 85c? ta=?5c t ?pical symbol parameter test conditions min. typ. max. unit v dd conditions dnl diffe ?ential non-linea?it? ?v v re? =av dd =v dd t ad =0.5 s -? +? lsb 5v inl integ?al non-linea?it? ?v v re? =av dd =v dd t ad =0.5 s -4 +4 lsb 5v i adc onl? adc ena?le? othe?s disa?le ?v no load (t ad =0.5s ) 0.5 ma 5v no load (t ad =0.5s ) 0.6 ma t ad a/d clock pe?iod ?.7v~5.5v 0.5 10.0 s t adc ad conve? sion time (note) ?.7v~5.5v 1? ?it adc 16 t ad t on?st adc on to adc sta ?t ?.7v~5.5v ? s note: adc conversion time (t ad c )= n (bits adc) + 4 (sampling time), the conversion for each bit needs one adc clock(t ad ) d ac electrical characteristics ope? ating tempe?at?? e: -40c to 85c? ta=?5c t ?pical symbol parameter test conditions min. typ. max. unit v dd conditions v dd analog ope? ating voltage int ?efe?ence voltage ?.7 5.5 v v da da o ?tp? t voltage 00h~??h? no load 0.01 0.99 v dd t dac da conve ? sion time v dd =?v ? cl=10p 5 s inl integ?al non-linea?it? ?v v re? =av dd =v dd -? ? lsb dnl diffe ?ential non-linea?it? ?v v re? =av dd =v dd -1 1 lsb thd da total ha ?monic disto?tion -54 -48 d? ro da o ?tp?t resistance 5 k power on reset electrical characteristics symbol parameter v dd condition min. typ. max. unit v por1 vdd sta? t voltage to ens ??e powe?- on reset and mcu wo ?k res pin connect to vdd o? disa?le res pin f?nction lvr and wdt disa ?le witho?t 0.1 ? ?etween vdd and vss f sys =??khz? vdd d?ops f?om ?.?v to the vpor1 voltage with a 0.50v/ms slope? then stops fo? 1 second? when ?ising f?om the vpor1 voltage to ?.5v with a 0.0?v/ms slope? mcu pd? and to fag a?e "0" and ope?ates no?mall? . 100 mv r por_ac1 vdd rise rate to ens??e powe?-on reset and mcu wo ?k res pin connect ed to vdd o? disa?le res pin f?nction lvr and wdt disa ?le d without 0.1f between vdd and vss f sys =??khz? vdd d?ops f?om ?.?v to 0.5v with a 0.5v/ms slope? then stops fo? 1 second? when ?ising f?om 0.5v to ?.5v with a rpor_ ac1 slope, mcu pdf and to fag a?e "0" and ope?ates no?mall? . 0.0?5 v/ms
rev. 1.10 14 ?e???a?? 1?? ?01? rev. 1.10 15 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu symbol parameter v dd condition min. typ. max. unit v dcpor_max dc por maxim?m voltage res pin connect ed to vdd o? disa?le res pin f?nction lvr and wdt disa ?le d witho?t 0.1 ? ?etween vdd and vss vdd d?ops f?om 5v with a 0.1v/s slope? ? ntil the por voltage is gene?ated. 0.6 1.8 v t por1 powe?-on reset low p?lse width res pin connect to vdd o? disa?le res pin f?nction lvr and wdt disa ?le without 0.1f between vdd and vss vdd d?ops f?om 5.0v to 0.5v at high speed? stops fo? the t por1 time? then a??ives at 5.0v at high speed? and will gene?ate a por time. ? s t por? powe?-on reset low p?lse width res pin connect ed to vdd o? disa?le res pin f?nction lvr and wdt disa ?le d with 0.1f between vdd and vss vdd d?ops f?om 5.0v to 0.5v at high speed? stops fo? the t por? time? then a??ives at 5.0v at high speed? and will gene?ate a por time. 10 s audio process or characteristics ope? ating tempe?at??e: 10c to 70c? ta=?5c t ?pi cal v dd = ?.?v inp?t stage gain = 0db. o?tp?t stage atten?ation = 0db. xtal ??eq?enc? = ??.768khz 0.01% (100ppm)? f sys1 d?ift < 0.1% refe?ence signal level is 780mv ?ms at 1khz with v dd = ?.?v symbol parameter test conditions min. typ. max. unit v dd conditions ctcss receiver sensitivit? ?.?v ?8 mv-peak response time ?.?v note1 168 ?10 ms de-? esponse time ?.?v dt1+150 ms dt1 d?opo?t imm?nit? ?.?v 0 ?00 819? ms ??eq?enc? range ?.?v 60 ?60 hz dcs receiver sensitivit? ?.?v 7? mv ?ms response time ?.?v ?00 ms de-? esponse time ?.?v dt?+90 ms d?opo?t imm?nit? ?.?v 0 819? ms ctcss/dcs off tone sensitivit? ?.?v ?8 mv-peak response time ?.?v 90 ms de-? esponse time ?.?v 160 ms selective call/user tone & in-band tone receiver sensitivit? ?.?v 70 mv-peak response time ?.?v 50 ms de-? esponse time ?.?v 45 ms ??eq?enc? range ?.?v ?00 ?000 hz
rev. 1.10 14 ?e???a?? 1?? ?01? rev. 1.10 15 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu symbol parameter test conditions min. typ. max. unit v dd conditions dtmf receiver sensitivit? ?.?v ?00 mv ?ms response time ?.?v note ? 45 ms de-? esponse time ?.?v ?5 ms ??eq?enc? tole?ance ?.?v 1.8 % ??eq?enc? rejection ?.?v ?.6 % audio compandor attack time ?.?v 4 ms deca? time ?.?v 14 ms 0db point ?.?v 100 mv ?ms comp?ession/expansion ratio ?.?v ctcss generator ??eq?enc? range ?.?v 67 ?75 hz tone ??eq?enc? acc??ac? ?.?v 0.? % total ha ?monic disto?tion ?.?v 1.0 ?.0 % dcs generator bit rate ?.?v 1?4.4 bps in-band tone generator ??eq?enc? range ?.?v ?00 1000 ?000 hz tone ??eq?enc? acc??ac? ?.?v 0.1 % total ha ?monic disto?tion ?.?v 1.0 ?.0 % dtmf generator low g?o?p ??eq?enc? range ?.?v 697 941 hz high g?o?p ??eq?enc? range ?.?v 1?09 16?? hz o?tp?t signal level ?.?v 600 mv ?ms audio channel flter received a ?dio ?.?v ?00 ?400 hz 1? .5khz channel t ?ansmitted a?dio ?.?v ?00 ?550 hz ? 5khz channel t ?ansmitted a?dio ?.?v ?00 ?000 hz pass-?and gain ?.?v ??eq?enc?= 1.0khz 0 db pass-?and ripple ?.?v ??eq?enc?= 1.0khz -?.0 0 +0.? db stop-?and atten?ation ?.?v for 12.5k flter stop- ?and at ?.4k ?fo? ?5k flter stop-band at 3.7k. ?0 db de-emphasis ?.?v -6 db/oct p?e-emphasis ?.?v +6 db/oct hpf300 filter pass-?and gain ?.?v ??eq?enc? = 1.0khz 0 db pass-?and ripple ?.?v ??eq?enc? = 1.0khz -?.0 0 +0.? db stop-?and atten?ation ?.?v pass?and ?00hz ? stop?and ?50hz ?0 db audio scrambler inve?sion ??eq?enc? ?.?v ??00 hz pass band (selecting ??00hz inve?sion ??eq?enc?) ?.?v ?00 ?000 hz
rev. 1.10 16 ?e???a?? 1?? ?01? rev. 1.10 17 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu symbol parameter test conditions min. typ. max. unit v dd conditions audio expandor inp?t signal range ?.?v ??? mv ?ms note: 1. send a signal of 67hz, its threshold amplitude is 28 mv-peak . 2. the dtmf threshold amplitude is set as 200 mv ?ms fo? ?oth tones . 3: all adjusted or default decoder threshold should be set greater than the system noise fow, otherwise the corresponding function does not work normally. all threshold values would be scaled according to the operating voltage. 4: dt(1 and 2) setting reference to 04de address. system architecture a key factor in the high-performance features of the holtek range of microcontrollers is attributed to their internal system architecture. the range of devices take advantage of the usual features found within risc microcontrollers providing increased speed of operation and enhanced performance. the pipelining scheme is implemented in such a way that instruction fetching and instruction execution are overlapped, hence instructions are effectively executed in one cycle, with the exception of branch or call instructions. an 8-bit wide alu is used in practically all instruction set operations, which carries out arithmetic operations, logic operations, rotation, increment, decrement, branch decisions, etc. the internal data path is simplifed by moving data through the accumulator and the alu. certain internal registers are implemented in the data memory and can be directly or indirectly addressed. the simple addressing methods of these registers along with additional architectural features ensure that a minimum of external components is required to provide a functional i/o and a/d control system with maximum reliability and flexibility. this makes the device suitable for low-cost, high-volume production for controller applications. clocking and pipelining the system clock, derived from an rc oscillator is subdivided into four internally generated non-overlapping clocks, t1~t4. the program counter is incremented at the beginning of the t1 clock during which time a new instruction is fetched. the remaining t2~t4 clocks carry out the decoding and execution functions. in this way, one t1~t4 clock cycle forms one instruction cycle. although the fetching and execution of instructions takes place in consecutive instruction cycles, the pipelining structure of the microcontroller ensures that instructions are effectively executed in one instruction cycle. the exception to this are instructions where the contents of the program counter are changed, such as subroutine calls or jumps, in which case the instruction will take one more instruction cycle to execute. for instructions involving branches, such as jump or call instructions, two instruction cycles are required to complete instruction execution. an extra cycle is required as the program takes one cycle to frst obtain the actual jump or call address and then another cycle to actually execute the branch. the requirement for this extra cycle should be taken into account by programmers in timing sensitive applications.                                                        
                       ?                     ?        ?  ?   ? system clocking and pipelining
rev. 1.10 16 ?e???a?? 1?? ?01? rev. 1.10 17 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu                             
      ? ? ? ?     ?  ? ? ?   ?                                  ? instruction fetching program counter C pc during program execution, the program counter is used to keep track of the address of the next instruction to be executed. it is automatically incremented by one each time an instruction is executed except for instructions, such as jmp or call that demand a jump to a non- consecutive program memory address. i t must be noted that only the lower 8 bits, known as the program counter low register, are directly addressable by user. when executing instructions requiring jumps to non-consecutive addresses such as a jump instruction, a subroutine call, interrupt or reset, etc. the microcontroller manages program control by loading the required address into the program counter. for conditional skip instructions, once the condition has been met, the next instruction, which has already been fetched during the present instruction execution, is discarded and a dummy cycle takes its place while the correct instruction is obtained. program counter program counter high byte pcl register low byte pc1?~pc8 pcl7~pcl0               bank pointer (bp) the lower byte of the program counter, known as the program counter low register or pcl, is available for program control and is a readable and writeable register. by transferring data directly into this register, a short program jump can be executed directly, however, as only this low byte is available for manipulation, the jumps are limited to the present page of memory, that is 256 locations. when such program jumps are executed it should also be noted that a dummy cycle will be inserted. the lower byte of the program counter is fully accessible under program control. manipulating the pcl might cause program branching, so an extra cycle is needed to pre-fetch. further information on the pcl register can be found in the special function register section.
rev. 1.10 18 ?e???a?? 1?? ?01? rev. 1.10 19 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu stack this is a special part of the memory which is used to save the contents of the program counter only. the stack is neither part of the data nor part of the program space, and is neither readable nor writeable. the activated level is indexed by the stack pointer, and is neither readable nor writeable. at a subroutine call or interrupt acknowledge signal, the contents of the program counter are pushed onto the stack. at the end of a subroutine or an interrupt routine, signaled by a return instruction, ret or reti, the program counter is restored to its previous value from the stack. after a device reset, the stack pointer will point to the top of the stack.                                
                            if the stack is full and an enabled interrupt takes place, the interrupt request fag will be recorded but the acknowledge signal will be inhibited. when the stack pointer is decremented, by ret or reti, the interrupt will be serviced. this feature prevents stack overfow allowing the programmer to use the structure more easily. however, when the stack is full, a call subroutine instruction can still be executed which will result in a stack overfow. precautions should be taken to avoid such cases which might cause unpredictable program branching. if the stack is overfow, the frst program counter save in the stack will be lost. arithmetic and logic unit C alu the arithmetic-logic unit or alu is a critical area of the microcontroller that carries out arithmetic and logic operations of the instruction set. connected to the main microcontroller data bus, the alu receives related instruction codes and performs the required arithmetic or logical operations after which the result will be placed in the specifed register. as these alu calculation or operations may result in carry, borrow or other status changes, the status register will be correspondingly updated to refect these changes. the alu supports the following functions: arithmetic operations: add, addm, adc, adcm, sub, subm, sbc, sbcm, daa logic operations: and, or, xor, andm, orm, xorm, cpl, cpla rotation rra, rr, rrca, rrc, rla, rl, rlca, rlc increment and decrement inca, inc, deca, dec branch decision, jmp, sz, sza, snz, siz, sdz, siza, sdza, call, ret, reti
rev. 1.10 18 ?e???a?? 1?? ?01? rev. 1.10 19 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu program memory the program memory is the location where the user code or program is stored. the device is supplied with one-time programmable, otp, memory where users can program their application code into the device. by using the appropriate programming tools, otp devices offer users the fexibility to freely develop their applications which may be useful during debug or for products requiring frequent upgrades or program changes. structure the program memory has a capacity of 16kx16. the program memory is addressed by the program counter and also contains data, table information and interrupt entries. table data, which can be setup in any location within the program memory, is addressed by separate table pointer registers. the device has its program memory divided into two banks, bank 0 and bank 1. the required bank is selected using bit 5 of the bp register.                      
       
     
           
       
       
   ?     
 ? ?  special vectors within the program memory, certain locations are reserved for special usage such as reset and interrupts. reset vector this vector is reserved for use by the device reset for program initialization. after a device reset is initiated, the program will jump to this location and begin execution. external interrupt vector this vector is used by the external interrupt. if the external interrupt pin on the device receives an edge transition, the program will jump to this location and begin execution if the external interrupt is enabled and the stack is not full. the external interrupt active edge transition type, whether high to low, low to high or both is specifed in the ctrl1 register. audio processor interrupt vector this vector is used by the audio processor interrupt. the audio processor interrupt is initialized by setting the audio processor request fag,. if the interrupt is enabled, the stack is not full and the aupf is set, a sub-routine call will occur.
rev. 1.10 ?0 ?e???a?? 1?? ?01? rev. 1.10 ?1 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu timer/event 0/1/2 counter interrupt vector this internal vector is used by the timer/event counters. if a timer/event counter overflow occurs, the program will jump to its respective location and begin execution if the associated timer/event counter interrupt is enabled and the stack is not full. time base interrupt vector this internal vector is used by the internal time base. if a time base overflow occurs, the program will jump to this location and begin execution if the time base counter interrupt is enabled and the stack is not full. look-up table any location within the program memory can be defned as a look-up table where programmers can store fxed data. to use the look-up table, the table pointer must frst be setup by placing the address of the look up data to be retrieved in the table pointer register, tblp and tbhp. these registers defne the total address of the look-up table. after setting up the table pointer, the table data can be retrieved from the program memory using the tabrd c [m] or tabrdl[m] instructions, respectively. when the instruction is executed, the lower order table byte from the program memory will be transferred to the user defned data memory register [m] as specified in the instruction. the higher order table data byte from the program memory will be transferred to the tblh special register. any unused bits in this transferred higher order byte will be read as 0. the accompanying diagram illustrates the addressing data fow of the look-up table.                            
 
               

               table program example the following example shows how the table pointer and table data is defned and retrieved from the microcontroller. this example uses raw table data located in the program memory which is stored there using the org statement. the value at this org statement is 3f00h which refers to the start address of the last page within the 16k words program memory of the device. the table pointer is setup here to have an initial value of 06h. this will ensure that the frst data read from the data table will be at the program memory address 3f06h or 6 locations after the start of the last page. note that the value for the table pointer is referenced to the frst address of the present page if the tabrd c [m] instruction is being used. the high byte of the table data which in this case is equal to zero will be transferred to the tblh register automatically when the tabrd l [m] instruction is executed. because the tblh register is a read-only register and cannot be restored, care should be taken to ensure its protection if both the main routine and interrupt service routine use table read instructions. if using the table read instructions, the interrupt service routines may change the value of the tblh and subsequently cause errors if used again by the main routine. as a rule it is recommended that simultaneous use of the table read instructions should be avoided. however, in situations where simultaneous use cannot be avoided, the interrupts should be disabled prior to the
rev. 1.10 ?0 ?e???a?? 1?? ?01? rev. 1.10 ?1 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu execution of any main routine table-read instructions. note that all table related instructions require two instruction cycles to complete their operation. instruction(s) table location b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0 tabrdc [m] pc1? pc1? pc11 pc10 pc9 pc8 @7 @6 @5 @4 @? @? @1 @0 tabrdl [m] 1 1 1 1 1 1 @7 @6 @5 @4 @? @? @1 @0 table location note: pc13~pc8: current program counter bits. @7~@0: table pointer tblp bits. b13~b0: table address location bits. table read program example tempreg1 db ? ;temporary register #1 tempreg2 db ? ;temporary register #2 : : mov a,06h ;initialise low table pointer - note that this address mov tblp,a ;is referenced mov a,07h ;initialise high table pointer tbhp,a : : tabrd l tempreg1 ;transfers value in table referenced by table ;pointer data at program ;memory address 3f06h transferred to tempreg1 ;and tblh dec tblp ;reduce value of table pointer by one tabrd l tempreg2 ; transfers value in table referenced by table ;pointer data at program ;memory address 3f05h transferred to tempreg2 ;and tblh in this ;example the data 1ah is transferred to ;tempreg1 and data 0fh to ;register tempreg2 : : org 3f00h ;sets initial address of program memory dc 00ah, 00bh, 00ch, 00dh, 00eh, 00fh, 01ah, 01bh
rev. 1.10 ?? ?e???a?? 1?? ?01? rev. 1.10 ?? ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu data memory the data memory is a 8-bit wide ram internal memory and is the location where temporary information is stored. structure divided into two sections, the frst of these is an area of ram, known as the special function data memory. here are located registers which are necessary for correct operation of the device. many of these registers can be read from and written to directly under program control, however, some remain protected from user manipulation. the second area of data memory is reserved for general purpose use. all locations within this area are read and write accessible under program control. capacity banks 10?4x8 0: 40h~??h 1: 40h~??h ?: 40h~??h ?: 40h~??h 4: 40h~??h 5: 40h~??h the two sections of data memory, the special purpose and general purpose data memory are located at consecutive locations. all are implemented in ram and are 8 bits wide but the length of each memory section is dictated by the type of microcontroller chosen. the start address of the data memory is the address 00h. all microcontroller programs require an area of read/write memory where temporary data can be stored and retrieved for use later. it is this area of ram memory that is known as general purpose data memory. this area of data memory is fully accessible by the user program for both read and write operations. by using the set [m].i and clr [m].i instructions individual bits can be set or reset under program control giving the user a large range of fexibility for bit manipulation in the data memory. for this device, the data memory is subdivided into six banks, which are selected using a bank pointer. only data in bank 0 can be directly addressed, data in bank 1~5 must be indirectly addressed.                  
              
                                
    data memory structure note: most of the data memory bits can be directly manipulated using the set [m].i and clr[m].i with the exception of a few dedicated bits. the data memory can also be accessed through the memory pointer registers.
rev. 1.10 ?? ?e???a?? 1?? ?01? rev. 1.10 ?? ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu special purpose data memory this area of data memory is where registers, necessary for the correct operation of the microcontroller, are stored. most of the registers are both readable and writeable but some are protected and are readable only, the details of which are located under the relevant special function register section. note that for locations that are unused, any read instruction to these addresses will return the value 00h. special function registers to ensure successful operation of the microcontroller, certain internal registers are implemented in the data memory area. these registers ensure correct operation of internal functions such as timers, interrupts, etc., as well as external functions such as i/o data control. the location s of these registers within the data memory begin at the address 00h and are mapped from bank 0 to bank 5. any unused data memory locations between these special function registers and the point where the general purpose memory begins is reserved and attempting to read data from these locations will return a value of 00h. indirect addressing registers C iar0, iar1 the indirect addressing registers, iar0 and iar1, although having their locations in normal ram register space, do not actually physically exist as normal registers. the method of indirect addressing for ram data manipulation uses these indirect addressing registers and memory pointers, in contrast to direct memory addressing, where the actual memory address is specifed. actions on the iar0 and iar1 registers will result in no actual read or write operation to these registers but rather to the memory location specifed by their corresponding memory p ointers, mp0 or mp1. acting as a pair, iar0 and mp0 can together access data from bank 0 while the iar1 and mp1 register pair can access data from any bank. as the indirect addressing registers are not physically implemented, reading the indirect addressing registers indirectly will return a result of 00h and writing to the registers indirectly will result in no operation. memory pointers C mp0, mp1 two memory pointers, known as mp0 and mp1 are provided. these memory pointers are physically implemented in the data memory and can be manipulated in the same way as normal registers providing a convenient way with which to indirectly address and track data. mp0 can only be used to indirectly address data in bank 0 while mp1 can be used to address data from bank 0 to bank 5. when any operation to the relevant indirect addressing registers is carried out, the actual address that the microcontroller is directed to, is the address specifed by the related memory pointer. note that indirect addressing using mp1 and iar1 must be used to access any data in bank 1~bank 5.
rev. 1.10 ?4 ?e???a?? 1?? ?01? rev. 1.10 ?5 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu the following example shows how to clear a section of four data memory locations already defned as locations adres1 to adres4.                           
                               
                             ? ? ? ? ? ? ?? ?? ? ? ? ?  ?  ?   ?  ?        ? ?             ? ?  ? ?  ? ?   ??   ? - ? ?  ? ??   ?  ? ?? ?  ? ?    ?                
                               
                 ? ?              ?  ? ?   ? ?  ?             ?    ??  data memory indirect addressing program example data .section data adres1 db ? adres2 db ? adres3 db ? adres4 db ? block db ? code.section at 0 code org00h start : mov a , 04h ;setup size of block mov block , a mov a , offset adres1 ;accumulator loaded with frst ram address mov mp0 , a ;setup memory pointer with frst ram address loop : clr iar0 ;clear the data at address defned by mp0 inc mp0 ;increment memory pointer sdz block ;check if last memory location has been cleared jmp loop continue : the important point to note here is that in the example, no reference is made to specific data memory addresses.
rev. 1.10 ?4 ?e???a?? 1?? ?01? rev. 1.10 ?5 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu accumulator C acc the accumulator is central to the operation of any microcontroller and is closely related with operations carried out by the alu. the accumulator is the place where all intermediate results from the alu are stored. without the accumulator it would be necessary to write the result of each calculation or logical operation such as addition, subtraction, shift, etc., to the data memory resulting in higher programming and timing overheads. data transfer operations usually involve the temporary storage function of the accumulator; for example, when transferring data between one user defined register and another, it is necessary to do this by passing the data through the accumulator as no direct transfer between two registers is permitted. program counter low register C pcl to provide additional program control functions, the low byte of the program counter is made accessible to programmers by locating it within the special purpose area of the data memory. by manipulating this register, direct jumps to other program locations are easily implemented. loading a value directly into this pcl register will cause a jump to the specifed program memory location. however, as the register is only 8-bit wide, only jumps within the current program memory page are permitted. when such operations are used, note that a dummy cycle will be inserted. bank pointer C bp in this device, the program and data memory are divided into several banks. selecting the required program and data memory area is achieved using the bank pointer. bit 5 of the bank pointer is used to select program memory bank 0 or 1, while bits 0~2 are used to select data memory banks 0~ 5 . the data memory is initialised to bank 0 after a reset, except for the wdt time-out reset in the power down mode, in which case, the data memory bank remains unaffected. it should be noted that special function data memory is not affected by the bank selection, which means that the special function registers can be accessed from within any bank. directly addressing the data memory will always result in bank 0 being accessed irrespective of the value of the bank pointer. accessing data from banks other than bank 0 must be implemented using indirect addressing. as both the program memory and data memory share the same bank pointer register, care must be taken during programming.
rev. 1.10 ?6 ?e???a?? 1?? ?01? rev. 1.10 ?7 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu bp register bit 7 6 5 4 3 2 1 0 name pmbp0 dmbp? dmbp1 dmbp0 r/w r/w r/w r/w r/w por 0 0 0 0 bit 7 ~ 6 unimplemented, read as 0 bit 5 pmbp0 : program memory bank pointer 0: bank 0 1: bank 1 bit 4 ~ 3 unimplemented, read as 0 bit 2 ~ 0 dmbp2 ~ dmbp0 : data memory bank pointer 000: bank 0 001: bank 1 010: bank 2 011: bank 3 100: bank 4 101: bank 5 110~111: undefned status register C status this 8-bit register contains the zero fag( z), carry fag ( c), auxiliary carry fag( ac), overfow fag( ov), power down fag( pdf), and watchdog time-out fag( to). these arithmetic/logical operation and system management fags are used to record the status and operation of the microcontroller . with the exception of the to and pdf fags, bits in the status register can be altered by instructions like any other register. any data written into the status register will not change the to and pdf flags. in addition operations related to the status register may give different results from those intended. the to fag can be affected only by system power-up, a wdt time-out or executing the halt or clr wdt instruction. the pdf fag can be affected only by executing the hlat or clr wdt instruction or a system power-up. the z, ov, c, ac fags generally refect the statuses of the latest operations. in addition, on entering the interrupt sequence or executing the subroutine call, the status register will not be pushed onto stack automatically. if the contents of status are important and the subroutine can corrupt the status register, the programmer has to take precautions to save it properly.
rev. 1.10 ?6 ?e???a?? 1?? ?01? rev. 1.10 ?7 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu status register bit 7 6 5 4 3 2 1 0 name to pd? ov z ac c r/w r r r/w r/w r/w r/w por 0 0 x x x x "x" ?nknown bit 7~6 unimplemented, read as 0 bit 5 to : watchdog time-out fag 0: after power up or executing the clr wdt or halt instruction 1: a watchdog time-out occurred. bit 4 pdf : power down fag 0: after power up or executing the clr wdt instruction 1: by executing the halt instruction bit 3 ov : overfow fag 0: no overfow 1: an operation results in a carry into the highest-order bit but not a carry out of the highest- order bit or vice versa. bit 2 z : zero fag 0: the result of an arithmetic or logical operation is not zero 1: the result of an arithmetic or logical operation is zero bit 1 ac : auxiliary fag 0: no auxiliary carry 1: an operation results in a carry out of the low nibbles in addition, or no borrow from the high nibble into the low nibble in subtraction bit 0 c : carry fag 0: no carry-out 1: an operation results in a carry during an addition operation or if a borrow does not take place during a subtraction operation c is also affected by a rotate through carry instruction. input/output ports and control registers within the area of special function registers, the port pa, pb, etc data i/o registers and their associated control register pac, pbc, etc play a prominent role. these registers are mapped to specific addresses within the data memory as shown in the data memory table. the data i/o registers, are used to transfer the appropriate output or input data on the port. the control registers specifes which pins of the port are set as inputs and which are set as outputs. to setup a pin as an input, the corresponding bit of the control register must be set high, for an output it must be set low. during program initialisation, it is important to first setup the control registers to specify which pins are outputs and which are inputs before reading data from or writing data to the i/o ports. one fexible feature of these registers is the ability to directly program single bits using the set [m].i and clr [m].i instructions. the ability to change i/o pins from output to input and vice versa by manipulating specifc bits of the i/o control registers during normal program operation is a useful feature of this device.
rev. 1.10 ?8 ?e???a?? 1?? ?01? rev. 1.10 ?9 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu system control register C ctrl0, ctrl1, ctrl2 these registers are used to provide control over various internal functions. some of these include the pfd control, audio processor control, certain system clock options, the lxt oscillator low power control, external interrupt edge trigger type, watchdog timer enable function, time base function division ratio, and the lxt oscillator enable control. ctrl0 register bit 7 6 5 4 3 2 1 0 name pc?g p?dcs p?dc lxtlp clkmod r/w r/w r/w r/w r/w r/w por 0 0 0 0 1 bit7 pcfg : i/o confguration 0: int/tmr0/pfd pin-shared with pa3/pa2/pa1 1: int/tmr0/pfd pin-shared with pb4/pb5/pb6 bit6 pfdcs : pfd clock source 0: timer0 1: timer1 bit5~3 unimplemented, read as 0. bit2 pfdc : i/o or pfd 0: i/o 1: pfd bit1 lxtlp : lxt oscillator low power control function 0: lxt oscillator quick start-up mode 1: lxt oscillator low power mode bit0 clkmod : system clock mode selection 0: high system clock -pll mode. 1: low system clock - lxt used as system clock. ctrl1 register bit 7 6 5 4 3 2 1 0 name integ1 integ0 tbsel1 tbsel0 wdten? wdten? wdten1 wdten0 r/w r/w r/w r/w r/w r/w r/w r/w r/w por 1 0 0 0 1 0 1 0 bit 7, 6 integ1, integ0 : external interrupt edge type 00: disable 01: rising edge trigger 10: falling edge trigger 11: dual edge trigger bit 5, 4 tbsel1, tbsel0 : time base period selection 00: 2 10 (1/f tp ) 01: 2 11 (1/f tp ) 10: 2 12 (1/f tp ) 11: 2 13 (1/f tp )
rev. 1.10 ?8 ?e???a?? 1?? ?01? rev. 1.10 ?9 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu bit 3~0 wdten3, wdten2, wdten1, wdten0 : wdt function enable 1010: wdt disabled other values: wdt enabled - recommended value is 0101 if the watchdog timer enable is confguration option is selected, then the watchdog timer will always be enabled and the wdten3~wdten0 control bits will have no effect. note: the wdt is only disabled when both the wdt confguration option is disabled and when bits wdten3~wdten0=1010. the wdt is enabled when either the wdt confguration option is enabled or when bits wdten3~wdten01010. ctrl2 register bit 7 6 5 4 3 2 1 0 name m1 m0 plld? auprst pllen plld1 plld0 lxten r/w r/w r/w r/w r/w r/w r/w r/w r/w por 0 0 1 0 0 1 1 0 bit7 ~6 m1 , m0 : pll output frequency selection 0 0 : 8.192mhz 01: 10.24mhz 10: 12.288mhz 11: 16.384mhz bit5 plld2 : pll output frequency divider selection (for audio processor) 0: pll output frequency divide d by 1 1: pll output frequency divide d by 2 bit4 auprst : audio processor hardware reset bit 101: audio processor reset . bit3 pllen : pll enable 0: disable 1: enable bit2 ~1 plld1 , plld0 : pll output frequency divider selection (for mcu ) 00: useless that will be forced to 1, 1 by hardware 01: pll output frequency divide d by 1 10: pll output frequency divide d by 2 11: pll output frequency divide d by 4 bit0 lxten : lxt oscillator on/off control after execution of halt instruction 0: lxt off in idle m ode 1: lxt on in idle mode pll output frequency for audio processor system clock (f ap )and divider reference clock is according to m1, m0 setting as shown below. pllen m1 m0 clock output 0 x x low(logic state) 1 0 0 8.19?mhz 1 0 1 10.?4mhz 1 1 0 1?.?88mhz 1 1 1 16.?84mhz x: dont ca?e
rev. 1.10 ?0 ?e???a?? 1?? ?01? rev. 1.10 ?1 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu divided pll output frequency for mcu system clock. plld1 , plld0 0?1 1?0 1?1 divide 1 ? 4 pll freq (mhz) 8.19? f sys (mhz) 8.19? 4.096 ?.048 10.?4 10.?4 5.1? ?.56 1?.?88 1?.?88 6.144 ?.07? 16.?84 16.?84 8.19? 4.096 note: plld1, plld0 = 0,0 is useless that will be forced to 1,1 by h/w. divided pll output frequency for audio processor system clock. plld2 0 1 divide 1 ? pll freq (mhz) 8.19? f sys (mhz) 8.19? 4.096 10.?4 10.?4 5.1? 1?.?88 1?.?88 6.144 16.?84 16.?84 8.19? wake-up function register C pawk when the microcontroller enters the idle/sleep mode, various methods exist to wake the device up and continue with normal operation. one method is to allow a falling edge on the i/o pins to have a wake-up function. this register is used to select which port a i/o pins are used to have this wake-up function. pull-high registers C papu, pbpu, pcpu, pdpu, pepu the i/o pins, if configured as inputs, can have internal pull-high resistors connected, which eliminates the need for external pull-high resistors. this register selects which i/o pins are connected to internal pull-high resistors. oscillator various oscillator options offer the user a wide range of functions according to their various application requirements. the flexible features of the oscillator functions ensure that the best optimisation can be achieved in terms of speed and power saving. oscillator selections and operation are selected through a combination of confguration options and registers. system oscillator overview in addition to being the source of the main system clock the oscillators also provide clock sources for the watchdog timer and time base functions and three timers . the system oscillator can be provided from a choice of two oscillator modes, lxt crystal oscillator and lxt crystal oscillator +pll (by a pplication program) . the lxt crystal oscillator is always turned on in normal mode, but pll can be set by a pplication program. system clock source will be provided by lxt crystal oscillator or pll
rev. 1.10 ?0 ?e???a?? 1?? ?01? rev. 1.10 ?1 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu external 32768hz crystal oscillator C lxt the lxt oscillator is used both as the slow system clock and also as a selectable source clock for some peripheral functions including the watchdog timer, time base, timer/event counters functions etc. it must be frst enabled using a confguration option. to select the lxt oscillator to be the low speed system oscillator, the clkmod bit in the ctrl0 register should be set high. when a halt instruction is executed, the system clock is stopped, but the lxten bit in the ctrl2 register determines if the lxt oscillator continues running when the microcontroller powers down. setting the lxten bit high will enable the lxt to keep running after a halt instruction is executed and enable the lxt oscillator to remain as a possible clock source for the watchdog timer, the time-base and the timer/event counters. execute halt instruction lxten bit lxt oscillator stops lxt oscillator keeps running idle mode idle mode 0 1 system clock stops lxten bit function the lxt oscillator is implemented using a 32768hz crystal connected to pins xin/xout. however, for some crystals and to ensure oscillation and accurate frequency generation, it is normally necessary to add two small value external capacitors, c1 and c2. the exact values of c1 and c2 should be selected in consultation with the crystal or resonator manufacturer specifcation. the external parallel feedback resistor, rp, may also be required.                 
               lxt oscillator c1 and c2 values c??stal ??eq?enc? c1 c? ??.768khz 10p? 10p? note: c1 and c? val?es a?e fo? g?idance onl? . r p =10m is recommended. 32768 hz crystal recommended capacitor values
rev. 1.10 ?? ?e???a?? 1?? ?01? rev. 1.10 ?? ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu lxt oscillator low power function the lxt oscillator can function in one of two modes, the quick start mode and the low power mode. the mode selection is executed using the lxtlp bit in the ctrl0 register . lxtlp bit lxt mode 0 q?ick sta?t 1 low-powe? after power on, the lxtlp bit will be automatically cleared to zero ensuring that the lxt oscillator is in the quick start operating mode. in the quick start mode the lxt oscillator will power up and stabilise quickly. however, after the lxt oscillator has fully powered up it can be placed into the low-power mode by setting the lxtlp bit high. the oscillator will continue to run but with reduced current consumption, as the higher current consumption is only required during the lxt oscillator start-up. in power sensitive applications, such as battery applications, where power consumption must be kept to a minimum, it is therefore recommended that the application program sets the lxtlp bit high about 2 seconds after power-on. it should be noted that, no matter what condition the lxtlp bit is set to, the lxt oscillator will always function normally, the only difference is that it will take more time to start up if in the low-power mode. operating modes by using the lxt low frequency oscillator in combination with pll, the system can be selected to operate in a number of different modes. these modes are normal, slow, idle and sleep. mode types and selection for this device the lxt oscillator can run together with pll. the clkmod bit in the ctrl0 register can be used to switch the system clock from the selected pll mode or the low speed lxt oscillator. when the halt instruction is executed the lxt oscillator can be chosen to run or not, using the lxten bit in the ctrl2 register.                            
  
                  ?    ?
           
? ?
        ?    ? ?     ? 
  
 ? system clock confuration
rev. 1.10 ?? ?e???a?? 1?? ?01? rev. 1.10 ?? ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu operating mode and mcu system clock source is as following table. operating mode control halt instruction idle command pllen bit clkmod bit lxten bit lxt oscillator mcu system clock mcu mode audio processor system clock audio processor mode non exec?ted non exec?ted 1 0 x on pll no?mal pll no?mal exec?ted 1 0 x on pll halt idle non exec?ted 1 1 x on lxt slow pll no?mal exec?ted 1 1 x on lxt halt idle exec?ted exec?ted 0 1 1 on halt idle halt idle 0 1 0 off halt sleep note: 1. lxt oscillator is the 32768 hz oscillator. 2 . sst for lxt osc is 1024 clocks. 3. i f pllen=0 , clkmod bit will be set . 4. the audio processor must execute audio processor idle command via spi, before mcu executed halt instruction or disable pll (pllen=0). the mcu operating mode switch timing are shown in the following fgures.                                  
       
  

 
          ?   ?                      
                  ?  ?       ?  ?  ?     ?    ?     ?
rev. 1.10 ?4 ?e???a?? 1?? ?01? rev. 1.10 ?5 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu the audio processor operating mode switch timing as following fgure. mode switching the device is switched between one mode and another using a combination of the clkmod bit in the ctrl0 register and the halt instruction. the clkmod bit chooses whether the system runs in either the normal or slow mode by selecting the system clock to be sourced from lxt crystal oscillator or pll . the halt instruction forces the system into either the idle or sleep mode, depending upon whether the lxt oscillator is running or not. the halt instruction operates independently of the clkmod bit condition. when a halt instruction is executed and the lxt oscillator is not running, the system enters the sleep mode the following conditions exist: the system oscillator will stop running and the application program will stop at the halt instruction the data memory contents and registers will maintain their present condition the wdt will be cleared and resume counting if the wdt clock source is selected to come from the wdt or lxt oscillator. the wdt will stop if its clock source originates from the system clock the i/o ports will maintain their present condition in the status register, the power down fag, pdf, will be set and the watchdog time-out fag, to, will be cleared
rev. 1.10 ?4 ?e???a?? 1?? ?01? rev. 1.10 ?5 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu standby current considerations as the main reason for entering the idle/sleep mode is to keep the current consumption of the mcu to as low a value as possible, perhaps only in the order of several micro-amps, there are other considerations which must also be taken into account by the circuit designer if the power consumption is to be minimised. special attention must be made to the i/o pins on the device. all high-impedance input pins must be connected to either a fxed high or low level as any foating input pins could create internal oscillations and result in increased current consumption. care must also be taken with the loads, which are connected to i/o pins, which are setup as outputs. these should be placed in a condition in which minimum current is drawn or connected only to external circuits that do not draw current, such as other cmos inputs. if the confguration options have enabled the watchdog timer internal oscillator wdtosc then this will continue to run when in the idle/sleep mode and will thus consume some power. for power sensitive applications it may be therefore preferable to use the system clock source for the watchdog timer. the lxt, if confgured for use, will also consume a limited amount of power, as it continues to run when the device enters the idle mode. to keep the lxt power consumption to a minimum level the lxtlp bit in the ctrl0 register, which controls the low power function, should be set high. wake-up after the system enters the idle/sleep mode, it can be woken up from one of various sources listed as follows: an external reset an external falling edge on pa0 to pa7 a system interrupt a wdt overfow if the system is woken up by an external reset, the device will experience a full system reset, however, if the device is woken up by a wdt overfow, a watchdog timer reset will be initiated. although both of these wake-up methods will initiate a reset operation, the actual source of the wake-up can be determined by examining the to and pdf flags. the pdf flag is cleared by a system power-up or executing the clear watchdog timer instructions and is set when executing the halt instruction. the to fag is set if a wdt time-out occurs, and causes a wake-up that only resets the program counter and stack pointer, the other fags remain in their original status. pins pa0 to pa7 can be setup via the pawk register to permit a negative transition on the pin to wake-up the system. when a pa0 to pa7 pin wake-up occurs, the program will resume execution at the instruction following the halt instruction. if the system is woken up by an interrupt, then two possible situations may occur. the frst is where the related interrupt is disabled or the interrupt is enabled but the stack is full, in which case the program will resume execution at the instruction following the halt instruction. in this situation, the interrupt which woke-up the device will not be immediately serviced, but will rather be serviced later when the related interrupt is fnally enabled or when a stack level becomes free. the other situation is where the related interrupt is enabled and the stack is not full, in which case the regular interrupt response takes place. if an interrupt request fag is set to 1 before entering the idle/sleep mode, then any future interrupt requests will not generate a wake- up function of the related interrupt will be ignored.
rev. 1.10 ?6 ?e???a?? 1?? ?01? rev. 1.10 ?7 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu wake-up source oscillator type crystal exte?nal res t rstd + t sst pa po ?t t sst inte???pt wdt overfow note: 1. t rstd (reset delay time) , t sys (system clock). 2. t rstd is power-on delay, typical time= 100ms. 3 . t sst = 1024 t sys. wake-up delay time watchdog timer the watchdog timer, also known as the wdt, is provided to inhibit program malfunctions caused by the program jumping to unknown locations due to certain uncontrollable external events such as electrical noise. watchdog timer operation it operates by providing a device reset when the watchdog timer counter overfows. note that if the watchdog timer function is not enabled, then any instructions related to the watchdog timer will result in no operation. setting up the various watchdog timer options are controlled via the confguration options and two internal registers wdts and ctrl1. enabling the watchdog timer can be controlled by both a confguration option and the wdten bits in the ctrl1 internal register in the data memory. confguration optio n ctrl1 register wdt function disa?le disa?le o?? disa?le ena?le on ena?le x on watchdog timer on/off control the watchdog timer will be disabled if bits wdten3~wdten0 in the ctrl1 register are written with the binary value 1010b and wdt confguration option is disable. this will be the condition when the device is powered up. although any other data written to wdten3~wdten0 will ensure that the watchdog timer is enabled, for maximum protection it is recommended that the value 0101b is written to these bits. the wdt clock can emanate from three different sources selected by configuration option: its own self-contained dedicated internal wdt oscillator, the instruction clock which is the system clock divided by 4 or lxt. the watchdog timer can be disabled by options. note that if the wdt confguration option has been disabled, then any instruction relating to its operation will result in no operation. the internal wdt oscillator has an approximate period of 65s at a supply voltage of 5v. if selected, it is frst divided by 256 via an 8-stage counter to give a nominal period of 17ms. note that this period can vary with vdd, temperature and process variations. for longer wdt time- out periods the wdt prescaler can be utilized. by writing the required value to bits 0, 1 and 2 of the wdts register, known as ws0, ws1 and ws2, longer time-out periods can be achieved. with
rev. 1.10 ?6 ?e???a?? 1?? ?01? rev. 1.10 ?7 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu ws0, ws1 and ws2 all set high , the division ratio is 1:128 which gives a maximum time-out period of about 2.1s. under normal program operation, a watchdog timer time-out will initialise a device reset and set the status bit to. however, if the system is in the idle/sleep mode, when a watchdog timer time- out occurs, the device will be woken up, the to bit in the status register will be set and only the program counter and stack pointer will be reset. three methods can be adopted to clear the contents of the watchdog timer. the first is an external hardware reset, which means a low level on the external reset pin, the second is using the clear watchdog timer software instructions and the third is when a halt instruction is executed. there are two methods of using software instructions to clear the watchdog timer, one of which must be chosen by confguration option. the frst option is to use the single clr wdt instruction while the second is to use the two commands clr wdt1 and clr wdt2. for the frst option, a simple execution of clr wdt will clear the watchdog timer while for the second option, both clr wdt1 and clr wdt2 must both be executed to successfully clear the watchdog timer. note that for this second option, if clr wdt1 is used to clear the watchdog timer, successive executions of this instruction will have no effect, only the execution of a clr wdt2 instruction will clear the watchdog timer. similarly after the clr wdt2 instruction has been executed, only a successive clr wdt1 instruction can clear the watchdog timer.               
                                          ?   ?    ?   ?      ?       ?  ? ??     -    ? watchdog timer wdt s register bit 7 6 5 4 3 2 1 0 name ws? ws1 ws0 r/w r/w r/w r/w por 1 1 1 bit 7 ~ 3 unimplemented, read as "0" bit 2 ~ 0 ws2~ws0 : wdt time-out period selection 000: 2 8 t wdtck 001: 2 9 t wdtck 010: 2 10 t wdtck 011: 2 11 t wdtck 100: 2 12 t wdtck 101: 2 13 t wdtck 110: 2 14 t wdtck 111: 2 15 t wdtck
rev. 1.10 ?8 ?e???a?? 1?? ?01? rev. 1.10 ?9 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu ctrl1 register bit 7 6 5 4 3 2 1 0 name integ1 integ0 tbsel1 tbsel0 wdten? wdten? wdten1 wdten0 r/w r/w r/w r/w r/w r/w r/w r/w r/w por 1 0 0 0 1 0 1 0 bit 7 ~4 described elsewhere bit 3~0 wdten3, wdten2, wdten1, wdten0 : wdt function enable 1010: wdt disabled other values: wdt enabled - recommended value is 0101 if the watchdog timer enable is confguration option is selected, then the watchdog timer will always be enabled and the wdten3~wdten0 control bits will have no effect. note: the wdt is only disabled when both the wdt confguration option is disabled and when bits wdten3~wdten0=1010. the wdt is enabled when either the wdt confguration option is enabled or when bits wdten3~wdten01010. reset and initialization a reset function is a fundamental part of any microcontroller ensuring that the device can be set to some predetermined condition irrespective of outside parameters. the most important reset condition is after power is frst applied to the microcontroller. in this case, internal circuitry will ensure that the microcontroller, after a short delay, will be in a well defned state and ready to execute the frst program instruction. after this power-on reset, certain important internal registers will be set to defned states before the program commences. one of these registers is the program counter, which will be reset to zero forcing the microcontroller to begin program execution from the lowest program memory address. in addition to the power- on reset, situations may arise where it is necessary to forcefully apply a reset condition when the microcontroller is running. one example of this is where after power has been applied and the microcontroller is already running, the res line is forcefully pulled low. in such a case, known as a normal operation reset, some of the microcontroller registers remain unchanged allowing the microcontroller to proceed with normal operation after the reset line is allowed to return high. another type of reset is when the watchdog timer overflows and resets the microcontroller. all types of reset operations result in different register conditions being setup. another reset exists in the form of a low voltage reset, lvr, where a full reset, similar to the res reset is implemented in situations where the power supply voltage falls below a certain threshold. reset functions there are five ways in which a microcontroller reset can occur, through events occurring both internally and externally:
rev. 1.10 ?8 ?e???a?? 1?? ?01? rev. 1.10 ?9 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu power-on reset the most fundamental and unavoidable reset is the one that occurs after power is frst applied to the microcontroller. as well as ensuring that the program memory begins execution from the frst memory address, a power-on reset also ensures that certain other registers are preset to known conditions. all the i/o port and port control registers will power up in a high condition ensuring that all pins will be frst set to inputs.                              note: t rstd is powe?-on dela ?? t?pical time=100ms power-on reset timing chart for the application a resistor connected between vdd and the res pin and a capacitor connected between vss and the res pin will provide a suitable external reset circuit. any wiring connected to the res pin should be kept as short as possible to minimise any stray noise interference. for the application that operate s within an environment where more noise is present the enhanced reset circuit shown is recommended.                                 note: * it is recommended that this component is added esd protection. ** it is recommended that this component is added in environments where power line noise is signifcant. more information regarding external reset circuits is located in application note ha0075e on the holtek website res pin reset this type of reset occurs when the microcontroller is already running and the res pin is forcefully pulled low by external hardware such as an external switch. in this case as in the case of other reset, the program counter will reset to zero and program execution initiated from this point.                                note: t rstd is powe?-on dela ?? t?pical time=100ms res reset timing chart
rev. 1.10 40 ?e???a?? 1?? ?01? rev. 1.10 41 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu low voltage reset C lvr the microcontroller contains a low voltage reset circuit in order to monitor the supply voltage of the device. the lvr function is selected via a confguration option. if the supply voltage of the device drops to within a range of 0.9v~v lvr such as might occur when changing the battery, the lvr will automatically reset the device internally. for a valid lvr signal, a low supply voltage, i.e., a voltage in the range between 0.9v~v lvr must exist for a time greater than that specifed by t lvr in the a.c. characteristics. if the low supply voltage state does not exceed this value, the lvr will ignore the low supply voltage and will not perform a reset function. the actual v lvr value can be selected via confguration options.                 note: t rstd is powe?-on dela ?? t?pical time=100ms low voltage reset timing chart watchdog time-out reset during normal operation the watchdog time-out reset during normal operation is the same as a hardware res pin reset except that the watchdog time-out fag to will be set to 1.                     note: t rstd is powe?-on dela ?? t?pical time=100ms wdt time-out reset during normal operation timing chart watchdog time-out reset during idle/sleep mode the watchdog time-out reset during idle/sleep mode is a little different from other kinds of reset. most of the conditions remain unchanged except that the program counter and the stack pointer will be cleared to 0 and the to fag will be set to 1. refer to the a.c. characteristics for t sst details.                note: the t sst can be chosen to be 1024 clock cycles via confguration option. the sst is 10 ?4 fo? lxt. wdt time-out reset during idle/sleep timing chart audio processor reset the audio processor is reset by the software control ctrl2.4 register                                                                   note: * make the length of the wiring, which is connected to the res pin as short as possible, to avoid noise interference. reset circuit
rev. 1.10 40 ?e???a?? 1?? ?01? rev. 1.10 41 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu reset initial conditions the different types of reset described affect the reset fags in different ways. these fags, known as pdf and to are located in the status register and are controlled by various microcontroller operations, such as the idle/sleep function or watchdog timer. the reset flags are shown in the table: to pdf reset conditions 0 0 p owe?-on ?eset ? ? res o? lvr ?eset d??ing no?mal o? slow mode ope?ation 1 ? wdt time-o ?t ?eset d??ing no?mal o? slow mode ope?ation 1 1 wdt time-o ?t ?eset d??ing idle o? sleep mode ope?ation note: u stands for unchanged the following table indicates the way in which the various components of the microcontroller are affected after a power-on reset occurs. item condition after reset p?og?am co?nte? reset to ze?o inte???pts all inte???pts will ?e disa?led wdt clea? afte? ?eset? wdt ?egins co?nting time ?/event co?nte? time ? co?nte? will ?e t?? ned off p?escale? the time ? co?nte? p?escale? will ?e clea?ed inp?t/o?tp?t po?ts i/o po?ts will ?e set?p as inp?ts stack pointe? stack pointe? will point to the top of the stack the different kinds of resets all affect the internal registers of the microcontroller in different ways. to ensure reliable continuation of normal program execution after a reset occurs, it is important to know what condition the microcontroller is in after a particular reset occurs. the following table describes how each type of reset affects each of the microcontroller internal registers. register power on reset wdt time-out (normal operation) res or lvr (normal operation) res or lvr reset (idle/sleep) wdt time-out (idle/sleep) pc l 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 mp0 xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx ???? ???? mp1 xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx ???? ???? bp -- 0- -000 -- 0- -000 -- 0- -000 -- 0- -000 -- ?- -??? acc xxxx xxxx ???? ???? ???? ???? ???? ???? ???? ???? tblp xxxx xxxx ???? ???? ???? ???? ???? ???? ???? ???? tbhp xxxx xxxx ???? ???? ???? ???? ???? ???? ???? ???? tblh --xx xxxx -- ?? ???? --?? ???? -- ?? ???? -- ?? ???? wdts -- -- -111 -- -- -111 -- -- -111 -- -- -111 -- -- -??? status -- 00 xxxx -- 1? ???? -- ?? ???? -- 01 ???? -- 11 ???? intc0 -000 0000 -000 0000 -000 0000 -000 0000 -??? ???? intc1 0000 0000 0000 0000 0000 0000 0000 0000 ???? ???? tmr0 xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx ???? ???? tmr0c 0000 1000 0000 1000 0000 1000 0000 1000 ???? ????
rev. 1.10 4? ?e???a?? 1?? ?01? rev. 1.10 4? ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu register power on reset wdt time-out (normal operation) res or lvr (normal operation) res or lvr reset (idle/sleep) wdt time-out (idle/sleep) tmr1 xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx ???? ???? tmr1c 0000 1-- - 0000 1-- - 0000 1-- - 0000 1-- - ???? ?-- - tmr?l xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx ???? ???? tmr?h xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx ???? ???? tmr?c 00-0 1000 00-0 1000 00-0 1000 00-0 1000 ??-? ???? pa 1111 1111 1111 1111 1111 1111 1111 1111 ???? ???? pac 1111 1111 1111 1111 1111 1111 1111 1111 ???? ???? pawk 0000 0000 0000 0000 0000 0000 0000 0000 ???? ???? papu -000 0000 -000 0000 -000 0000 -000 0000 -??? ???? pb 1111 1111 1111 1111 1111 1111 1111 1111 ???? ???? pbc 1111 1111 1111 1111 1111 1111 1111 1111 ???? ???? pbpu 0000 0000 0000 0000 0000 0000 0000 0000 ???? ???? pc 1111 1111 1111 1111 1111 1111 1111 1111 ???? ???? pcc 1111 1111 1111 1111 1111 1111 1111 1111 ???? ???? pcpu 0000 0000 0000 0000 0000 0000 0000 0000 ???? ???? pd 1111 1111 1111 1111 1111 1111 1111 1111 ???? ???? pdc 1111 1111 1111 1111 1111 1111 1111 1111 ???? ???? pdpu 0000 0000 0000 0000 0000 0000 0000 0000 ???? ???? pe -- -- -- 11 -- -- -- 11 -- -- -- 11 -- -- -- 11 -- -- -- ?? pec -- -- -- 11 -- -- -- 11 -- -- -- 11 -- -- -- 11 -- -- -- ?? pepu -- -- -- 00 -- -- -- 00 -- -- -- 00 -- -- -- 00 -- -- -- ?? ctrl0 0000 0001 0000 0001 0000 0001 0000 0001 ???? ???? ctrl1 1000 1010 1000 1010 1000 1010 1000 1010 ???? ???? ctrl? 0010 0110 0010 0110 0010 0110 0010 0110 ???? ???? adrl xxxx -- -- xxxx -- -- xxxx -- -- xxxx -- -- ???? -- -- adrh xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx ???? ???? adcr 01-- 0000 01-- 0000 01-- 0000 01-- 0000 ??-- ???? acsr 11-- -000 11-- -000 11-- -000 11-- -000 ??-- -??? ancsr 0000 0000 0000 0000 0000 0000 0000 0000 ???? ???? dacr -- -- 0000 -- -- 0000 -- -- 0000 -- -- 0000 -- -- ???? da0r xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx ???? ???? da1r xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx ???? ???? da?r xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx ???? ???? da?r xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx ???? ???? bdr -- -- -- 00 -- -- -- 00 -- -- -- 00 -- -- -- 00 -- -- -- ?? spicr 1-01 00xx 1-01 00xx 1-01 00xx 1-01 00xx ?-?? ???? lvdc -- 00 -- -- -- 00 -- -- -- 00 -- -- -- 00 -- -- -- ?? -- -- note: * stands for warm reset, - not implement , u stands for unchanged, x stands for unknown
rev. 1.10 4? ?e???a?? 1?? ?01? rev. 1.10 4? ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu input/output ports holtek microcontrollers offer considerable fexibility on their i/o ports. most pins can have either an input or output designation under user program control. additionally, as there are pull-high resistors and wake-up software confgurations, the user is provided with an i/o structure to meet the needs of a wide range of application possibilities. for input operation, these ports are non-latching, which means the inputs must be ready at the t2 rising edge of instruction mov a,[m], where m denotes the port address. for output operation, all the data is latched and remains unchanged until the output latch is rewritten. pull-high resistors many product applications require pull-high resistors for their switch inputs usually requiring the use of an external resistor. to eliminate the need for these external resistors, when confgured as an input have the capability of being connected to an internal pull-high resistor. these pull-high resistors are selectable via a register known as papu, pbpu, pcpu, pdpu and pepu located in the data memory. the pull-high resistors are implemented using weak pmos transistors. note that pin pa7 does not have a pull-high resistor selection. port a wake-up if the halt instruction is executed, the device will enter the idle/sleep mode, where the system clock will stop resulting in power being conserved, a feature that is important for battery and other low-power applications. various methods exist to wake-up the microcontroller, one of which is to change the logic condition on one of the pa0~pa7 pins from high to low. after a halt instruction forces the microcontroller into entering the idle/sleep mode, the processor will remain idle or in a low-power state until the logic condition of the selected wake-up pin on port a changes from high to low. this function is especially suitable for applications that can be woken up via external switches. note that pins pa0 to pa7 can be selected individually to have this wake-up feature using an internal register known as pawk, located in the data memory. pawk, pac, papu, pbc, pbpu, pcc, pcpu, pdc, pdpu, pec, pepu register register name por bit 7 6 5 4 3 2 1 0 pawk 00h pawk7 pawk6 pawk5 pawk4 pawk ? pawk ? pawk1 pawk0 pac ??h pac7 pac6 pac5 pac4 pac ? pac ? pac1 pac0 papu 00h papu6 papu5 papu4 papu ? papu ? papu1 papu0 pbc ??h pbc7 pbc6 pbc5 pbc4 pbc? pbc? pbc1 pbc0 pbpu 00h pbpu7 pbpu6 pbpu5 pbpu4 pbpu? pbpu? pbpu1 pbpu0 pcc ??h pcc7 pcc6 pcc5 pcc4 pcc? pcc? pcc1 pcc0 pcpu 00h pcpu7 pcpu6 pcpu5 pcpu4 pcpu? pcpu? pcpu1 pcpu0 pdc ??h pdc7 pdc6 pdc5 pdc4 pdc? pdc? pdc1 pdc0 pdpu 00h pdpu7 pdpu6 pdpu5 pdpu4 pdpu? pdpu? pdpu1 pdpu0 pec 0?h pec1 pec0 pepu 00h pepu1 pepu0 unimplemented? ?ead as 0
rev. 1.10 44 ?e???a?? 1?? ?01? rev. 1.10 45 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu pawkn : pa wake-up function enable 0: disable 1: enable pacn/pbcn/pccn /pdcn/pecn : i/o type selection 0: output 1: input papun/pbpun/pcpun /pdpun/pepun : pull-high function enable 0: disable 1: enable i/o port control registers each port has its own control register, known as pac, pbc, pcc, pdc and pec which controls the input/output confguration. with this control register, each i/o pin with or without pull-high resistors can be reconfgured dynamically under software control. for the i/o pin to function as an input, the corresponding bit of the control register must be written as a 1. this will then allow the logic state of the input pin to be directly read by instructions. when the corresponding bit of the control register is written as a 0, the i/o pin will be setup as a cmos output. if the pin is currently setup as an output, instructions can still be used to read the output register. however, it should be noted that the program will in fact only read the status of the output data latch and not the actual logic status of the output pin. pin-shared functions the fexibility of the microcontroller range is greatly enhanced by the use of pins that have more than one function. limited numbers of pins can force serious design constraints on designers but by supplying pins with multi-functions, many of these diffculties can be overcome. for some pins, the chosen function of the multi-function i/o pins is set by confguration options while for others the function is set by application program control. external interrupt input the external interrupt pin, int, is pin-shared with an i/o pin. to use the pin as an external interrupt input the correct bits in the intc0 register must be programmed. the pin must also be setup as an input by setting the pac3 bit in the port control register. a pull-high resistor can also be selected via the appropriate port pull-high resistor register. note that even if the pin is setup as an external interrupt input the i/o function still remains. external timer/event counter input the timer/event counter pins, tmr 0, tmr 1 and tmr 2 are pin-shared with i/o pins. for these shared pins to be used as timer/event counter inputs, the timer/event counter must be confgured to be in the event counter or pulse width capture mode. this is achieved by setting the appropriate bits in the timer/event counter control register. the pins must also be setup as inputs by setting the appropriate bit in the port control register. pull-high resistor options can also be selected using the port pull-high resistor registers. note that even if the pin is setup as an external timer input the i/o function still remains.
rev. 1.10 44 ?e???a?? 1?? ?01? rev. 1.10 45 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu pfd output the pfd function output is pin-shared with an i/o pin. the output function of this pin is chosen using the ctrl0 register. note that the corresponding bit of the port control register, must setup the pin as an output to enable the pfd output. if the port control register has setup the pin as an input, then the pin will function as a normal logic input with the usual pull-high selection, even if the pfd function has been selected. a/d inputs the device has 8 inputs to the a/d converter. all of these analog inputs are pin-shared with i/o pins. if these pins are to be used as a/d inputs and not as i/o pins then the corresponding pcrn bits in the ancsr0 registers, must be properly setup. there are no confguration options associated with the a/d converter. if chosen as i/o pins, then full pull-high resistor confguration options remain, however if used as a/d inputs then any pull-high resistor confguration options associated with these pins will be automatically disconnected. audio processor pins pins pb 4 ~pb 7 on port b can be used as audio processor i/o pins . this function is controlled using the spicr register . pin remapping confguration the pin remapping function enables the function pins int , tmr0 and pfd to be located on different port pins. it is important not to confuse the pin remapping function with the pin-shared function, these two functions have no interdependence. the pcfg bit in the ctrl0 register allows the three function pins int , tmr0 and pfd to be remapped to different port pins. after power up, this bit will be reset to zero, which will defne the default port pins to which these three functions will be mapped. changing this bit will move the functions to other port pins. examination of the pin names on the package diagrams will reveal that some pin function names are repeated, this indicates a function pin that can be remapped to other port pins. if the pin name is bracketed then this indicates its alternative location. pin names without brackets indicates its default location which is the condition after power-on. pcfg bit status pcfg bit 0 1 pin mapping int/pa ? tmr0/pa ? p? d/pa1 int/p b4 tmr0/p b5 p?d/p b6
rev. 1.10 46 ?e???a?? 1?? ?01? rev. 1.10 47 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu i/o pin structures the diagrams illustrate the i/o pin internal structures. as the exact logical construction of the i/o pin may differ from these drawings, they are supplied as a guide only to assist with the functional understanding of the i/o pins.                     
                                           
                       ???     ??     ?   ?  ?                   
          
             
                                 ?  ? ?  ?  ?   ?   
 programming considerations within the user program, one of the frst things to consider is port initiali z ation. after a reset, the i/o data register and i/o port control register will be set high. this means that all i/o pins will default to an input state, the level of which depends on the other connected circuitry and whether pull-high options have been selected. if the port control registers, are then programmed to setup some pins as outputs, these output pins will have an initial high output value unless the associated port data register is frst programmed. selecting which pins are inputs and which are outputs can be achieved byte-wide by loading the correct value into the port control register or by programming individual bits in the port control register using the set [m].i and clr [m].i instructions. note that when using these bit control instructions, a read-modify-write operation takes place. the microcontroller must frst read in the data on the entire port, modify it to the required new bit values and then rewrite this data back to the output ports.
rev. 1.10 46 ?e???a?? 1?? ?01? rev. 1.10 47 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu                         
       read modify write timing pins pa0 to pa7 each have a wake-up function, selected via the pawk register. when the device is in the idle/sleep mode, various methods are available to wake the device up. one of these is a high to low transition of any of the these pins. single or multiple pins on port a can be setup to have this function. timer/event counter s the provision of timers form an important part of any microcontroller, giving the designer a means of carrying out time related functions. the device contains two 8-bit and one 16-bit timer. as the timers have three different operating modes, they can be confgured to operate as a general timer, an external event counter or as a pulse width capture device. the provision of an internal prescaler to the clock circuitry on gives added range to the timers. there are two types of registers related to the timer/event counters. the frst is the register that contains the actual value of the timer and into which an initial value can be preloaded. reading from this register retrieves the contents of the timer/event counter. the second type of associated register is the timer control register which defnes the timer options and determines how the timer is to be used. the device can have the timer clock confgured to come from the internal clock source. in addition, the timer clock source can also be confgured to come from an external timer pin. confguring the timer/event counter input clock source the timer/event counter clock source can originate from various sources, an internal clock or an external pin. the internal clock source is used when the timer is in the timer mode or in the pulse width capture mode. for some timer/event counters, this internal clock source is frst divided by a prescaler, the division ratio of which is conditioned by the timer control register bits. an external clock source is used when the timer is in the event counting mode, the clock source being provided on an external timer pin tmrn. depending upon the condition of the tneg bit, each high to low, or low to high transition on the external timer pin will increment the counter by one. timer registers C tmr0, tmr1, tmr2l, tmr2h the timer registers are special function registers located in the special purpose data memory and is the place where the actual timer value is stored. these registers are known as tmr0, tmr1, tmr2l and tmr2h. the value in the timer registers increases by one each time an internal clock pulse is received or an external transition occurs on the external timer pin. the timer will count from the initial value loaded by the preload register to the full count of ffh for the 8-bit timer/event counter or ffffh for the 16-bit timer/event counters, at which point the timer overflows and an internal interrupt signal is generated. the timer value will then be reset with the initial preload register value and continue counting. note that to achieve a maximum full range count of ffh or ffffh, the preload register must frst be cleared to all zeros. it should be noted that after power-on, the preload registers will be in an unknown condition. note that if the timer/event counter is in an off condition and data is written to its preload register, this data will be immediately written into the actual counter. however, if the counter is enabled and counting, any new data written into the
rev. 1.10 48 ?e???a?? 1?? ?01? rev. 1.10 49 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu preload data register during this period will remain in the preload register and will only be written into the actual counter the next time an overfow occurs.                      
            ?         ?   ?      ?    ?   ? ? -  ? ?             ? -  ?  ?    ?   ? ? ? ?     clock structure for timer/time base             
                 
      
 
    ? ??  ? ? ?  ? -  
    ? ?    ? 8-bit timer/event counter 0 structure                
                ?  ?  ?    ??      ?   -  ?      ? ?  ? 8-bit timer/event counter 1 structure             
           
          
      
 
   ?? ?  ? ?  ? -  ?  ? 8-bit timer/event counter 2 structure               
rev. 1.10 48 ?e???a?? 1?? ?01? rev. 1.10 49 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu timer control registers C tmr0c, tmr1c, tmr2c the fexible features of the holtek microcontroller timer/event counters enable them to operate in three different modes, the options of which are determined by the contents of their respective control register. the timer control register is known as tmrnc. it is the timer control register together with its corresponding timer register that control the full operation of the timer/event counter. before the timer can be used, it is essential that the timer control register is fully programmed with the right data to ensure its correct operation, a process that is normally carried out during program initialisation. to choose which of the three modes the timer is to operate in, either in the timer mode, the event counting mode or the pulse width capture mode, bits 7 and 6 of the timer control register, which are known as the bit pair tnm1/tnm0, must be set to the required logic levels. the timer-on bit, which is bit 4 of the timer control register and known as tnon, provides the basic on/off control of the respective timer. setting the bit high allows the counter to run, clearing the bit stops the counter. bits 0~2 of the timer control register determine the division ratio of the input clock prescaler. the prescaler bit settings have no effect if an external clock source is used. if the timer is in the event count or pulse width capture mode, the active transition edge level type is selected by the logic level of bit 3 of the timer control register which is known as tneg. the tns bit selects the internal clock source. tmr0c register bit 7 6 5 4 3 2 1 0 name t 0 m1 t 0 m0 t 0 s t 0 on t 0 eg t0psc? t0psc1 t0psc0 r/w r/w r/w r/w r/w r/w r/w r/w r/w por 0 0 0 0 1 0 0 0 bit 7, 6 t0m1, t0m0 : timer0 operation mode selection 00: no mode available 01: event counter mode 10: timer mode 11: pulse width capture mode bit 5 t0s : timer clock source 0: f sys 1: lxt oscillator bit 4 t0on : timer/event counter counting enable 0: disable 1: enable bit 3 t 0 eg : event counter active edge selection 0: count on rising edge 1: count on falling edge pulse width capture active edge selection 0: start counting on falling edge, stop on rising edge 1: start counting on rising edge, stop on falling edge bit 2~0 t0psc2, t0psc1, t0psc0 : timer prescaler rate selection timer internal clock= 000: f tp 001: f tp /2 010: f tp /4 011: f tp /8 100: f tp /16 101: f tp /32 110: f tp /64 111: f tp /128
rev. 1.10 50 ?e???a?? 1?? ?01? rev. 1.10 51 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu tmr1c register bit 7 6 5 4 3 2 1 0 name t1m1 t1m0 t1s t1on t1eg r/w r/w r/w r/w r/w r/w por 0 0 0 0 1 bit 7, 6 t1m1, t1m0 : timer0 operation mode selection 00: no mode available 01: event counter mode 10: timer mode 11: pulse width capture mode bit 5 t1s : timer clock source 0: f sys /4 1: lxt oscillator bit 4 t1on : timer/event counter counting enable 0: disable 1: enable bit 3 t 1 eg : event counter active edge selection 0: count on rising edge 1: count on falling edge pulse width capture active edge selection 0: start counting on falling edge, stop on rising edge 1: start counting on rising edge, stop on falling edge bit 2~0 unimplemented, read as 0 tmr2c register bit 7 6 5 4 3 2 1 0 name t?m1 t?m0 t?s t?on t?eg t?psc? t?psc1 t?psc0 r/w r/w r/w r/w r/w r/w r/w r/w r/w por 0 0 0 0 1 0 0 0 bit 7, 6 t2m1, t2m0 : timer0 operation mode selection 00: no mode available 01: event counter mode 10: timer mode 11: pulse width capture mode bit 5 t2s : timer clock source 0: f sys /4 1: lxt oscillator bit 4 t2on : timer/event counter counting enable 0: disable 1: enable bit 3 t 2 eg : event counter active edge selection 0: count on rising edge 1: count on falling edge pulse width capture active edge selection 0: start counting on falling edge, stop on rising edge 1: start counting on rising edge, stop on falling edge
rev. 1.10 50 ?e???a?? 1?? ?01? rev. 1.10 51 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu bit 2~0 t2psc2, t2psc1, t2psc0 : timer prescaler rate selection timer internal clock= 000: f tp 001: f tp /2 010: f tp /4 011: f tp /8 100: f tp /16 101: f tp /32 110: f tp /64 111: f tp /128 timer mode in this mode, the timer/event counter can be utilised to measure fxed time intervals, providing an internal interrupt signal each time the timer/event counter overfows. to operate in this mode, the operating mode select bit pair, tnm1/tnm0, in the timer control register must be set to the correct value as shown. control register operating mode select bits for the timer mode bit7 bit6 1 0 in this mode the internal clock is used as the timer clock. the timer input clock source is either f sys , f sys /4 or the lxt oscillator. however, this timer clock source is further divided by a prescaler, the value of which is determined by the bits tnpsc2~tnpsc0 in the timer control register. the timer- on bit, tnon must be set high to enable the timer to run. each time an internal clock high to low transition occurs, the timer increments by one; when the timer is full and overfows, an interrupt signal is generated and the timer will reload the value already loaded into the preload register and continue counting. a timer overflow condition and corresponding internal interrupt is one of the wake-up sources, however, the internal interrupts can be disabled by ensuring that the etni bits of the intcn registe are reset to zero.                             
           timer mode timing chart event counter mode in this mode, a number of externally changing logic events, occurring on the external timer tmrn pin, can be recorded by the timer/event counter. to operate in this mode, the operating mode select bit pair, tnm1/tnm0, in the timer control register must be set to the correct value as shown. control register operating mode select bits for the event counter mode bit7 bit6 0 1 in this mode, the external timer tmrn pin, is used as the timer/event counter clock source, however it is not divided by the internal prescaler. after the other bits in the timer control register have been setup, the enable bit tnon, which is bit 4 of the timer control register, can be set high
rev. 1.10 5? ?e???a?? 1?? ?01? rev. 1.10 5? ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu to enable the timer/event counter to run. if the active edge select bit, tneg, which is bit 3 of the timer control register, is low, the timer/event counter will increment each time the external timer pin receives a low to high transition. if the tneg is high, the counter will increment each time the external timer pin receives a high to low transition. when it is full and overfows, an interrupt signal is generated and the timer/event counter will reload the value already loaded into the preload register and continue counting. the interrupt can be disabled by ensuring that the timer/event counter interrupt enable bit in the corresponding interrupt control register, is reset to zero. as the external timer pin is shared with an i/o pin, to ensure that the pin is confgured to operate as an event counter input pin, two things have to happen. the frst is to ensure that the operating mode select bits in the timer control register place the timer/event counter in the event counting mode, the second is to ensure that the port control register confgures the pin as an input. it should be noted that in the event counting mode, even if the is in the idle/sleep mode, the timer/event counter will continue to record externally changing logic events on the timer input tmrn pin. as a result when the timer overfows it will generate a timer interrupt and corresponding wake-up source.                             
event counter mode timer chart (tneg=1) pulse width capture mode in this mode, the timer/event counter can be utilised to measure the width of external pulses applied to the external timer pin. to operate in this mode, the operating mode select bit pair, tnm1/ tnm0, in the timer control register must be set to the correct value as shown. control register operating mode select bits for the pulse width capture mode bit7 bit6 1 1 in this mode the internal clock, f sys , f sys /4 or the lxt, is used as the internal clock for the 8-bit timer/event counter and the 16-bit timer/event counter. however, the clock source, f sys and f sys /4, for the 8-bit timer and the 16-bit timer are further divided by a prescaler, the value of which is determined by the prescaler rate select bits tnpsc2~tnpsc0, which are bits 2~0 in the timer control register. after the other bits in the timer control register have been setup, the enable bit tnon, which is bit 4 of the timer control register, can be set high to enable the timer/event counter, however it will not actually start counting until an active edge is received on the external timer pin. if the active edge select bit tneg, which is bit 3 of the timer control register, is low, once a high to low transition has been received on the external timer pin, the timer/event counter will start counting until the external timer pin returns to its original high level. at this point the enable bit will be automatically reset to zero and the timer/event counter will stop counting. if the active edge select bit is high, the timer/event counter will begin counting once a low to high transition has been received on the external timer pin and stop counting when the external timer pin returns to its original low level. as before, the enable bit will be automatically reset to zero and the timer/ event counter will stop counting. it is important to note that in the pulse width capture mode, the enable bit is automatically reset to zero when the external control signal on the external timer pin returns to its original level, whereas in the other two modes the enable bit can only be reset to zero under program control. the residual value in the timer/event counter, which can now be read by
rev. 1.10 5? ?e???a?? 1?? ?01? rev. 1.10 5? ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu the program, therefore represents the length of the pulse received on the tmrn pin. as the enable bit has now been reset, any further transitions on the external timer pin will be ignored. the timer cannot begin further pulse width capture until the enable bit is set high again by the program. in this way, single shot pulse measurements can be easily made. it should be noted that in this mode the timer/event counter is controlled by logical transitions on the external timer pin and not by the logic level. when the timer/event counter is full and overfows, an interrupt signal is generated and the timer/event counter will reload the value already loaded into the preload register and continue counting. the interrupt can be disabled by ensuring that the timer/event counter interrupt enable bit in the corresponding interrupt control register, is reset to zero. as the tmrn pin is shared with an i/o pin, to ensure that the pin is confgured to operate as a pulse width capture pin, two things have to happen. the frst is to ensure that the operating mode select bits in the timer control register place the timer/event counter in the pulse width capture mode, the second is to ensure that the port control register confgures the pin as an input. prescaler bits t0psc0~t0psc2 of the tmr0c register and bits t2psc0~t2psc2 of the tmr2c register can be used to define a division ratio for the internal clock source of the timer/event counter enabling longer time out periods to be setup. pfd function the programmable frequency divider provides a means of producing a variable frequency output suitable for applications, such as piezo-buzzer driving or other interfaces requiring a precise frequency generator. the timer/event counter overflow signal is the clock source for the pfd function, which is controlled by pfdcs bit in ctrl0. for applicable device the clock source can come from either timer/event counter 0 or timer/event counter 1. the output frequency is controlled by loading the required values into the timer prescaler and timer registers to give the required division ratio. the counter will begin to count-up from this preload register value until full, at which point an overfow signal is generated, causing both the pfd outputs to change state. the counter will then be automatically reloaded with the preload register value and continue counting-up. if the ctrl0 register has selected the pfd function, then for pfd output to operate, it is essential for the port a control register pac, to setup the pfd pins as outputs. pa1 must be set high to activate the pfd. the output data bits can be used as the on/off control bit for the pfd outputs. note that the pfd outputs will all be low if the output data bit is cleared to zero. using this method of frequency generation, and if a crystal oscillator is used for the system clock, very precise values of frequency can be generated.                
               

          ?
        

      ?   ?  ? ?   ?  ? ?  ??  - pulse width capture mode timing chart (tne g =0)
rev. 1.10 54 ?e???a?? 1?? ?01? rev. 1.10 55 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu               
  


  pfd function i/o interfacing the timer/event counter, when configured to run in the event counter or pulse width capture mode, requires the use of an external timer pin for its operation. as this pin is a shared pin it must be confgured correctly to ensure that it is setup for use as a timer/event counter input pin. this is achieved by ensuring that the mode select bits in the timer/event counter control register, select either the event counter or pulse width capture mode. additionally the corresponding port control register bit must be set high to ensure that the pin is setup as an input. any pull-high resistor connected to this pin will remain valid even if the pin is used as a timer/event counter input. programming considerations when configured to run in the timer mode, the internal system clock is used as the timer clock source and is therefore synchronised with the overall operation of the microcontroller. in this mode when the appropriate timer register is full, the microcontroller will generate an internal interrupt signal directing the program flow to the respective internal interrupt vector. for the pulse width capture mode, the internal system clock is also used as the timer clock source but the timer will only run when the correct logic condition appears on the external timer input pin. as this is an external event and not synchronised with the internal timer clock, the microcontroller will only see this external event when the next timer clock pulse arrives. as a result, there may be small differences in measured values requiring programmers to take this into account during programming. the same applies if the timer is confgured to be in the event counting mode, which again is an external event and not synchronised with the internal system or timer clock. when the timer/event counter is read, or if data is written to the preload register, the clock is inhibited to avoid errors, however as this may result in a counting error, this should be taken into account by the programmer. care must be taken to ensure that the timers are properly initialised before using them for the first time. the associated timer enable bits in the interrupt control register must be properly set otherwise the internal interrupt associated with the timer will remain inactive. the edge select, timer mode and clock source control bits in timer control register must also be correctly set to ensure the timer is properly configured for the required application. it is also important to ensure that an initial value is frst loaded into the timer registers before the timer is switched on; this is because after power-on the initial values of the timer registers are unknown. after the timer has been initialised the timer can be turned on and off by controlling the enable bit in the timer control register. when the timer/event counter overfows, its corresponding interrupt request fag in the interrupt control register will be set. if the timer/event counter interrupt is enabled this will in turn generate an interrupt signal. however irrespective of whether the interrupts are enabled or not, a timer/event counter overfow will also generate a wake-up signal if the device is in a power-down condition.
rev. 1.10 54 ?e???a?? 1?? ?01? rev. 1.10 55 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu this situation may occur if the timer/event counter is in the event counting mode and if the external signal continues to change state. in such a case, the timer/event counter will continue to count these external events and if an overfow occurs the device will be woken up from its power- down condition. to prevent such a wake-up from occurring, the timer interrupt request fag should frst be set high before issuing the halt instruction to enter the idle/sleep mode. timer program example the program shows how the timer/event counter registers are setup along with how the interrupts are enabled and managed. note how the timer/event counter is turned on, by setting bit 4 of the timer control register. the timer/event counter can be turned off in a similar way by clearing the same bit. this example program sets the timer/event counters to be in the timer mode, which uses the internal system clock as their clock source. pfd programming example o rg 04h ;external interrupt vector org 0 c h ;timer counter 0 interrupt vector jmp tmr0int ;jump here when timer 0 overfows : : o rg 20h ;main program : : ;internal timer 0 interrupt routine tmr0int: : ;timer 0 main program placed here : : begin: ;setup timer 0 registers m ov a,09bh ;setup timer 0 preload value mov tmr0,a mov a,081h ;setup timer 0 control register mov tmr0c,a ;timer mode and prescaler set to /2 ;setup interrupt register m ov a,00dh ;enable master interrupt and both timer interrupts mov intc0,a : : s et tmr0c.4 ;start timer 0 : : time base the device includes a time base function which is used to generate a regular time interval signal. the time base time interval magnitude is determined using an internal 13 stage counter sets the division ratio of the clock source. this division ratio is controlled by both the tbsel0 and tbsel1 bits in the ctrl1 register. the clock source is selected using the t0s bit in the tmr0c register. when the time base time out, a time base interrupt signal will be generated. it should be noted that as the time base clock source is the same as the timer/event counter clock source, care should be taken when programming.
rev. 1.10 56 ?e???a?? 1?? ?01? rev. 1.10 57 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu analog to digital converter the need to interface to real world analog signals is a common requirement for many electronic systems. however, to properly process these signals by a microcontroller, they must first be converted into digital signals by a/d converters. by integrating the a/d conversion electronic circuitry into the microcontroller, the need for external components is reduced signifcantly with the corresponding follow-on benefts of lower costs and reduced component space requirements. a/d overview the device contains an 8-channel analog to digital converter which can directly interface to external analog signals, such as that from sensors or other control signals and convert these signals directly into either a 12-bit digital value. input channels conversion bits input pins 8 1? pa0~pa ? pc0~pc? the accompanying block diagram shows the overall internal structure of the a/d converter, together with its associated registers. a/d converter data registers C adrl, adrh the device, which has an internal 12-bit a/d converter, requires two data registers, a high byte register, known as adrh, and a low byte register, known as adrl. after the conversion process takes place, these registers can be directly read by the microcontroller to obtain the digitised conversion value. only the high byte register, adrh, utilises its full 8-bit contents. the low byte register utilises only 4 bit of its 8-bit contents as it contains only the lowest bits of the 12-bit converted value. in the following table, d0~d11 is the a/d conversion data result bits. register bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 adrl d? d? d1 d0 adrh d11 d10 d9 d8 d7 d6 d5 d4 a/d data registers a/d converter control registers C adcr, acsr, ancsr to control the function and operation of the a/d converter, four control registers known as adcr, acsr and ancsr are provided. these 8-bit registers define functions such as the selection of which analog channel is connected to the internal a/d converter, which pins are used as analog inputs and which are used as normal i/os, the a/d clock source as well as controlling the start function and monitoring the a/d converter end of conversion status. the acs3~acs0 bits in the adcr register defne the channel number. as the device contains only one actual analog to digital converter circuit, each of the individual 8 analog inputs must be routed to the converter. it is the function of the acs3~acs0 bits in the adcr register to determine which analog channel is actually connected to the internal a/d converter. the control register, ancsr, determines which pins on pa0~pa3, pc0~pc3 are used as analog inputs for the a/d converter and which pins are to be used as normal i/o pins. if the 8-bit address on pcr7~pcr0 has a value of ffh, then all 8 pins, namely an0~an7 will all be set as analog inputs. to reduce the power consumption in normal run, the adc module can be turned off by setting adonb=1 in acsr. once the adc module is turned off, the adc module and analog
rev. 1.10 56 ?e???a?? 1?? ?01? rev. 1.10 57 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu channel have no power consumption no matter what voltage level is on analog input. if the i/o lines is selected as an i/o function and the analog input pin voltage is not equal to v dd or v ss , there user may have to take care i dd /i stb current consumed by the pin-shared logic input function no matter the adc module is on or off. if the adc module is turned off, then all the adc pin-shared i/o pins will be setup as normal i/os.                 
                  ? ?  ?   ??  ? ?   ?   ?   ? ? ?  ? ?    ?   -      ? ? ?       ? a/d converter structure adrh, adrl register bit adrh adrl 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 adrl d 11 d 10 d 9 d 8 d 7 d 6 d 5 d 4 d ? d ? d 1 d0 adrh r r r r r r r r r r r r por x x x x x x x x x x x x "x" ?nknown ?nimplemented? ?ead as 0 d11~d0 adc conversion data adcr register bit 7 6 5 4 3 2 1 0 name start eocb acs? acs? acs1 acs0 r/w r/w r r/w r/w r/w r/w por 0 1 0 0 0 0 bit 7 start : start the a/d conversion 010: start 01: reset the a/d converter and set eocb to "1" this bit is used to initiate an a/d conversion process. the bit is normally low but if set high and then cleared low again, the a/d converter will initiate a conversion process. when the bit is set high the a/d converter will be reset. bit 6 eocb : end of a/d conversion fag 0: a/d conversion ended 1: a/d conversion in progress this read only fag is used to indicate when an a/d conversion process has completed. when the conversion process is running the bit will be high. bit 5~4 unimplemented, read as "0"
rev. 1.10 58 ?e???a?? 1?? ?01? rev. 1.10 59 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu bit 3~0 acs3, acs2, acs1, acs0 : select a/d channel 0000: an0 0001: an1 0010: an2 0011: an3 0100: an4 0101: an5 0110: an6 0111: an7 1000~1111: undefned, can't be used. acsr register bit 7 6 5 4 3 2 1 0 name test adonb adcs? adcs1 adcs0 r/w r r/w r/w r/w r/w por 1 1 0 0 0 bit 7 test : for test mode use only bit 6 adonb : adc module power on/off control bit 0: adc module power on 1: adc module power off this bit controls the power to the a/d internal function. this bit should be cleared to zero to enable the a/d converter. if the bit is set high then the a/d converter will be switched off reducing the device power consumption. as the a/d converter will consume a limited amount of power, even when not executing a conversion, this may be an important consideration in power sensitive battery powered applications. note: it is recommended to set adonb=1 before entering the idle/sleep mode for saving power. bit 5~3 unimplemented, read as "0" bit 2~0 adcs2~adcs0 : select a/d converter clock source 000: system clock/2 001: system clock/8 010: system clock/32 011: undefned, can't be used. 100: system clock 101: system clock/4 110: system clock/16 111: undefned, can't be used. these three bits are used to select the clock source for the a/d converter. ancsr register bit 7 6 5 4 3 2 1 0 name pcr7 pcr 6 pcr 5 pcr 4 pcr ? pcr ? pcr 1 pcr 0 r/w r/w r/w r/w r/w r/w r/w r/w r/w por 0 0 0 0 0 0 0 0 bit 7 pcr7 : defne pc3 is a/d input or not 0: not a/d input 1: a/d input, an7 bit 6 pcr6 : defne pc2 is a/d input or not 0: not a/d input 1: a/d input, an6 bit 5 pcr5 : defne pc1 is a/d input or not 0: not a/d input 1: a/d input, an5
rev. 1.10 58 ?e???a?? 1?? ?01? rev. 1.10 59 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu bit 4 pcr4 : defne pc0 is a/d input or not 0: not a/d input 1: a/d input, an4 bit 3 pcr3 : defne pa3 is a/d input or not 0: not a/d input 1: a/d input, an3 bit 2 pcr2 : defne pa2 is a/d input or not 0: not a/d input 1: a/d input, an2 bit 1 pcr1 : defne pa1 is a/d input or not 0: not a/d input 1: a/d input, an1 bit 0 pcr0 : defne pa0 is a/d input or not 0: not a/d input 1: a/d input, an0 the start bit in the register is used to start and reset the a/d converter. when the sets this bit from low to high and then low again, an analog to digital conversion cycle will be initiated. when the start bit is brought from low to high but not low again, the eocb bit in the adcr register will be set to a "1" and the analog to digital converter will be reset. it is the start bit that is used to control the overall start operation of the internal analog to digital converter. the eocb bit in the adcr register is used to indicate when the analog to digital conversion process is complete. this bit will be automatically set to "0" by the microcontroller after a conversion cycle has ended. in addition, the corresponding a/d interrupt request flag will be set in the interrupt control register, and if the interrupts are enabled, an appropriate internal interrupt signal will be generated. this a/d internal interrupt signal will direct the program flow to the associated a/d internal interrupt address for processing. if the a/d internal interrupt is disabled, the microcontroller can be used to poll the eocb bit in the adcr register to check whether it has been cleared as an alternative method of detecting the end of an a/d conversion cycle. the clock source for the a/d converter, which originates from the system clock f sys , is frst divided by a division ratio, the value of which is determined by the adcs2, adcs1 and adcs0 bits in the acsr register. controlling the power on/off function of the a/d converter circuitry is implemented using the value of the adonb bit. although the a/d clock source is determined by the system clock f sys , and by bits adcs2, adcs1 and adcs0, there are some limitations on the maximum a/d clock source speed that can be selected. as the minimum value of permissible a/d clock period, t ad , is 0.5 s , care must be taken for system clock speeds in excess of 4mhz. for system clock speeds in excess of 4mhz, the adcs2, adcs1 and adcs0 bits should not be set to 000. doing so will give a/d clock periods that are less than the minimum a/d clock period which may result in inaccurate a/d conversion values. refer to the following table for examples, where values marked with an asterisk * show where, depending upon the device, special care must be taken, as the values may be less than the specifed minimum a/d clock period.
rev. 1.10 60 ?e???a?? 1?? ?01? rev. 1.10 61 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu f sys a/d clock period (t ad ) adc s 2, adc s 1, adc s 0 = 000 ((f sys /2) adc s 2, adc s 1, adc s 0 = 00 1 (f sys /8) adc s 2, adc s 1, adc s 0 = 0 1 0 ( f sys /32) adc s 2, adc s 1, adc s 0 = 100 ( f sys ) adc s 2, adc s 1, adc s 0 = 1 00 (f sys /4 ) adc s 2, adc s 1, adc s 0 = 1 0 1 (f sys / 16 ) adc s 2, adc s 1, adc s 0 = 011, 111 1mhz ? s 8 s ?? s 1 s 4 s 16 s undefned ? mhz 1 s 4 s 16 s 500ns ? s 8 s undefned 4 mhz 500ns ? s 8 s ?50ns* 1 s 4 s undefned 8 mhz ?50ns* 1 s 4 s 1?5ns* 500ns ? s undefned 1 ? mhz 167ns* 667ns ?.67 s 8?ns* ???ns* 1 s undefned a/d clock period examples a/d input pins all of the a/d analog input pins are pin-shared with the i/o pins on port a and port c. bits pcr7~pcr0 in the ancsr register, determine whether the input pins are setup as normal input/ output pins or whether they are setup as analog inputs. in this way, pins can be changed under program control to change their function from normal i/o operation to analog inputs and vice versa. pull-high resistors, which are setup through register programming, apply to the input pins only when they are used as normal i/o pins, if setup as a/d inputs the pull-high resistors will be automatically disconnected. note that it is not necessary to frst setup the a/d pin as an input in the pac and pcc port control registers to enable the a/d input as when the pcr7~pcr0 bits enable an a/d input, the status of the port control register will be overridden. summary of a/d conversion steps the following summari z es the individual steps that should be executed in order to implement an a/d conversion process. step 1 select the required a/d conversion clock by correctly programming bits adcs2, adcs1 and adcs0 in the register. step 2 select which pins are to be used as a/d inputs and confgure them as a/d input pins by correctly programming the pcr7~pcr0 bits in the ancsr register. step 3 enable the a/d by clearing the adonb in the acsr register to zero. step 4 select which channel is to be connected to the internal a/d converter by correctly programming the acs3~acs0 bits which are also contained in the register. step 5 if the interrupts are to be used, the interrupt control registers must be correctly configured to ensure the a/d converter interrupt function is active. the master interrupt control bit, emi, the intc0 interrupt control register must be set to 1, the a/d converter interrupt bit, ade, must also be set to 1.
rev. 1.10 60 ?e???a?? 1?? ?01? rev. 1.10 61 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu step 6 the analog to digital conversion process can now be initialised by setting the start bit in the adcr register from 0 to 1 and then to 0 again. note that this bit should have been originally set to 0. step 7 to check when the analog to digital conversion process is complete, the eocb bit in the adcr register can be polled. the conversion process is complete when this bit goes low. when this occurs the a/d data registers adrl and adrh can be read to obtain the conversion value. as an alternative method if the interrupts are enabled and the stack is not full, the program can wait for an a/d interrupt to occur. note: when checking for the end of the conversion process, if the method of polling the eocb bit in the adcr register is used, the interrupt enable step above can be omitted. the accompanying diagram shows graphically the various stages involved in an analog to digital conversion process and its associated timing. the setting up and operation of the a/d converter function is fully under the control of the application program as there are no confguration options associ ated with the a/d converter. after an a/d conversion process has been initiated by the application program, the microcontroller internal hardware will begin to carry out the conversion, during which time the program can continue with other functions. the time taken for the a/d conversion is 16t ad where t ad is equal to the a/d clock period. programming considerations when programming, special attention must be given to the pcr[7:0] bits in the register. if these bits are all cleared to zero no external pins will be selected for use as a/d input pins allowing the pins to be used as normal i/o pins. when this happens the internal a/d circuitry will be power down. setting the adonb bit high has the ability to power down the internal a/d circuitry, which may be an important consideration in power sensitive applications. a/d transfer function as the device contains a 12-bit a/d converter, its full-scale converted digitised value is equal to fffh. since the full-scale analog input value is equal to the v dd voltage, this gives a single bit analog input value of v dd /4096. the diagram show the ideal transfer function between the analog input value and the digitised output value for the a/d converter. note that to reduce the quantisation error, a 0.5 lsb offset is added to the a/d converter input. except for the digitised zero value, the subsequent digitised values will change at a point 0.5 lsb below where they would change without the offset, and the last full scale digitised value will change at a point 1.5 lsb below the v dd level. a/d programming example the following two programming examples illustrate how to setup and implement an a/d conversion. in the frst example, the method of polling the eocb bit in the adcr register is used to detect when the conversion cycle is complete, whereas in the second example, the a/d interrupt is used to determine when the conversion is complete.
rev. 1.10 6? ?e???a?? 1?? ?01? rev. 1.10 6? ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu               
            
                   ? ? ?   ?  ?   ??? ?  ???   ?  - ?  ?   ??  ? ? ? ? ? ? ? ? ?  ?  ?   ?  ?    ??      ? ?   ?    ?                      ?  ? ?          ?                     ?                   
            ?  ? ?           ? ? ?  ?       ? ?               a/d conversion timing                

 
 
   
 
 
 
 
 ?  ? ? ? ? ?  ??     ?  
 ? ideal a/d transfer function example: using an eocb polling method to detect the end of conversion clr eadi ;disable adc interrupt mov a,00000001b mov acsr,a ;select f sys /8 as a/d clock and adonb=0 mov a,0fh ;setup ancsr to confgure pins an0~an3 mov ancsr0,a mov a, 00h mov ancsr1,a ; mov a,00000000b ; mov adcr,a ;select an0 to be connected to the a/d converter : start_conversion: clr start set start ;reset a/d clr start ;start a/d polling_eoc: sz eocb ;poll the adcr register eocb bit to detect ; end of a/d conversion
rev. 1.10 6? ?e???a?? 1?? ?01? rev. 1.10 6? ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu jmp polling_eoc ;continue polling mov a,adrl ;read low byte conversion result value mov adrl_buffer,a ;save result to user defned register mov a,adrh ;read high byte conversion result value mov adrh_buffer,a ;save result to user defned register : jmp start_conversion ;start next a/d conversion note: to power off adc module, it is necessary to set adonb as 1. example: using the interrupt method to detect the end of conversion clr eadi ;disable adc interrupt mov a,00000001b mov acsr,a ;select f sys /8 as a/d clock and adonb=0 mov a,0fh ;setup ancsr to confgure pins an0~an3 mov ancsr0,a mov a, 00h mov ancsr1,a ; mov a,00000000b ; mov adcr, a ;select an0 to be connected to the a/d ; converter : start_conversion: clr start set start ;reset a/d clr start ;start a/d clr adf ;clear adc interrupt request fag set eadi ;enable adc interrupt set emi ;enable global interrupt : : ;adc interrupt service routine adc_: mov acc_stack,a ;save acc to user defned memory mov a,status mov status_stack,a ;save status to user defned memory : : mov a,adrl ;read low byte conversion result value mov adrl_buffer,a ;save result to user defned register mov a,adrh ;read high byte conversion result value mov adrh_buffer,a ;save result to user defned register : : exit_isr: mov a,status_stack mov status,a ;restore status from user defned memory mov a,acc_stack ;restore acc from user defned memory clr adf ;clear adc interrupt fag reti note: to power off adc module, it is necessary to set adonb as 1.
rev. 1.10 64 ?e???a?? 1?? ?01? rev. 1.10 65 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu interrupts interrupts are an important part of any microcontroller system. when an external event or an internal function such as a timer/event counter or time base requires microcontroller attention, their corresponding interrupt will enforce a temporary suspension of the main program allowing the microcontroller to direct attention to their respective needs. the device provides an external interrupt and multiple internal interrupts . the external interrupt is controlled by the action of the external interrupt pin, while the internal interrupts are controlled by the timer/event counters overfow and the timer base overfow. interrupt register overall interrupt control, which means interrupt enabling and request flag setting, is controlled by using two registers, intc0 and intc1. by controlling the appropriate enable bits in this registers each individual interrupt can be enabled or disabled. also when an interrupt occurs, the corresponding request fag will be set by the microcontroller. the global enable fag if cleared to zero will disable all interrupts. intc0 register bit 7 6 5 4 3 2 1 0 name t0? aup? ei? t0e aupe eei emi r/w r/w r/w r/w r/w r/w r/w r/w por 0 0 0 0 0 0 0 bit 7 unimplemented, read as 0 bit 6 t0f : timer/event counter 0 interrupt request fag 0: inactive 1: active bit 5 aupf : audio processor request fag 0: inactive 1: active bit 4 eif : external interrupt request fag 0: inactive 1: active bit 3 t0e : timer/event counter 0 interrupt enable 0: disable 1: enable bit 2 aupe : audio processor interrupt enable 0: disable 1: enable bit 1 eei : external interrupt enable 0: disable 1: enable bit 0 emi : master interrupt global enable 0: disable 1: enable
rev. 1.10 64 ?e???a?? 1?? ?01? rev. 1.10 65 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu intc1 register bit 7 6 5 4 3 2 1 0 name tb? ad? t?? t1? tb e ade t?e t 1 e r/w r/w r/w r/w r/w r/w r/w r/w r/w por 0 0 0 0 0 0 0 0 bit 7 tbf : time base request fag 0: inactive 1: active bit 6 adf : a/d request fag 0: inactive 1: active bit 5 t2f : internal timer/event counter 2 request fag 0: inactive 1: active bit 4 t1f : internal timer/event counter 1 request fag 0: inactive 1: active bit 3 tb e : time base interrupt enable 0: disable 1: enable bit 2 ade : a/d converter interrupt enable 0: disable 1: enable bit 1 t2e : timer/event counter 2 interrupt enable 0: disable 1: enable bit 0 t 1 e : timer/event counter 1 interrupt enable 0: disable 1: enable
rev. 1.10 66 ?e???a?? 1?? ?01? rev. 1.10 67 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu interrupt operation a timer/event counter overflow, an active edge on the external interrupt pin, a serial data byte transmitted or received completion, or a time base event will all generate an interrupt request by setting their corresponding request fag, if their appropriate interrupt enable bit is set. when this happens, the program counter, which stores the address of the next instruction to be executed, will be transferred onto the stack. the program counter will then be loaded with a new address which will be the value of the corresponding interrupt vector. the microcontroller will then fetch its next instruction from this interrupt vector. the instruction at this vector will usually be a jmp statement which will jump to another section of program which is known as the interrupt service routine. here is located the code to control the appropriate interrupt. the interrupt service routine must be terminated with a reti instruction, which retrieves the original program counter address from the stack and allows the microcontroller to continue with normal execution at the point where the interrupt occurred. the various interrupt enable bits, together with their associated request flags, are shown in the following diagram with their order of priority. 04h 08h 0ch 10h 14h 18h 1ch vector low p?io?it? high req?est ?lags ena?le bits maste? ena?le emi a?to disa?led in isr inte???pt name emi emi emi emi emi emi int? int pin inte aup? a?dio p?ocesso? aup e t 0? time?/event co?nte? 0 t 0e t 1? t 1e t?? t?e tb? time base ade ad? a/d tbe emi legend xx? req?est ?lag C a?to ?eset in isr xxe ena?le bit time?/event co?nte? 1 time?/event co?nte? ? 04h 08h 0ch 10h 14h 18h 1ch vector low p?io?it? high req?est ?lags ena?le bits maste? ena?le emi a?to disa?led in isr inte???pt name emi emi emi emi emi emi int? int pin inte aup? a?dio p?ocesso? aup e t 0? time?/event co?nte? 0 t 0e t 1? t 1e t?? t?e tb? time base ade ad? a/d tbe emi legend xx? req?est ?lag C a?to ?eset in isr xxe ena?le bit time?/event co?nte? 1 time?/event co?nte? ? interrupt structure once an interrupt subroutine is serviced, all the other interrupts will be blocked, as the emi bit will be cleared automatically. this will prevent any further interrupt nesting from occurring. however, if other interrupt requests occur during this interval, although the interrupt will not be immediately serviced, the request fag will still be recorded. if an interrupt requires immediate servicing while the program is already in another interrupt service routine, the emi bit should be set after entering the routine, to allow interrupt nesting. if the stack is full, the interrupt request will not be acknowledged, even if the related interrupt is enabled, until the stack pointer is decremented. if immediate service is desired, the stack must be prevented from becoming full.
rev. 1.10 66 ?e???a?? 1?? ?01? rev. 1.10 67 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu when an interrupt request is generated it takes 2 or 3 instruction cycle before the program jumps to the interrupt vector. if the device is in the sleep or idle mode and is woken up by an interrupt request then it will take 3 cycles before the program jumps to the interrupt vector. interrupt flow interrupt priority interrupts, occurring in the interval between the rising edges of two consecutive t2 pulses, will be serviced on the latter of the two t2 pulses, if the corresponding interrupts are enabled. in case of simultaneous requests, the following table shows the priority that is applied. these can be masked by resetting the emi bit. interrupt source priority vector exte?nal inte???pt 1 04h a?dio p?ocesso? inte???pt ? 08h timer/event counter 0 overfow ? 0ch timer/event counter 1 overfow 4 10h timer/event counter 2 overfow 5 14h a/d inte???pt 6 18h time base counter overfow 7 1ch interrupt subroutine vector
rev. 1.10 68 ?e???a?? 1?? ?01? rev. 1.10 69 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu in cases where both external and internal interrupts are enabled and where an external and internal interrupt occurs simultaneously, the external interrupt will always have priority and will therefore be serviced frst. suitable masking of the individual interrupts using the interrupt registers can prevent simultaneous occurrences. external interrupt for an external interrupt to occur, the global interrupt enable bit, emi, and external interrupt enable bit, inte, must frst be set. an actual external interrupt will take place when the external interrupt request fag, intf, is set, a situation that will occur when an edge transition appears on the external int line. the type of transition that will trigger an external interrupt, whether high to low, low to high or both is determined by the integ0 and integ1 bits, which are bits 6 and 7 respectively, in the ctrl1 control register. these two bits can also disable the external interrupt function. integ1 integ0 edge trigger type 0 0 exte?nal inte???pt disa?le 0 1 rising edge t ?igge? 1 0 ? alling edge t ?igge? 1 1 both edge t ?igge? the external interrupt pin is pin-shared with the i/o pin pa3 and can only be configured as an external interrupt pin if the corresponding external interrupt enable bit in the intc0 register has been set and the edge trigger type has been selected using the ctrl1 register. the pin must also be setup as an input by setting the corresponding pac.3 bit in the port control register. when the interrupt is enabled, the stack is not full and an active transition appears on the external interrupt pin, a subroutine call to the external interrupt vector at location 04h, will take place. when the interrupt is serviced, the external interrupt request fag, eif, will be automatically reset and the emi bit will be automatically cleared to disable other interrupts. note that any pull-high resistor connections on this pin will remain valid even if the pin is used as an external interrupt input. timer/event counter interrupt for a timer/event counter interrupt to occur, the global interrupt enable bit, emi, and the corresponding timer interrupt enable bit, tne, must first be set. an actual timer/event counter interrupt will take place when the timer/event counter request fag, tnf, is set, a situation that will occur when the relevant timer/event counter overfows. when the interrupt is enabled, the stack is not full and a timer/event counter n overflow occurs, a subroutine call to the relevant timer interrupt vector, will take place. when the interrupt is serviced, the timer interrupt request fag, tnf, will be automatically reset and the emi bit will be automatically cleared to disable other interrupts. time b ase i nterrupt the internal time base counter interrupt is initialized by setting the time base overfow interrupt request fag, which is normally caused by a timer overfow. after the interrupt is enabled, and the stack is not full, and the tbf bit is set, a subroutine call occurs. the related interrupt request fag tbf is reset, and the emi bit is cleared to disable further mask-able interrupts. a/d converter i nterrupt the a/d converter interrupt is initialized by setting the a/d converter request fag, caused by an end of a/d conversion. when the interrupt is enabled, the stack is not full and the adf is set, a sub- routine call will occur. the related interrupt request fag adf will be reset and the emi bit cleared to disable further interrupts.
rev. 1.10 68 ?e???a?? 1?? ?01? rev. 1.10 69 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu audio processor interrupt the audio processor interrupt is initialized by setting the audio processor request fag, . when audio processor returns a data, the spicr[0] transits from 1 to 0 . if the interrupt is enabled, the stack is not full and the aupf is set, a sub-routine call will occur. the related interrupt request fag aupf will be reset and the emi bit cleared to disable further interrupts. programming considerations by disabling the relevant interrupt enable bits, a requested interrupt can be prevented from being serviced, however, once an interrupt request flag is set, it will re- main in this condition in the interrupt register until the corresponding interrupt is serviced or until the request fag is cleared by the application program. it is recommended that programs do not use the call instruction within the interrupt service subroutine. interrupts often occur in an unpredictable manner or need to be serviced immediately. if only one stack is left and the interrupt is not well controlled, the original control sequence will be damaged once a call subroutine is executed in the interrupt subroutine. every interrupt has the capability of waking up the microcontroller when it is in sleep or idle mode, the wake up being generated when the interrupt request fag changes from low to high. if it is required to prevent a certain interrupt from waking up the microcontroller then its respective request fag should be frst set high before entering the sleep or idle mode. as only the program counter is pushed onto the stack, then when the interrupt is serviced, if the contents of the accumulator, status register or other registers are altered by the interrupt service program, their contents should be saved to the memory at the beginning of the interrupt service routine. to return fro m an interrupt subroutine, either a ret or reti instruction may be executed. the reti instruction in addition to executing a return to the main program also automatically sets the emi bit high to allow further interrupts. the ret instruction however only executes a return to the main program leaving the emi bit in its present zero state and therefore disabling the execution of further interrupts. spi function spi interface is one method to communicate with audio processor. the command groups types can be referred to chapter of audio processor interf ace. spi format and control register as following. spicr register bit 7 6 5 4 3 2 1 0 name iemc eram spiss spick mosi miso spirq r/w r/w r/w r/w r/w r/w r r por 1 0 1 0 0 x x bit 7 i emc : mode control bit 0: external mcu mode (pad control) pad of pa5/pc4/pc5/pc6/pc7 pin shared miso/ mosi/ spirq/ spick/spiss 1: internal mode (mcu control) in external mcu mode, the audio processor can be controlled by external mcu via spi interface. spiss/spick/mosi can not read/write and miso/spirq read only when spirq falling edge occur, it will not effecting aupf to prevents interrupts occurring bit 6 unimplemented, read as 0
rev. 1.10 70 ?e???a?? 1?? ?01? rev. 1.10 71 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu bit 5 eram : pad of pb4/pb5/pb6/pb7 pin shared audio processorio0/1/2/3 0: disable 1: enable bit 4 spiss : select audio processor 0: select 1: no select bit 3 spick : spi clock output to audio processor 0: low 1: high bit 2 mosi : output command/data into audio processor 0: low 1: high bit 1 miso : input command/data from audio processor bit 0 spirq : set to 0 by audio processor, when audio processor interrupt occurs. this bit will be set to 1 by audio processor after mcu read command/data successfully. spis s mosi miso c2 c1 c0 d1 5 d1 4 d1 3 d1 2 d1 1 d1 0 d9 d8 d7 d6 d5 d4 d3 d2 d1 d0 c2 c1 c0 d1 5 d1 4 d1 3 d1 2 d1 1 d1 0 d9 d8 d7 d6 d5 d4 d3 d2 d1 d0 c3 c3 spir q spic k c2 c1 c0 d1 5 d1 4 d1 3 d1 2 d1 1 d1 0 d9 d8 d7 d6 d5 d4 d3 d2 d1 d0 c2 c1 c0 d1 5 d1 4 d1 3 d1 2 d1 1 d1 0 d9 d8 d7 d6 d5 d4 d3 d2 d1 d0 c3 c3 beep function this function is used application program building a square wave on speak or audio processor through beep0/1 pad. bdr register bit 7 6 5 4 3 2 1 0 name beep1 beep0 r/w r/w r/w por 0 0 bit7~6 unimplemented, read as "0" bit 1 beep1 : output signal 0: low 1: high when beep1 function is useful, if audio processor souce is selected beep1, the beep 1 pad is connect to audio processor bit 0 beep0 : output signal 0: low 1: high when beep0 function is useful, if speak souce is selected beep0, the beep 0 pad is connect to speak . the two bits are output pin signals, set or clear bdr data can modify beep0/beep1 status. if the two functions are not useful, modify beep0/beep1 data are not affected beep1/0 pad status.
rev. 1.10 70 ?e???a?? 1?? ?01? rev. 1.10 71 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu digital to analog converter C dac the device includes 4- channel 8-bit digital to analog converter function. this function allows digital data contained in the device to generate au dio signals. operation the data to be converted is stored in four r egisters da0r, da1r, da2r and da3r. the four bits in the control register dacr provides dacn on/off control. the dacn outputs are channeled to pin dao0~dao3 which are pin-shared with i/o pin pb0~pb3. when the dacn is enabled by setting the enn high, then the original i/o function will be disabled, along with any pull-high resistor options. the dac output reference voltage is th e power supply voltage v dd . dacr register bit 7 6 5 4 3 2 1 0 name en? en? en1 en0 r/w r/w r/w r/w r/w por 0 0 0 0 bit 7~4 unimplemented, read as "0" bit 3 en3 : dac3 disable/enable control 0: disable 1: enable bit 2 en2 : dac2 disable/enable control 0: disable 1: enable bit 1 en1 : dac1 disable/enable control 0: disable 1: enable bit 0 en0 : dac0 disable/enable control 0: disable 1: enable da3r register bit 7 6 5 4 3 2 1 0 name da?7 da?6 da?5 da?4 da?? da?? da?1 da?0 r/w r/w r/w r/w r/w r/w r/w r/w r/w por x x x x x x x x x ?nknown bits 7~0 da37 ~ da30 : dac3 output data da2r register bit 7 6 5 4 3 2 1 0 name da?7 da?6 da?5 da?4 da?? da?? da?1 da?0 r/w r/w r/w r/w r/w r/w r/w r/w r/w por x x x x x x x x x ?nknown bits 7~0 da 2 7 ~ da 2 0 : dac2 output data
rev. 1.10 7? ?e???a?? 1?? ?01? rev. 1.10 7? ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu da1r register bit 7 6 5 4 3 2 1 0 name da17 da16 da15 da14 da1? da1? da11 da10 r/w r/w r/w r/w r/w r/w r/w r/w r/w por x x x x x x x x x ?nknown bits 7~0 da 17~ da 1 0 : dac1 output data da0r register bit 7 6 5 4 3 2 1 0 name da07 da06 da05 da04 da0? da0? da01 da00 r/w r/w r/w r/w r/w r/w r/w r/w r/w por x x x x x x x x x ?nknown bits 7~0 da 07~ da 0 0 : dac0 output data low voltage detector C lvd the device has a low voltage detector function, known as lvd. this enables the device to monitor the power supply voltage, vdd, and provide a warning signal should it fall below a certain level. this function may be especially useful in battery applications where the supply voltage will gradually reduce as the battery ages, as it allows an early warning battery low signal to be generated. lvd register the low voltage detector is controlled using a single register, lvdc, and confguration options. the voltage threshold level to be detected is determined using a configuration option, therefore cannot be modifed by the application program. lvdc register bit 7 6 5 4 3 2 1 0 name lvdo lvden r/w r/w r/w por bit 7~6 unimplemented, read as "0" bit 5 lvdo : lvd output flag 0: no low voltage detect 1: low voltage detect bit 4 lvden : low voltage detector control 0: disable 1: enable bit 3~0 unimplemented, read as "0" lvd operation the low voltage detector function operates by comparing the power supply voltage, vdd, with a pre-specifed voltage level voltage level setup using a confguration option. when the power supply voltage, vdd, falls below this pre-determined value, the lvdo bit will be set high indicating a low power supply voltage condition. the low voltage detector function is supplied by a reference voltage which will be automatically enabled. when the device is powered down the low voltage
rev. 1.10 7? ?e???a?? 1?? ?01? rev. 1.10 7? ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu detector will remain active if the lvden bit is high. after enabling the low voltage detector, a time delay tlvds should be allowed for the circuitry to stabilise before reading the lvdo bit. note also that as the vdd voltage may rise and fall rather slowly, at the voltage nears that of vlvd, there may be multiple bit lvdo transitions.              lvd operation audio process or the device includes an audio processor function for processing of signals received on the rf carrier. aimed specifcally at low cost radio communication products the audio processor section contains all the transmitter and receiver functions required to process the necessary in-band audio signals such as compression, expansion, scrambling and de-scrambling. audio receiver the following diagram shows the main functional blocks of the receiver audio processor. audio filters de- emphasis expander de- scrambler lpf - 270 p ? og ? ammed/use ? defined ctcss decode ? hpf - 300 p ? og ? ammed/use ? defined ?? - ? it dcs decode ? dtmf decoders selective call decoders a ? dio_ o?t de -m? x de -m? x in band decode ? s tone sq ? elch decode ?s receive ?? nctions audio filters de- emphasis expander de- scrambler lpf - 270 p ? og ? ammed/use ? defined ctcss decode ? hpf - 300 p ? og ? ammed/use ? defined ?? - ? it dcs decode ? dtmf decoders selective call decoders a ? dio_ o?t de -m? x de -m? x in band decode ? s tone sq ? elch decode ?s receive ?? nctions r eceiver block diagram
rev. 1.10 74 ?e???a?? 1?? ?01? rev. 1.10 75 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu receiver audio filters the incoming signal is first filtered, as shown in the block diagram , to remove sub-audio components and to flter out high frequency noise. after th is low and high pass fltering is executed, the residual audio signal is then routed to the audio output. individual flters are available for the following : 300hz high pass for rejection of sub audio signals 2.55khz low pass for narrow band w idth channel operation 3.0khz low pass for wide band w idth channel operation receiver audio filter frequency response receiver de-emphasis the device includes a selectable pre-emphasis filter with a response as shown in the following fgure . audio frequency de-emphasis
rev. 1.10 74 ?e???a?? 1?? ?01? rev. 1.10 75 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu r eceiver de-scrambler i f desired, the transmitter section of the device can be setup to scramble the transmitted audio signal s by invers ing the transmitted audio frequenc ies . in the receiver mode, a d escrambler is used to convert the received scrambled signals back to their original audio frequency content. the inversion central frequency can be programmed using the cli scramble frequency register. the default inversion central frequency value is 3300hz. r eceiver expander the receiver section includes an expander function to expand any signals that may have been compressed by the transmitter. this function is optional and is only used if the transmitter is transmitting compressed signals. compressing and expanding the audio signals increases greatly the signal dynamic range. receiving and decoding ctcss or dcs codes the device can accurately detect valid ctcss tones rapidly which prevents losing the start of audio or data transmissions . it can also continuously monitor the detected tone s low risk of false drop out. the dcs code is in nrz format and is transmitted at a rate of 134.40.4bps. the device is able to decode any 23-bit pattern in either of the two dcs modulation modes as defned by tia/eia-603. the device can also rapidly detect valid dcs code quickly enough to avoid losing the beginning of audio transmissions. rx in-band tone decoder the in-band tone can be summarized into selective call, dtmf and user-tone categories. for selective call, the HT98R068-1 will decode a set of eea defned tone set s , however this may be changed by the users to any valid tone sets within its operational range by setting related registers. this ensures that the device can remain compatible with all available tone systems in use. the HT98R068-1 does not implement automatic repeat tone insertion or deletion as this depends upon the user protocol. audio transmitter the following diagram shows the main function blocks of the transmitter audio processor. transmitted functions a?dio ?ilte? comp?esso? sc?am?le? emphasis in - ?and signaling ( dtm? / selective call / use? - tone ) s?? - a?dio encode?s mux smod mod t ransmitter block diagram
rev. 1.10 76 ?e???a?? 1?? ?01? rev. 1.10 77 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu t ransmitter audio filters the transmitter audio flters include a 25khz wide-band and a 12.5khz narrow-band channel flter . the flter frequency responses are shown in the following fgure s . t ransmitter audio filter frequency response transmitter pre-emphasis the device includes a selectable pre-emphasis flter with +6db per octave from 300hz to 3000hz, with a response as shown in the following fgure . . transmitter audio frequency pre-emphasis t ransmitter scrambler the device includes an optional frequency inversion scrambler for both the transmit and receive modes. this scrambles the transmitted audio band signals, which can then be de-scrambled in the receiver. the central inversion frequency is programmed using registers. the default value is 3300hz. the central inversion frequency can be changed not only in the idle mode but also in the active rx or tx mode.
rev. 1.10 76 ?e???a?? 1?? ?01? rev. 1.10 77 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu t ransmitter compressor the device incorporates an optional syllabic compandor for both the transmit and receive mode. this compresses the audio band signals before transmission to enhance the overall dynamic range. the relationship between the input and output voltage of the compandor is show n in the following fgure . compander voltage-voltage response transmitter sub-audio encoders sub-audio signaling is available in the audio band below 260hz. when sub-audio signaling is enabled, the 300hz hpf in the audio section should also be enabled to remove the sub-audio signaling from the actual audio signal s ( for both tx and rx). both ctcss tones and dcs codes are supported. except for the 51 defned ctcss tones, users can defne their specifed tone s using registers. the dcs coder/decoder includes a 23-bit mode with both normal and inverse modulation formats and a 134hz end of transmission burst. transmitter in-band signaling the device includes a programmable in-band tone set or an arbitrary single user-tone between 300hz and 3000hz. by default, the device will use an eea selective call defned tone set; however this may be changed to any valid tone within its operational range using registers. as well as the selective call defned tone sets, standard dual tone multiple frequenc y, dtmf , is also supported in the in-band signaling mode. supported different combination functions for optimal power consumption, the audio processor can be set to operate with different operation frequenc ies for different function al requirement s . the accompanying table provides a reference for the required audio processor system clock for different applications.
rev. 1.10 78 ?e???a?? 1?? ?01? rev. 1.10 79 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu receiver voice band processing sub-audio voice band signaling required system clock (f ap ) basic voice ?ilte? ctcss none 1?m inv dcs? dcs none 16m ctcss dtm? decode? 16m s??-a?dio not s?ppo?ted a. none 8m b. dtm? decode? 16m c. selective call decode? 16m basic voice ?ilte? + de-emphasis inv dcs? dcs / ctcss none 16m s??-a?dio not s?ppo?ted a. none 8m b. dtm? decode? 16m basic voice ?ilte? + expande? inv dcs? dcs / ctcss none 16m s??-a?dio not s?ppo?ted a. none 16m b. dtm? decode? 16m basic voice ?ilte? + de-emphasis + expande? s??-a?dio not s?ppo?ted none 1?m ctcss dtm? decode? 16m inv dcs? dcs none 16m basic voice ?ilte? + de-emphasis + expande?+sc?am?le s??-a?dio not s?ppo?ted none 1?m ctcss none 16m dcs none 16m vox none none 4m transmitter voice band processing sub-audio voice band signaling required system clock (f ap ) basic voice ?ilte? inv dcs? dcs / ctcss a. none 1?m b. tone gene ?ato? 16m s??-a?dio not s?ppo?ted a. none 8m b. tone gene ?ato? 1?m basic voice ?ilte? + emphasis inv dcs? dcs / ctcss a. none 1?m b. tone gene ?ato? 16m s??-a?dio not s?ppo?ted a. none 8m b. tone gene ?ato? 1?m basic voice ?ilte? + comp?ess inv dcs? dcs / ctcss a. none 16m b. tone gene ?ato? 16m s??-a?dio not s?ppo?ted a. none 1?m b. tone gene ?ato? 1?m basic voice ?ilte? + emphasis + comp?ess inv dcs? dcs / ctcss a. none 16m s??-a?dio not s?ppo?ted a. none 1?m b. tone gene ?ato? 16m
rev. 1.10 78 ?e???a?? 1?? ?01? rev. 1.10 79 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu audio signal routing the device has a fexible audio signal routing input and output structure to route signals to and from the audio processor. the routing setup paths is controlled using the path selection register which is described in a different section. the gain of the internal programmable gain amplifer shown in the block diagram is also setup using a register, the details of which are described in a different section. c9 0.1u f r2 r1 1k mi c c1 1uf c3 0.1u f c4 1uf c6 1uf vc c c1 0 0.1u f y1 32.768 k c1 3 10pf c1 4 10pf r5 10m c1 2 50nf r4 15k c1 5 100pf c7 4nf r3 10k audi o ou t s ub-tone out pc 5 41 pc 6 42 pc 7 43 pd 0 44 pd 1 45 vs s 46 mic_ o 47 mic_ i 48 de mo d 1 vag 2 vagre f 3 vcca 1 4 aux 5 pe 1 6 pe 0 7 sm od 8 m odo 9 audo 10 vcca 2 11 vssa 2 12 pb 0 13 pb 1 14 pb 2 15 pb 3 16 pd 2 17 pd 3 18 pb 4 19 pb 5 20 pllc 21 xi n 22 xout 23 vs s 24 vdd 25 pb 6 26 pb 7 27 pa 0 28 pa 1 29 pa 2 30 pa 3 31 pc 0 32 pc 1 33 pc 2 34 pc 3 35 pa 7 36 pa 6 37 pa 5 38 pa 4 39 pc 4 40 u1 HT98R068-1_48pi n c5 1uf aux input mo d out c2 1uf rf bl oc k spearker bl oc k rssi rssi c1 1 3nf l1 vc c l2 vcc1 vcc2 c8 0.1u f vcc1 vcc2 audio signal routing block diagram mcu interfacing the audio processor communicates with the integrated mcu using a series of command registers. communication with external mcus is conducted using the spicr register and the pc4~pc7 i/o lines which have shared use as an spi interface. spis s spic k mosi miso c2 c1 c0 d1 5 d1 4 d1 3 d1 2 d1 1 d1 0 d9 d8 d7 d6 d5 d4 d3 d2 d1 d0 c2 c1 c0 d1 5 d1 4 d1 3 d1 2 d1 1 d1 0 d9 d8 d7 d6 d5 d4 d3 d2 d1 d0 c3 c3 spir q c2 c1 c0 d1 5 d1 4 d1 3 d1 2 d1 1 d1 0 d9 d8 d7 d6 d5 d4 d3 d2 d1 d0 c2 c1 c0 d1 5 d1 4 d1 3 d1 2 d1 1 d1 0 d9 d8 d7 d6 d5 d4 d3 d2 d1 d0 c3 c3 spiss from the mcu: this pin is an input pin and active low. spick from the mcu: this pin is the clock source input pin. mosi (smosi) from the mcu: this pin is the slave spi input data pin. mosi refers to master output slave input. miso (smiso) from the audio processor: th is pin is the slave spi output data pin. miso refers to ma s ter input slave output.
rev. 1.10 80 ?e???a?? 1?? ?01? rev. 1.10 81 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu spirq from the audio processor: th is pin is the slave spi output pin. it is used to improve the cli interface access data speed. the f irst half byte c3~c0 form the spi command which is followed by t wo byte s d15~d0 of data command groups there are two types of command for the host to communicate with the audio processor. one is an i/ o command group and the other is a cli command group. the i/o command group is related to the switching on/off function. the cli command group is related to the audio processing functions. io command group write C c [3:0]= "1000" the mcu will send 8 bits of io command address and 8 bits of io command data to audio processor. the host device sends io register write command to audio processor. waveform is showed as follows: spis s spic k mosi miso 0 0 0 a7 a6 a5 a4 a3 a2 a1 a0 d7 d6 d5 d4 d3 d2 d1 d0 0 0 0 d1 5 d1 4 d1 3 d1 2 d1 1 d1 0 d9 d8 d7 d6 d5 d4 d3 d2 d1 d0 1 0 spir q 0 0 0 a7 a6 a5 a4 a3 a2 a1 a0 d7 d6 d5 d4 d3 d2 d1 d0 0 0 0 d1 5 d1 4 d1 3 d1 2 d1 1 d1 0 d9 d8 d7 d6 d5 d4 d3 d2 d1 d0 1 0 i/o command group read C c [3:0]= "1001" the host device will read 8 bits of the io command address and 8 bits of the io command data from the audio processor. the io command group requires a dual spi command cycle. during the frst cycle, the io read command (io address) is sent to the audio processor. during the second cycle, the audio proces s or returns its io command data back to the host. the following two waveforms show the io command read timing. spis s spic k mosi miso 0 0 1 a7 a6 a5 a4 a3 a2 a1 a0 x x x x x x x x 0 0 0 d1 5 d1 4 d1 3 d1 2 d1 1 d1 0 d9 d8 d7 d6 d5 d4 d3 d2 d1 d0 1 0 spir q 0 0 1 a7 a6 a5 a4 a3 a2 a1 a0 x x x x x x x x 0 0 0 d1 5 d1 4 d1 3 d1 2 d1 1 d1 0 d9 d8 d7 d6 d5 d4 d3 d2 d1 d0 1 0 during the frst cycle, the io command (io address) is sent to the audio processor spis s spic k mosi miso 0 0 0 d1 5 d1 4 d1 3 d1 2 d1 1 d1 0 d9 d8 d7 d6 d5 d4 d3 d2 d1 d0 0 0 0 1 a7 a6 a5 a4 a3 a2 a1 a0 d7 d6 d5 d4 d3 d2 d1 d0 1 0 0 0 d1 5 d1 4 d1 3 d1 2 d1 1 d1 0 d9 d8 d7 d6 d5 d4 d3 d2 d1 d0 0 0 0 1 a7 a6 a5 a4 a3 a2 a1 a0 d7 d6 d5 d4 d3 d2 d1 d0 1 re ply io register data to spi po r t during the second cycle, the audio processor returns its io command data to the host
rev. 1.10 80 ?e???a?? 1?? ?01? rev. 1.10 81 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu cli command group the following waveform shows the host sending a cli command to the audio processor. spis s spic k mosi miso 0 0 1 d1 5 d1 4 d1 3 d1 2 d1 1 d1 0 d9 d8 d7 d6 d5 d4 d3 d2 d1 d0 0 0 0 d1 5 d1 4 d1 3 d1 2 d1 1 d1 0 d9 d8 d7 d6 d5 d4 d3 d2 d1 d0 0 0 spir q 0 0 1 d1 5 d1 4 d1 3 d1 2 d1 1 d1 0 d9 d8 d7 d6 d5 d4 d3 d2 d1 d0 0 0 0 d1 5 d1 4 d1 3 d1 2 d1 1 d1 0 d9 d8 d7 d6 d5 d4 d3 d2 d1 d0 0 0 write cmd details cli_cmd major minor multi length 4? 0001 4? 0100 4? 0000 4? 1000 4? 0010 4?0001 add?ess[15:0] 4?0001 data[15:0] reply: cli_cmd major minor multi length 4?0001 4?0100 4?0000 4?0000 4?0000 note: when the a udio processor repl ies with 14000 this means that the write data condition s has been met . read cmd details cli_cmd major minor multi length 4? 0001 4? 0100 4? 0001 4? 1000 4? 0001 4?0001 add?ess[15:0] reply: cli_cmd major minor multi length 4?0001 4?0100 4?0001 4?1000 4?0001 4?0001 data[15:0] command group summary the i/o commands are summarised in the following table. address / bit 7 6 5 4 3 2 1 0 00~10 rese?ved 11 ope?ation mode a?dio band mode s?? a? dio mode 1?~19 rese?ved 1a pga_b 1b pgai_s audo_s sdao? sdao1 1c~1d rese?ved 1e /en_dac? /en_dac1 en_amp? en_amp1 en_bu? en_mic en_pga 1?1 1?~?1 rese?ved ?? irq dtm? int selective call int ctcss int dcs int off_tone int vox int
rev. 1.10 8? ?e???a?? 1?? ?01? rev. 1.10 8? ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu address / bit 7 6 5 4 3 2 1 0 ?? dtm? event selective call event ctcss event dcs event off_tone event vox event ?4~?8 rese?ved ?9 vox th? eshold stat?s ?a selective call ?b s??_inv s?? a? dio tone ?c en_sc?am en_comp en_emp en_nbw en_wbw en_hp??00 en_vox en_agc ?d dtm? tone ?e selective call ?inde? ?? dtm? ?inde? ?0 ctc_anti- tone event ?1 en_ctc_ rx_anti- tone en_ctc_ tx_anti- tone 51 ??1 en_aud0 ??1 0 en_aud1 0 i/o command group detail the details behind each i/o command are provided in the following tables. mode control - 11h address bit 7 6 5 4 3 2 1 0 name ope?ation mode in-? and tone mode s?? a? dio mode bit7 unimplemented, ignore this value bit6 ~ 5 operation mode : audio processor operation mode selection 01: slow mode (vox used only) 10: tx mode 11: rx mode bit4 ~ 2 in-band tone mode : in-band tone signal selection 001: user tones ( to da1 ) 010: selective call signal 100: dtmf others : all disable bit1 ~ 0 sub audio mode : sub tone selection 01: dcs 10: ctcss others: all disable pga gain control - 1ah address bit 7 6 5 4 3 2 1 0 name pga_b bit7 ~ 5 unimplemented, ignore this value bit4 ~ 0 pga_b : pga gain x setting the pga gain adjustment range is defned as (1 + x/4) , where x = 0 ~ 31,initial reset value is 00000
rev. 1.10 8? ?e???a?? 1?? ?01? rev. 1.10 8? ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu path selection - 1bh address bit 7 6 5 4 3 2 1 0 name pgai_s audo_s sdao? sdao1 bit7 ~ 5 pgai_s : pga input source selection 000: mico 001: demod 010: aux 011: beep1 1xx:vag bit4 ~ 2 audo_s : audo output buffer source selection 001: dac1 (output range = 1/4 ~ 3/4 v dd ) 011: beep0 100 : dac common-mode bias (v dd /2) other : must not be used bit1 sdao2 : dac2 input source selection 0: dao2 input = dac 1: dao2 input = internal common-mode bias bit0 sdao1 : dac1 input source selection 0: dao1 input = dac 1: dao1 input = internal common-mode bias power control - 1eh address bit 7 6 5 4 3 2 1 0 name en_dac? en_dac1 en_amp? en_amp1 en_bu? en_mic en_pga 1?1 bit7 en_dac2 : dac2 on/off control 0: enable dac2 1: disable dac2 bit6 en_dac1 : dac1 on/off control 0: enable dac1 1: disable dac1 bit5 en_amp2 : amp2 on/off control 0: disable amp2 1: enable amp2 bit4 en_amp1 : amp1 on/off control 0: disable amp1 1: enable amp1 bit3 en_buf : buffer on/off control 0: disable buffer 1: enable buffer bit2 en_mic : mic on/off control 0: disable mic 1: enable mic bit1 en_pga : pga on/off control 0: disable pga 1: enable pga bit0 1b1 : reserved bit, must be set high
rev. 1.10 84 ?e???a?? 1?? ?01? rev. 1.10 85 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu event interrupt mask - 22h address bit 7 6 5 4 3 2 1 0 name irq dtm? int selective call int ctcss int dcs int off_tone int vox int bit7 unimplemented, ignore this value bit6 irq : i nterrupt request - (dtmf, selective call, ctc, dcs, vox) issued on the mcu pe 0: disable irq interrupt request 1: enable irq interrupt request bit5 dtmf int : dtmf event interrupt issue enable/disable selection 0: disable ctcss interrupt request 1: enable ctcss interrupt request bit4 selective call int : selective call event interrupt issue enable/disable selection 0: disable ctcss interrupt request 1: enable ctcss interrupt request bit3 ctcss int : ctcss event interrupt issue enable/disable selection 0: disable ctcss interrupt request 1: enable ctcss interrupt request bit2 dcs int : dcs event interrupt issue enable/disable selection 0: disable dcs interrupt request 1: enable dcs interrupt request bit1 off_tone int : off_tone event interrupt issue enable/disable selection 0: disable off_tone interrupt request 1: enable off_tone interrupt request bit0 vox int : vox event interrupt issue enable/disable selection 0: disable vox interrupt request 1: enable vox interrupt request event status - 23h address bit 7 6 5 4 3 2 1 0 name dtm? event selective call event ctcss event dcs event off_tone event vox event bit 7 ~ 6 unimplemented, ignore this value bit5 dtmf event : dtmf code detect ion 0: no detected dtmf event change 1: dtmf event status has detected change t bit4 selective call event : selective call detection . 0: no detected selective call event change 1: selective call event status has detected change bit3 ctcss event : ctcss code detection 0: no detected ctcss event change 1: ctcss event status has detected change bit2 dcs event : dcs code detection 0: no detected dcs event change 1: dcs event status has detected change bit1 off_tone event : off_tone code detection 0: no detected off_tone event change 1: off_tone event status has detected change
rev. 1.10 84 ?e???a?? 1?? ?01? rev. 1.10 85 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu bit0 vox event : vox signal above high or below low threshold 0: no detected vox event change 1: vox event status has detected change vox threshold status - 29h address bit 7 6 5 4 3 2 1 0 name vox th? eshold stat?s bit 7 ~ 2 unimplemented, ignore this value bit 1 ~ 0 vox threshold status : vox high/low threshold data compare result 01: below low threshold 10: above high threshold other s : dont care selective call tone - 2ah address bit 7 6 5 4 3 2 1 0 name selective cal bit 7 ~ 4 unimplemented, ignore this value bit 3 ~ 0 selective call : selective call tone number selection bit3-0: 0000 C 1111 assigned selective call number 0 C f, following eea protocol. the 16 number tone s are indicated in the address range: 04e0 C 04ff sub-audio tone - 2bh address bit 7 6 5 4 3 2 1 0 name s??_inv s?? a? dio tone bit 7 sub_inv : dcs inverted select bit in dcs mode: 0: non-inverted dcs code 1: inverted dcs code in ctcss mode: dont care bit 6 ~ 0 sub audio tone : sub audio tone channel number bit6-0: select dcs or ctcss tone number, see the following table sub audio mode number(dec) code(dec) / tone dcs 0 user defned dcs code 1-8? dcs code 1~8? 85~1?6 no tone 1?7 dcs t?? n off tone ( to da2 ) ctcss 0 user defned ctcss tone 1~51 ctcss tone 1~51 5?~1?7 no tone sub-audio tone number table
rev. 1.10 86 ?e???a?? 1?? ?01? rev. 1.10 87 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu audio control - 2ch address bit 7 6 5 4 3 2 1 0 name en_sc?am en_comp en_emp en_nbw en_wbw e n_hp??00 en_vox en_agc bit7 en_scram : audio scrambling on/off control 0: disable audio scrambling 1: enable audio scrambling bit6 en_comp : audio compandor on/off control 0: disable audio compandor 1: enable audio compandor bit5 en_emp : audio pre/de-emphasis on/off control 0: disable audio pre/de-emphasis 1: enable audio pre/de-emphasis bit4 en_nbw : narrow band-width channel on/off control 0: disable narrow band-width 1: enable narrow band-width bit3 en_wbw : wide band-width channel on/off control 0: disable wide band-width 1: enable wide band-width bit2 en_hpf300 : audio 300hz hpf on/off control 0: disable audio 300hz hpf 1: enable audio 300hz hpf bit1 en_vox : vox detected on/off control 0: disable vox detected 1: enable vox detected bit0 en_agc : agc function on/off control 0: disable agc 1: enable agc when the agc was enabled, it was suggested that the mic op gain set 5. however, the correspond gain should be scaled corresponding to the operation voltage(i.e. * volt/3.3). dtmf tone - 2dh address bit 7 6 5 4 3 2 1 0 name dtm? tone bit 7 ~ 4 unimplemented, ignore this value bit 3 ~ 0 dtmf tone : dtmf number selection bit3-0: 0000 C 1111 assigned dtmf number, see the following table. low group (hz) high group (hz) digital b3,b2,b1,b0 697 1?09 1 0001 697 1??6 ? 0010 697 1477 ? 0011 770 1?09 4 0100 770 1??6 5 0101 770 1477 6 0110 85? 1?09 7 0111
rev. 1.10 86 ?e???a?? 1?? ?01? rev. 1.10 87 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu low group (hz) high group (hz) digital b3,b2,b1,b0 85? 1??6 8 1000 85? 1477 9 1001 941 1?09 * 1011 941 1??6 0 1010 941 1477 # 1100 697 16?? a 1101 770 16?? b 1110 84? 16?? c 1111 941 16?? d 0000 dtmf data output table selective call finder - 2eh address bit 7 6 5 4 3 2 1 0 name selective call ?inde? bit 7 ~ 5 unimplemented, ignore this value bit 4 ~ 0 selective call finder : detecting selective call number these four bits indicate the detected selective call tone number. in the receiver mode, if the selective call mode is enabled, the processor will calculat e the demodulation signal whether or not a tone exists . when a tone is detected , the calculation result will be auto store d in the selective call fnder register . dtmf finder - 2fh address bit 7 6 5 4 3 2 1 0 name dtm? ?inde? bit 7 ~ 5 unimplemented, ignore this value bit 4 ~ 0 dtmf finder : detected dtmf tone number these four bits indicate the detected dtmf tone number. in the receiver mode, if the dtmf mode is enabled, the processor will calculate the demodulation signal whether or not a tone exists. when a tone is detected , the calculation result will be auto stored in the dtmf fnder register. evnet2 status - 30h address bit 7 6 5 4 3 2 1 0 name ctc_anti- tone event bit 7 ~ 1 unimplemented, ignore this value bit 0 ctc_anti-tone event: ctcss anti-tone detection 0: no detected ctcss anti-tone event change 1: ctcss anti-tone event status is detected change
rev. 1.10 88 ?e???a?? 1?? ?01? rev. 1.10 89 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu event2 control - 31h address bit 7 6 5 4 3 2 1 0 name en_ctc_rx_ anti-tone en_ctc_tx_ anti-tone bit7~2 unimplemented, ignore this value bit1 en_ctc_rx_anti-tone : ctcss rx anti-tone on/off control 0: disable ctcss detect anti-tone in rx mode. 1: enable ctcss detect anti-tone in rx mode bit 0 en_ctc_tx_anti-tone : ctcss tx anti-tone on/off control when ctcss is in the tx mode, the en_ctc_anti bit can to enable ctcss anti-tone signal. if this control bit 01 or 10 both have anti-tone effect (phase reversal 180 ? ). audio processor control - 51h address bit 7 6 5 4 3 2 1 0 name ??1 en_aud0 ??1 0 en_aud1 0 bit7~6, 4~3 2b1 : reserved bit, must be all set high. bit5, 1 en_aud0/1 : audio processor turn on/off selection if the system is to be placed into the standby status to save power, this two bit should be set high. the en_aup0 and en_aup1 bit stops the control audio processor operation. 10: enable audio processor 01: disable audio processor bit 2, 0 0 : zero, must be cleared to zero. cli command group summary the cli commands are summarised in the following table. address / bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 01?a comp?esso? th?eshold 01?? expande? th?eshold 01?c ~ 01?? rese?ved 01?4 0 agc step 01?5~01?9 rese?ved 01?a sc?am?le? inv. ??eq. C pa?amete?1 01?? sc?am?le? inv. ??eq. C pa?amete?? 01?c ~ 01c? rese?ved 01c4 dtm? powe? th?eshold 01c5~01dc rese?ved 01dd off tone accepted voltage registe ? 01de off tone released voltage registe ? 01df~01e1 rese?ved 01e? dcs accepted voltage registe ? 01e?~0??? rese?ved 0??4 6hoh?wlyh&doo8vhu'hqhg7rqh??hswhg9rowdjh5hjlvwhu 0??5 6hoh?wlyh&doo8vhu'hqhg7rqh5hohdvhg9rowdjh5hjlvwhu 0??6~04c9 rese?ved 04ca ctcss powe? released th?eshold 04c? vr1 vr?
rev. 1.10 88 ?e???a?? 1?? ?01? rev. 1.10 89 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu address / bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 04cd vox th? eshold high 04ce vox th? eshold low 04cf rese?ved 04d0 use? ctcss C pa?amete?1 04d1 use? ctcss C pa?amete?? 04d? 0 vr? 04d? 0 vr4 04d4 rese?ved 04d5 0 vr5 04d6 ctcss ??eq. 04d7~04d8 rese?ved 04d9 use? -tone ??eq. C pa?amete?1 04da use? -tone ??eq. C pa?amete?? 04d? ctcss powe ? th?eshold 04dc user defned dcs codes[15:0] 04dd 0 user defned dcs codes[22:16] 04de d? op time imm?nit? 04df 0 0 soft limite? 04e0 selective_call_0 C pa?amete?1 04e1 selective_call_0 C pa?amete?? 04e? selective_call_1 C pa?amete?1 04e? selective_call_1 C pa?amete?? 04e4 selective_call_? C pa?amete?1 04e5 selective_call_? C pa?amete?? 04e6 selective_call_? C pa?amete?1 04e7 selective_call_? C pa?amete?? 04e8 selective_call_4 C pa?amete?1 04e9 selective_call_4 C pa?amete?? 04ea selective_call_5 C pa?amete?1 04e? selective_call_5 C pa?amete?? 04ec selective_call_6 C pa?amete?1 04ed selective_call_6 C pa?amete?? 04ee selective_call_7 C pa?amete?1 04ef selective_call_7 C pa?amete?? 04f0 selective_call_8 C pa?amete?1 04f1 selective_call_8 C pa?amete?? 04f? selective_call_9 C pa?amete?1 04f? selective_call_9 C pa?amete?? 04f4 selective_call_a C pa ?amete?1 04f5 selective_call_a C pa ?amete?? 04f6 selective_call_b C pa?amete?1 04f7 selective_call_b C pa?amete?? 04f8 selective_call_c C pa?amete?1 04f9 selective_call_c C pa?amete?? 04fa selective_call_d C pa?amete?1
rev. 1.10 90 ?e???a?? 1?? ?01? rev. 1.10 91 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu address / bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 04f? selective_call_d C pa?amete?? 04fc selective_call_e C pa?amete?1 04fd selective_call_e C pa?amete?? 04fe selective_call_? C pa?amete?1 04ff selective_call_? C pa?amete?? note: 1. when the different operation mode changes such as an rx or tx mode change, a soft_reset cmd 10000 and the initial parameters should be previously transmitted. 2. in the rx m ode, a mute path (except under vox monitoring) should be selected before the rssi signal is large enough. as the dcs/ctcss detecti on time is also related with rssi signal detection, the rf module must take into account this rssi detection response time. the f ollowing is a cli command programming example. ex: adjust the in-band tone and the sub-audio band tone level to a maximum. write condition master write data: 14082 / initiali s e the cli write command 104cb / setup the 04cb register to be written to 1ffff / write ffff to the 04cb register. audio processor reply: 14000 / a fter receiving this reply, the above command is successfully accepted read condition master read data: 14181 / i nitiali s e the cli read command 104cb / setup the 04cb register to be read audio processor reply: 14181 / a fter receiving these two reply, above command is successfully accepted 1ffff
rev. 1.10 90 ?e???a?? 1?? ?01? rev. 1.10 91 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu cli command group detail tx compandor threshold - 012ah address bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 name tx compando ? th?eshold bit15 ~ 0 tx compandor threshold : setup these 16-bits are used for setting the threshold voltage to determine if the signal is to be compressed or expanded. the d efault value is 0x515c (100mvrms@3.3v). when the input signal is larger than threshold voltage, the signal will be compressed otherwise the signal will be expanded. when the input signal is equal to threshold voltage, the signal will not be changed. after the compress ion and expan sion process, the signal will be transmitted. refer to the application note s for detailed register setting. tx compandor threshold - 012bh address bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 name rx compando ? th?eshold bit15 ~ 0 rx compandor threshold : setting rx compandor threshold these 16-bits are used for setting the threshold voltage to determine if the signal is to be compressed or expanded the d efault value is 0x0595 (100mvrms@3.3v). when the received signal is larger than the threshold voltage, the signal will be expanded otherwise the signal will be compressed. when the input signal is equal to threshold voltage, the signal will not be changed. after the compress ion and expan sion process, the signal will revert back to the original input signal. refer to the application note s for detailed register setting. agc step - 0134h address bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 name 0 agc step bit15~3 0: zero, must be cleared to zero. bit15 ~ 0 agc step C setting agc attack/released time the corresponding bits infuence the agc attack and release time. when agc function was enabled, the bits should be set previously. 0x0000: no agc (default) 0x0001: 3500ms 0x0002: 1600ms 0x0003: 1300ms 0x0004: 1100ms 0x0005: 900ms 0x0006: 800ms 0x0007: 600ms scrambler inversion frequency - 013ah address bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 name sc?am?le? inve?sion ??eq?enc? C pa?amete?1 bit15 ~ 0 scrambler inversion frequency C parameter1 : scrambler inversion central frequency parameter1
rev. 1.10 9? ?e???a?? 1?? ?01? rev. 1.10 9? ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu scrambler inversion frequency - 013bh address bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 name sc?am?le? inve?sion ??eq?enc? C pa?amete?? bit15 ~ 0 scrambler inversion frequency C parameter2 : scrambler inversion central frequency parameter2 scrambler inversion frequency range: 2.6khz~3.4khz. default: 3.3khz note: if user needs to defne scrambler inversion central frequency by self, 013a and 013b must be used at the same time. dtmf power threshold - 01c4h address bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 name dtm? powe? th?eshold bit15 ~ 0 dtmf power threshold : dtmf power threshold detector this register is used to setup the minimum detected dtmf signal level. the default value is vth=0xff5b (200mvrms/600mvpp @3.3v) for both tones. refer to the application notes for detailed register setting off tone accepted voltage register - 01ddh address bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 name off tone accepted voltage registe ? bit15 ~ 0 off tone accepted voltage parameter [15:0] : user defnes the acknowledged off tone power bit15-bit0. the default value was set 0xff2b (28mv-peak @3.3v). off tone released voltage register - 01deh address bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 name off tone released voltage registe ? bit15 ~ 0 off tone released voltage parameter [15:0] : user defnes the deceased off tone power bit15- bit0. the default value was set 0xff05 (15mv-peak @3.3v). dcs accepted voltage register - 01e2h address bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 name dcs accepted voltage registe ? bit15 ~ 0 dcs accepted voltage parameter [15:0] : user defnes the sensitivity of dcs squelch signal. however, the corresponding value should be set greater than the overall system noise foor. the default value was set 0x00ff (72mvrms/200mvp-p @3.3v). selective call/user-defned tone accepted voltage register - 0324h address bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 name selective call/user-defned tone accepted voltage register bit15 ~ 0 selective call/user-defned tone accepted voltage parameter [15:0] : user defnes the acknowledged selective call/user-defned tone power bit15-bit0. the default value was set 0xff60, which denotes 70mv-peak operating at 3.3v.
rev. 1.10 9? ?e???a?? 1?? ?01? rev. 1.10 9? ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu selective call/user-defned tone released voltage register - 0325h address bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 name selective call/user-defned tone released voltage register bit15 ~ 0 selective call/user-defned tone released voltage parameter [15:0]: user defnes the deceased selective call/user-defned tone power bit15-bit0. the default value was set 0xff30, which denotes 25mv-amplitude operating at 3.3v. ctcss release power threshold C 04cah address bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 name ctcss powe? released th?eshold bit15 ~0 ctcss power released threshold voltage. this register is to set the minimum ctcss signal level that is to be released. the default value is 0xff05 (15mv-peak@3.3v). in-band tone/sub-audio tx level - 04cbh address bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 name vr1 vr? bit15 ~ 8 vr1[7:0] : in-band tone tx level this register is to adjust the user-tone, selective call and dtmf transmission volume. refer to the modulation path block diagram for information on optimal parameter usage. the vr1 setting is based on the formula: vo1= vvoice * 1.1 if bit2~b4=000 in the i/o command address 11, otherwise vo1=0.75v dd * (vr1)/256; where vvoice is the adc input voltage. note: the actual output voltage will be a little degraded due to the dac1 flter circuit. bit7 ~ 0 vr2[7:0] : sub audio tone tx level this register is to adjust the sub audio ctcss and dcs transmission volume. refer to the modulation path block diagram for information on optimal parameter usage. the vr2 setting is based on the formula:vo2= v dd * (vr2)/256 note: the actual output voltage will be a little degraded due to the dac2 flter circuit. in band tone ( vr 1 ) voice mux vr 4 vr ? vr 5 s?? a?dio tone ( vr ? ) v o 1 v mixed v mod v o ? v smod mod smod modulation p ath b lock d iagram
rev. 1.10 94 ?e???a?? 1?? ?01? rev. 1.10 95 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu mixed gain - 04d2 address bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 name 0 vr? bit15 ~ 8 0 : zero, must be cleared to zero. bit7 ~ 0 vr3 : mixed tone gain adjustment. this register is used to adjust the mixed tone gain levels. refer to the modulation path block diagram for optimal parameter details.. the vr3 setting is based on the formula: v mixed = v o1 * (512-vr3)/512 + v o2 * (vr3/512) note: v o1 can be output from the in-band tone tuned by vr1 or voice mod gain - 04d3 address bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 name 0 vr4 bit15 ~ 10 0 : zero, must be cleared to zero. bit9 ~ 0 vr4 : mod gain adjustment. this register is used to adjust mod pin output gain levels. refer to the modulation path block diagram for optimal parameter details. the vr4 setting is based on the formula: v mod = v mixed * (vr4/1024) note: the actual output voltage will be a little degraded due to the dac1 flter circuit. smod gain - 04d5 address bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 name 0 vr5 bit15 ~ 10 0 : zero, must be cleared to zero. bit9 ~ 0 vr5 : smod gain adjustment. this register is used to adjust the smod output pin gain levels. refer to the modulation path block diagram for optimal parameter details. the vr5 setting is based on the formula: v smod = v o2 * vr5/1024 note: the actual output voltage will be a little degraded due to the dac2 flter circuit. vox threshold high - 04cdh address bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 name vox th? eshold high bit15 ~ 0 vox threshold high : vox high level threshold. this register is used to set the vox high level threshold voltage. the default value is 0x00cc (-15.17dbm@3.3v). when the input signal is larger than the threshold voltage, this means the input signal from microphone is valid. the transmission function will be on. at this time bit0 and bit 1 in the i/o command register address 29 will reply with 0x02. otherwise these two bits will reply with 0x01. refer to the application notes for detailed register setting.
rev. 1.10 94 ?e???a?? 1?? ?01? rev. 1.10 95 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu vox threshold low - 04ceh address bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 name vox th? eshold low bit15 ~ 0 vox threshold low : vox low level threshold. this register is used to set the vox low level threshold voltage. the default value is 0x0088 (-17.78dbm@3.3v). to avoid mistaking an input signal for noise and switching off the transmission, the low level threshold is used to setup the turn off threshold. when the input signal is less than the threshold voltage, bit0 and bit 1 in the i/o command register address 29 will reply with 0x01. otherwise these two bits will reply with 0x02 refer to the application notes for detailed register setting. user ctcss tone_1/2 - 04d0h address bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 name use? ctcss C pa?amete?1 bit15 ~ 0 user defned ctcss tone parameter1. refer to the application notes for detailed register setting. user ctcss tone_2/2 - 04d1h address bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 name use? ctcss C pa?amete?? bit15 ~ 0 user defned ctcss tone parameter2. refer to the application notes for detailed register setting. user defned ctcss tone frequency range: 67 hz~275 hz. note: if it is necessary to a ctcss tone by itself, 04d0 and 04d1must be used at the same time. ctcss frequency accept variance - 04d6 address bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 name ctcss ??eq. bit15 ~ 3 unimplemented, ignore this value. bit2 ~ 0 ctcss freq. accept : ctcss frequency accept variance. 3b001: 0.595% ~ 1.975% 3b010: 0.885% ~ 2.63% 3b011: 1.195% ~ 3.01% 3b100: 1.485% ~ 3.385% 3b101: 1.77% ~ 3.545% 3b110: 2.05% ~ 3.91% user audio tone_1/2 - 04d9h address bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 name use? -tone ??eq. C pa?amete?1 bit15 ~ 0 user tone generator frequency parameter1 refer to the application notes for detailed register setting.
rev. 1.10 96 ?e???a?? 1?? ?01? rev. 1.10 97 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu user audio tone_2/2 - 04dah address bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 name use? -tone ??eq. C pa?amete?? bit15 ~ 0 user tone generator frequency parameter2. refer to the application notes for detailed register setting. default:1khz. note: if it is necessary to defne the user-tone frequency by it self, registers 04d9 and 04da must be used at the same time. ctcss power threshold - 04dbh address bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 name ctcss powe ? th?eshold bit15 ~ 0 ctcss power threshold. this register is to set the minimum ctcss signal level that is to be detected. the default value is 0xff2b (28mv-peak@3.3v). when the received signal larger than threshold voltage, bit 3 in the i/o command register address 23 will be set to 1. otherwise the bit will be cleared to 0. refer to the application notes for detailed register setting. user dcs codes_1/2 - 04dch address bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 name use? dcs codes[15:0] bit15 ~ 0 user dcs parameter[15:0] : user defne dcs parameter bit15~bit0 refer to the application notes for detailed register setting. user dcs codes_2/2 - 04ddh address bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 name 0 use? dcs pa?amete?[??:16] bit15 ~ 7 0 : zero, must be cleared to zero. bit6 ~ 0 user dcs parameter[22:16] : user defned dcs parameter bit22-bit16. refer to the application notes for detailed register setting. note: if it is necessary to defne the dcs tone by it self, registers 04dc and 04dd must be used at the same time. if 4dc and 4de the bits set 1, output is 0, if the bits set 0, output is 1. sub-audio drop time - 04deh address bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 name d? op time imm?nit? bit15 ~ 0 drop time immunity : dcs/ctcss drop out time. the drop out time is the maximum allowed dcs/ctcss detection loss duration after the tx/rx is connected. the drop out time = drop time immunity/4 . the setting range is from 0 to 32767. default = b0000 0100 1011 0000 (300ms).
rev. 1.10 96 ?e???a?? 1?? ?01? rev. 1.10 97 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu mod amplitude limiter - 04dfh address bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 name 0 0 soft limite? bit15~14 0 : zero, must be fll b0. bit13 ~ 0 soft limiter : tx amplitude limiter threshold to vco. in tx mode, this limiter will constrain the mod output voltage levels. refer to the application notes for detailed register setting. selective_call_0-f address / bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 04e0 selective_call_0: pa?amete?1 04e1 selective_call_0: pa?amete?? 04e? selective_call_1: pa?amete?1 04e? selective_call_1: pa?amete?? 04e4 selective_call_?: pa?amete?1 04e5 selective_call_?: pa?amete?? 04e6 selective_call_?: pa?amete?1 04e7 selective_call_?: pa?amete?? 04e8 selective_call_4: pa?amete?1 04e9 selective_call_4: pa?amete?? 04ea selective_call_5: pa?amete?1 04eb selective_call_5: pa?amete?? 04ec selective_call_6: pa?amete?1 04ed selective_call_6: pa?amete?? 04ee selective_call_7: pa?amete?1 04e? selective_call_7: pa?amete?? 04?0 selective_call_8: pa?amete?1 04?1 selective_call_8: pa?amete?? 04?? selective_call_9: pa?amete?1 04?? selective_call_9: pa?amete?? 04?4 selective_call_a: pa?amete?1 04?5 selective_call_a: pa?amete?? 04?6 selective_call_b: pa?amete?1 04?7 selective_call_b: pa?amete?? 04?8 selective_call_c: pa?amete?1 04?9 selective_call_c: pa?amete?? 04? a selective_call_d: pa?amete?1 04?b selective_call_d: pa?amete?? 04?c selective_call_e: pa?amete?1 04?d selective_call_e: pa?amete?? 04?e selective_call_?: pa?amete?1 04?? selective_call_?: pa?amete??
rev. 1.10 98 ?e???a?? 1?? ?01? rev. 1.10 99 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu the address 04e0-04ff allows the user to defne parameter s for selective call tone s from tone 0 C tone f . the adjustment frequency range is 3.5khz~0.3khz. the device follows the eea protocol (refer to the accompanying table). every selective call tone set has 2 parts: parameter1 and parameter2, that put two registers in the audio processor. for details regarding register value setting s, refer to the application note s . tone number frequency (hz) (hex) eia eea ccir zvei 1 zvei 2 0 600 1981 1981 ?400 ?400 1 741 11 ?4 11 ?4 1060 1060 ? 88? 1197 1197 1160 1160 ? 10?? 1?75 1?75 1?70 1?70 4 1164 1?58 1?58 1400 1400 5 1?05 1446 1446 15?0 15?0 6 1446 1540 1540 1670 1670 7 1587 1640 1640 18?0 18?0 8 17?8 1747 1747 ?000 ?000 9 1869 1860 1860 ??00 ??00 a ?151 1055 ?400 ?800 885 b ?4?5 9?0 9?0 810 810 c ?010 ??47 ??47 970 740 d ??95 991 991 885 680 e 459 ? 110 ? 110 ?600 970 ? no tone ?400 1055 680 ?600 selective c all r eference s ets t able
rev. 1.10 98 ?e???a?? 1?? ?01? rev. 1.10 99 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu application circuits c9 0.1u f r2 r1 1k mi c c1 1uf c3 0.1u f c4 1uf c6 1uf vc c c1 0 0.1u f y1 32.768 k c1 3 10pf c1 4 10pf r5 10m c1 2 50nf r4 15k c1 5 100pf c7 4nf r3 10k audi o ou t s ub-tone out pc 5 41 pc 6 42 pc 7 43 pd 0 44 pd 1 45 vs s 46 mic_ o 47 mic_ i 48 de mo d 1 vag 2 vagre f 3 vcca 1 4 aux 5 pe 1 6 pe 0 7 sm od 8 m odo 9 audo 10 vcca 2 11 vssa 2 12 pb 0 13 pb 1 14 pb 2 15 pb 3 16 pd 2 17 pd 3 18 pb 4 19 pb 5 20 pllc 21 xi n 22 xout 23 vs s 24 vdd 25 pb 6 26 pb 7 27 pa 0 28 pa 1 29 pa 2 30 pa 3 31 pc 0 32 pc 1 33 pc 2 34 pc 3 35 pa 7 36 pa 6 37 pa 5 38 pa 4 39 pc 4 40 u1 HT98R068-1_48pi n c5 1uf aux input mo d out c2 1uf rf bl oc k spearker bl oc k rssi rssi c1 1 3nf l1 vc c l2 vcc1 vcc2 c8 0.1u f vcc1 vcc2
rev. 1.10 100 ?e???a?? 1?? ?01? rev. 1.10 101 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu instruction set introduction central to the successful operation of any microcontroller is its instruction set, which is a set of program instruction codes that directs the microcontroller to perform certain operations. in the case of holtek microcontrollers, a comprehensive and fexible set of over 60 instructions is provided to enable programmers to implement their application with the minimum of programming overheads. for easier understanding of the various instruction codes, they have been subdivided into several functional groupings. instruction timing most instructions are implemented within one instruction cycle. the exceptions to this are branch, call, or table read instructions where two instruction cycles are required. one instruction cycle is equal to 4 system clock cycles, therefore in the case of an 8mhz system oscillator, most instructions would be implemented within 0.5s and branch or call instructions would be implemented within 1s. although instructions which require one more cycle to implement are generally limited to the jmp, call, ret, reti and table read instructions, it is important to realize that any other instructions which involve manipulation of the program counter low register or pcl will also take one more cycle to implement. as instructions which change the contents of the pcl will imply a direct jump to that new address, one more cycle will be required. examples of such instructions would be clr pcl or mov pcl, a. for the case of skip instructions, it must be noted that if the result of the comparison involves a skip operation then this will also take one more cycle, if no skip is involved then only one cycle is required. moving and transferring data the transfer of data within the microcontroller program is one of the most frequently used operations. making use of three kinds of mov instructions, data can be transferred from registers to the accumulator and vice-versa as well as being able to move specifc immediate data directly into the accumulator. one of the most important data transfer applications is to receive data from the input ports and transfer data to the output ports. arithmetic operations the ability to perform certain arithmetic operations and data manipulation is a necessary feature of most microcontroller applications. within the holtek microcontroller instruction set are a range of add and subtract instruction mnemonics to enable the necessary arithmetic to be carried out. care must be taken to ensure correct handling of carry and borrow data when results exceed 255 for addition and less than 0 for subtraction. the increment and decrement instructions inc, inca, dec and deca provide a simple means of increasing or decreasing by a value of one of the values in the destination specifed.
rev. 1.10 100 ?e???a?? 1?? ?01? rev. 1.10 101 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu logical and rotate operations the standard logical operations such as and, or, xor and cpl all have their own instruction within the holtek microcontroller instruction set. as with the case of most instructions involving data manipulation, data must pass through the accumulator which may involve additional programming steps. in all logical data operations, the zero flag may be set if the result of the operation is zero. another form of logical data manipulation comes from the rotate instructions such as rr, rl, rrc and rlc which provide a simple means of rotating one bit right or left. different rotate instructions exist depending on program requirements. rotate instructions are useful for serial port programming applications where data can be rotated from an internal register into the carry bit from where it can be examined and the necessary serial bit set high or low. another application where rotate data operations are used is to implement multiplication and division calculations. branches and control transfer program branching takes the form of either jumps to specifed locations using the jmp instruction or to a subroutine using the call instruction. they differ in the sense that in the case of a subroutine call, the program must return to the instruction immediately when the subroutine has been carried out. this is done by placing a return instruction ret in the subroutine which will cause the program to jump back to the address right after the call instruction. in the case of a jmp instruction, the program simply jumps to the desired location. there is no requirement to jump back to the original jumping off point as in the case of the call instruction. one special and extremely useful set of branch instructions are the conditional branches. here a decision is first made regarding the condition of a certain data memory or individual bits. depending upon the conditions, the program will continue with the next instruction or skip over it and jump to the following instruction. these instructions are the key to decision making and branching within the program perhaps determined by the condition of certain input switches or by the condition of internal data bits. bit operations the ability to provide single bit operations on data memory is an extremely fexible feature of all holtek microcontrollers. this feature is especially useful for output port bit programming where individual bits or port pins can be directly set high or low us ing either the set [m].i or clr [m].i instructions respectively. the feature removes the need for programmers to frst read the 8-bit output port, manipulate the input data to ensure that other bits are not changed and then output the port with the correct new data. this read-modify-write process is taken care of automatically when these bit operation instructions are used. table read operations data storage is normally implemented by using registers. however, when working with large amounts of fxed data, the volume involved often makes it inconvenient to store the fxed data in the data memory. to overcome this problem, holtek microcontrollers allow an area of program memory to be setup as a table where data can be directly stored. a set of easy to use instructions provides the means by which this fixed data can be referenced and retrieved from the program memory. other operations in addition to the above functional instructions, a range of other instructions also exist such as the halt instruction for power-down operations and instructions to control the operation of the watchdog timer for reliable program operations under extreme electric or electromagnetic environments. for their relevant operations, refer to the functional related sections.
rev. 1.10 10? ?e???a?? 1?? ?01? rev. 1.10 10? ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu instruction set summary the following table depicts a summary of the instruction set categorised according to function and can be consulted as a basic instruction reference using the following listed conventions. table conventions: x: bits immediate data m: data memory address a: accumulator i: 0~7 number of bits addr: program memory address mnemonic description cycles flag affected arithmetic add a?[m] addm a?[m] add a?x adc a?[m] adcm a?[m] sub a?x sub a?[m] subm a?[m] sbc a?[m] sbcm a?[m] daa [m] add data memo?? to acc add acc to data memo ?? add immediate data to acc add data memo?? to acc with ca??? add acc to data memo ?? with ca??? s??t?act immediate data f? om the acc s??t?act data memo?? f? om acc s??t?act data memo?? f? om acc with ?es?lt in data memo?? s??t?act data memo?? f? om acc with ca??? s??t?act data memo?? f? om acc with ca ???? ?es?lt in data memo?? decimal adj? st acc fo? addition with ?es?lt in data memo?? 1 1 note 1 1 1 note 1 1 1 note 1 1 note 1 note z? c? ac? ov z? c? ac? ov z? c? ac? ov z? c? ac? ov z? c? ac? ov z? c? ac? ov z? c? ac? ov z? c? ac? ov z? c? ac? ov z? c? ac? ov c logic operation and a?[m] or a?[m] xor a?[m] andm a?[m] orm a?[m] xorm a?[m] and a?x or a?x xor a?x cpl [m] cpla [m] logical and data memo ?? to acc logical or data memo?? to acc logical xor data memo?? to acc logical and acc to data memo ?? logical or acc to data memo ?? logical xor acc to data memo ?? logical and immediate data to acc logical or immediate data to acc logical xor immediate data to acc complement data memo?? complement data memo?? with ?es? lt in acc 1 1 1 1 note 1note 1note 1 1 1 1note 1 z z z z z z z z z z z increment & decrement inca [m] inc [m] deca [m] dec [m] inc?ement data memo?? with ?es? lt in acc inc?ement data memo?? dec?ement data memo?? with ?es? lt in acc dec?ement data memo?? 1 1 note 1 1note z z z z rotate rra [m] rr [m] rrca [m] rrc [m] rla [m] rl [m] rlca [m] rlc [m] rotate data memo?? ?ight with ?es? lt in acc rotate data memo?? ?ight rotate data memo?? ?ight th?o?gh ca??? with ?es? lt in acc rotate data memo?? ?ight th?o?gh ca??? rotate data memo?? left with ?es? lt in acc rotate data memo?? left rotate data memo?? left th?o?gh ca??? with ?es? lt in acc rotate data memo?? left th?o?gh ca??? 1 1 note 1 1 note 1 1 note 1 1 note none none c c none none c c data move mov a ?[m] mov [m]?a mov a ?x move data memo?? to acc move acc to data memo ?? move immediate data to acc 1 1 note 1 none none none bit operation clr [m].i set [m].i clea? ?it of data memo?? set ?it of data memo?? 1 note 1 note none none
rev. 1.10 10? ?e???a?? 1?? ?01? rev. 1.10 10? ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu mnemonic description cycles flag affected branch jmp add ? sz [m] sza [m] sz [m].i snz [m].i siz [m] sdz [m] siza [m] sdza [m] call add ? ret ret a ?x reti j?mp ?nconditionall? skip if data memo?? is ze?o skip if data memo?? is ze? o with data movement to acc skip if ?it i of data memo?? is ze?o skip if ?it i of data memo?? is not ze?o skip if inc?ement data memo?? is ze?o skip if dec?ement data memo?? is ze?o skip if inc?ement data memo?? is ze?o with ?es? lt in acc skip if dec?ement data memo?? is ze?o with ?es? lt in acc s???o?tine call ret??n f?om s???o?tine ret??n f?om s???o? tine and load immediate data to acc ret??n f?om inte???pt ? 1 note 1 note 1 note 1 note 1 note 1 note 1 note 1 note ? ? ? ? none none none none none none none none none none none none none table read tabrdc [m] tabrdl [m] read ta?le (c??? ent page) to tblh and data memo?? read ta? le (last page) to tblh and data memo?? ? note ? note none none miscellaneous nop clr [m] set [m] clr wdt clr wdt1 clr wdt? swap [m] swapa [m] halt no ope?ation clea? data memo?? set data memo?? clea? watchdog time? p?e-clea? watchdog time? p?e-clea? watchdog time? swap ni??les of data memo?? swap ni??les of data memo?? with ?es? lt in acc ente? powe? down mode 1 1 note 1 note 1 1 1 1 note 1 1 none none none to ? pd? to ? pd? to ? pd? none none to ? pd? note: 1. for skip instructions, if the result of the comparison involves a skip then two cycles are required, if no skip takes place only one cycle is required. 2. any instruction which changes the contents of the pcl will also require 2 cycles for execution. 3. for the clr wdt1 and clr wdt2 instructions the to and pdf fags may be affected by the execution status. the to and pdf fags are cleared after both clr wdt1 and clr wdt2 instructions are consecutively executed. otherwise the to and pdf fags remain unchanged.
rev. 1.10 104 ?e???a?? 1?? ?01? rev. 1.10 105 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu instruction defnition adc a,[m] add data memory to acc with carry description the contents of the specifed data memory, accumulator and the carry fag are added. the result is stored in the accumulator. operation acc acc + [m] + c affected fag(s) ov, z, ac, c adcm a,[m] add acc to data memory with carry description the contents of the specifed data memory, accumulator and the carry fag are added. the result is stored in the specifed data memory. operation [m] acc + [m] + c affected fag(s) ov, z, ac, c add a,[m] add data memory to acc description the contents of the specifed data memory and the accumulator are added. the result is stored in the accumulator. operation acc acc + [m] affected fag(s) ov, z, ac, c add a,x add immediate data to acc description the contents of the accumulator and the specifed immediate data are added. the result is stored in the accumulator. operation acc acc + x affected fag(s) ov, z, ac, c addm a,[m] add acc to data memory description the contents of the specifed data memory and the accumulator are added. the result is stored in the specifed data memory. operation [m] acc + [m] affected fag(s) ov, z, ac, c and a,[m] logical and data memory to acc description data in the accumulator and the specifed data memory perform a bitwise logical and operation. the result is stored in the accumulator. operation acc acc and [m] affected fag(s) z and a,x logical and immediate data to acc description data in the accumulator and the specifed immediate data perform a bit wise logical and operation. the result is stored in the accumulator. operation acc acc and x affected fag(s) z
rev. 1.10 104 ?e???a?? 1?? ?01? rev. 1.10 105 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu andm a,[m] logical and acc to data memory description data in the specifed data memory and the accumulator perform a bitwise logical and operation. the result is stored in the data memory. operation [m] acc and [m] affected fag(s) z call addr subroutine call description unconditionally calls a subroutine at the specifed address. the program counter then increments by 1 to obtain the address of the next instruction which is then pushed onto the stack. the specifed address is then loaded and the program continues execution from this new address. as this instruction requires an additional operation, it is a two cycle instruction. operation stack program counter + 1 program counter addr affected fag(s) none clr [m] clear data memory description each bit of the specifed data memory is cleared to 0. operation [m] 00h affected fag(s) none clr [m].i clear bit of data memory description bit i of the specifed data memory is cleared to 0. operation [m].i 0 affected fag(s) none clr wdt clear watchdog timer description the to, pdf fags and the wdt are all cleared. operation wdt cleared to 0 pdf 0 affected fag(s) to, pdf clr wdt1 pre-clear watchdog timer description the to, pdf fags and the wdt are all cleared. note that this instruction works in conjunction with clr wdt2 and must be executed alternately with clr wdt2 to have effect. repetitively executing this instruction without alternately executing clr wdt2 will have no effect. operation wdt cleared to 0 pdf 0 affected fag(s) to, pdf
rev. 1.10 106 ?e???a?? 1?? ?01? rev. 1.10 107 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu clr wdt2 pre-clear watchdog timer description the to, pdf fags and the wdt are all cleared. note that this instruction works in conjunction with clr wdt1 and must be executed alternately with clr wdt1 to have effect. repetitively executing this instruction without alternately executing clr wdt1 will have no effect. operation wdt cleared to 0 pdf 0 affected fag(s) to, pdf cpl [m] complement data memory description each bit of the specifed data memory is logically complemented (1s complement). bits which previously contained a 1 are changed to 0 and vice versa. operation [m] [m] affected fag(s) z cpla [m] complement data memory with result in acc description each bit of the specifed data memory is logically complemented (1s complement). bits which previously contained a 1 are changed to 0 and vice versa. the complemented result is stored in the accumulator and the contents of the data memory remain unchanged. operation acc [m] affected fag(s) z daa [m] decimal-adjust acc for addition with result in data memory description convert the contents of the accumulator value to a bcd (binary coded decimal) value resulting from the previous addition of two bcd variables. if the low nibble is greater than 9 or if ac fag is set, then a value of 6 will be added to the low nibble. otherwise the low nibble remains unchanged. if the high nibble is greater than 9 or if the c fag is set, then a value of 6 will be added to the high nibble. essentially, the decimal conversion is performed by adding 00h, 06h, 60h or 66h depending on the accumulator and fag conditions. only the c fag may be affected by this instruction which indicates that if the original bcd sum is greater than 100, it allows multiple precision decimal addition. operation [m] acc + 00h or [m] acc + 06h or [m] acc + 60h or [m] acc + 66h affected fag(s) c dec [m] decrement data memory description data in the specifed data memory is decremented by 1. operation [m] [m] ? 1 affected fag(s) z deca [m] decrement data memory with result in acc description data in the specifed data memory is decremented by 1. the result is stored in the accumulator. the contents of the data memory remain unchanged. operation acc [m] ? 1 affected fag(s) z
rev. 1.10 106 ?e???a?? 1?? ?01? rev. 1.10 107 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu halt enter power down mode description this instruction stops the program execution and turns off the system clock. the contents of the data memory and registers are retained. the wdt and prescaler are cleared. the power down fag pdf is set and the wdt time-out fag to is cleared. operation to 0 pdf 1 affected fag(s) to, pdf inc [m] increment data memory description data in the specifed data memory is incremented by 1. operation [m] [m] + 1 affected fag(s) z inca [m] increment data memory with result in acc description data in the specifed data memory is incremented by 1. the result is stored in the accumulator. the contents of the data memory remain unchanged. operation acc [m] + 1 affected fag(s) z jmp addr jump unconditionally description the contents of the program counter are replaced with the specifed address. program execution then continues from this new address. as this requires the insertion of a dummy instruction while the new address is loaded, it is a two cycle instruction. operation program counter addr affected fag(s) none mov a,[m] move data memory to acc description the contents of the specifed data memory are copied to the accumulator. operation acc [m] affected fag(s) none mov a,x move immediate data to acc description the immediate data specifed is loaded into the accumulator. operation acc x affected fag(s) none mov [m],a move acc to data memory description the contents of the accumulator are copied to the specifed data memory. operation [m] acc affected fag(s) none
rev. 1.10 108 ?e???a?? 1?? ?01? rev. 1.10 109 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu nop no operation description no operation is performed. execution continues with the next instruction. operation no operation affected fag(s) none or a,[m] logical or data memory to acc description data in the accumulator and the specifed data memory perform a bitwise logical or operation. the result is stored in the accumulator. operation acc acc or [m] affected fag(s) z or a,x logical or immediate data to acc description data in the accumulator and the specifed immediate data perform a bitwise logical or operation. the result is stored in the accumulator. operation acc acc or x affected fag(s) z orm a,[m] logical or acc to data memory description data in the specifed data memory and the accumulator perform a bitwise logical or operation. the result is stored in the data memory. operation [m] acc or [m] affected fag(s) z ret return from subroutine description the program counter is restored from the stack. program execution continues at the restored address. operation program counter stack affected fag(s) none ret a,x return from subroutine and load immediate data to acc description the program counter is restored from the stack and the accumulator loaded with the specifed immediate data. program execution continues at the restored address. operation program counter stack acc x affected fag(s) none reti return from interrupt description the program counter is restored from the stack and the interrupts are re-enabled by setting the emi bit. emi is the master interrupt global enable bit. if an interrupt was pending when the reti instruction is executed, the pending interrupt routine will be processed before returning to the main program. operation program counter stack emi 1 affected fag(s) none
rev. 1.10 108 ?e???a?? 1?? ?01? rev. 1.10 109 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu rl [m] rotate data memory left description the contents of the specifed data memory are rotated left by 1 bit with bit 7 rotated into bit 0. operation [m].(i+1) [m].i; (i = 0~6) [m].0 [m].7 affected fag(s) none rla [m] rotate data memory left with result in acc description the contents of the specifed data memory are rotated left by 1 bit with bit 7 rotated into bit 0. the rotated result is stored in the accumulator and the contents of the data memory remain unchanged. operation acc.(i+1) [m].i; (i = 0~6) acc.0 [m].7 affected fag(s) none rlc [m] rotate data memory left through carry description the contents of the specifed data memory and the carry fag are rotated left by 1 bit. bit 7 replaces the carry bit and the original carry fag is rotated into bit 0. operation [m].(i+1) [m].i; (i = 0~6) [m].0 c c [m].7 affected fag(s) c rlca [m] rotate data memory left through carry with result in acc description data in the specifed data memory and the carry fag are rotated left by 1 bit. bit 7 replaces the carry bit and the original carry fag is rotated into the bit 0. the rotated result is stored in the accumulator and the contents of the data memory remain unchanged. operation acc.(i+1) [m].i; (i = 0~6) acc.0 c c [m].7 affected fag(s) c rr [m] rotate data memory right description the contents of the specifed data memory are rotated right by 1 bit with bit 0 rotated into bit 7. operation [m].i [m].(i+1); (i = 0~6) [m].7 [m].0 affected fag(s) none rra [m] rotate data memory right with result in acc description data in the specifed data memory and the carry fag are rotated right by 1 bit with bit 0 rotated into bit 7. the rotated result is stored in the accumulator and the contents of the data memory remain unchanged. operation acc.i [m].(i+1); (i = 0~6) acc.7 [m].0 affected fag(s) none
rev. 1.10 110 ?e???a?? 1?? ?01? rev. 1.10 111 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu rrc [m] rotate data memory right through carry description the contents of the specifed data memory and the carry fag are rotated right by 1 bit. bit 0 replaces the carry bit and the original carry fag is rotated into bit 7. operation [m].i [m].(i+1); (i = 0~6) [m].7 c c [m].0 affected fag(s) c rrca [m] rotate data memory right through carry with result in acc description data in the specifed data memory and the carry fag are rotated right by 1 bit. bit 0 replaces the carry bit and the original carry fag is rotated into bit 7. the rotated result is stored in the accumulator and the contents of the data memory remain unchanged. operation acc.i [m].(i+1); (i = 0~6) acc.7 c c [m].0 affected fag(s) c sbc a,[m] subtract data memory from acc with carry description the contents of the specifed data memory and the complement of the carry fag are subtracted from the accumulator. the result is stored in the accumulator. note that if the result of subtraction is negative, the c fag will be cleared to 0, otherwise if the result is positive or zero, the c fag will be set to 1. operation acc acc ? [m] ? c affected fag(s) ov, z, ac, c sbcm a,[m] subtract data memory from acc with carry and result in data memory description the contents of the specifed data memory and the complement of the carry fag are subtracted from the accumulator. the result is stored in the data memory. note that if the result of subtraction is negative, the c fag will be cleared to 0, otherwise if the result is positive or zero, the c fag will be set to 1. operation [m] acc ? [m] ? c affected fag(s) ov, z, ac, c sdz [m] skip if decrement data memory is 0 description the contents of the specifed data memory are frst decremented by 1. if the result is 0 the following instruction is skipped. as this requires the insertion of a dummy instruction while the next instruction is fetched, it is a two cycle instruction. if the result is not 0 the program proceeds with the following instruction. operation [m] [m] ? 1 skip if [m] = 0 affected fag(s) none
rev. 1.10 110 ?e???a?? 1?? ?01? rev. 1.10 111 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu sdza [m] skip if decrement data memory is zero with result in acc description the contents of the specifed data memory are frst decremented by 1. if the result is 0, the following instruction is skipped. the result is stored in the accumulator but the specifed data memory contents remain unchanged. as this requires the insertion of a dummy instruction while the next instruction is fetched, it is a two cycle instruction. if the result is not 0, the program proceeds with the following instruction. operation acc [m] ? 1 skip if acc = 0 affected fag(s) none set [m] set data memory description each bit of the specifed data memory is set to 1. operation [m] ffh affected fag(s) none set [m].i set bit of data memory description bit i of the specifed data memory is set to 1. operation [m].i 1 affected fag(s) none siz [m] skip if increment data memory is 0 description the contents of the specifed data memory are frst incremented by 1. if the result is 0, the following instruction is skipped. as this requires the insertion of a dummy instruction while the next instruction is fetched, it is a two cycle instruction. if the result is not 0 the program proceeds with the following instruction. operation [m] [m] + 1 skip if [m] = 0 affected fag(s) none siza [m] skip if increment data memory is zero with result in acc description the contents of the specifed data memory are frst incremented by 1. if the result is 0, the following instruction is skipped. the result is stored in the accumulator but the specifed data memory contents remain unchanged. as this requires the insertion of a dummy instruction while the next instruction is fetched, it is a two cycle instruction. if the result is not 0 the program proceeds with the following instruction. operation acc [m] + 1 skip if acc = 0 affected fag(s) none snz [m].i skip if bit i of data memory is not 0 description if bit i of the specifed data memory is not 0, the following instruction is skipped. as this requires the insertion of a dummy instruction while the next instruction is fetched, it is a two cycle instruction. if the result is 0 the program proceeds with the following instruction. operation skip if [m].i 0 affected fag(s) none
rev. 1.10 11 ? ?e???a?? 1?? ?01? rev. 1.10 11 ? ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu sub a,[m] subtract data memory from acc description the specifed data memory is subtracted from the contents of the accumulator. the result is stored in the accumulator. note that if the result of subtraction is negative, the c fag will be cleared to 0, otherwise if the result is positive or zero, the c fag will be set to 1. operation acc acc ? [m] affected fag(s) ov, z, ac, c subm a,[m] subtract data memory from acc with result in data memory description the specifed data memory is subtracted from the contents of the accumulator. the result is stored in the data memory. note that if the result of subtraction is negative, the c fag will be cleared to 0, otherwise if the result is positive or zero, the c fag will be set to 1. operation [m] acc ? [m] affected fag(s) ov, z, ac, c sub a,x subtract immediate data from acc description the immediate data specifed by the code is subtracted from the contents of the accumulator. the result is stored in the accumulator. note that if the result of subtraction is negative, the c fag will be cleared to 0, otherwise if the result is positive or zero, the c fag will be set to 1. operation acc acc ? x affected fag(s) ov, z, ac, c swap [m] swap nibbles of data memory description the low-order and high-order nibbles of the specifed data memory are interchanged. operation [m].3~[m].0 ? [m].7 ~ [m].4 affected fag(s) none swapa [m] swap nibbles of data memory with result in acc description the low-order and high-order nibbles of the specifed data memory are interchanged. the result is stored in the accumulator. the contents of the data memory remain unchanged. operation acc.3 ~ acc.0 [m].7 ~ [m].4 acc.7 ~ acc.4 [m].3 ~ [m].0 affected fag(s) none sz [m] skip if data memory is 0 description if the contents of the specifed data memory is 0, the following instruction is skipped. as this requires the insertion of a dummy instruction while the next instruction is fetched, it is a two cycle instruction. if the result is not 0 the program proceeds with the following instruction. operation skip if [m] = 0 affected fag(s) none
rev. 1.10 11 ? ?e???a?? 1?? ?01? rev. 1.10 11 ? ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu sza [m] skip if data memory is 0 with data movement to acc description the contents of the specifed data memory are copied to the accumulator. if the value is zero, the following instruction is skipped. as this requires the insertion of a dummy instruction while the next instruction is fetched, it is a two cycle instruction. if the result is not 0 the program proceeds with the following instruction. operation acc [m] skip if [m] = 0 affected fag(s) none sz [m].i skip if bit i of data memory is 0 description if bit i of the specifed data memory is 0, the following instruction is skipped. as this requires the insertion of a dummy instruction while the next instruction is fetched, it is a two cycle instruction. if the result is not 0, the program proceeds with the following instruction. operation skip if [m].i = 0 affected fag(s) none tabrdc [m] read table (current page) to tblh and data memory description the low byte of the program code (current page) addressed by the table pointer (tblp) is moved to the specifed data memory and the high byte moved to tblh. operation [m] program code (low byte) tblh program code (high byte) affected fag(s) none tabrdl [m] read table (last page) to tblh and data memory description the low byte of the program code (last page) addressed by the table pointer (tblp) is moved to the specifed data memory and the high byte moved to tblh. operation [m] program code (low byte) tblh program code (high byte) affected fag(s) none xor a,[m] logical xor data memory to acc description data in the accumulator and the specifed data memory perform a bitwise logical xor operation. the result is stored in the accumulator. operation acc acc xor [m] affected fag(s) z xorm a,[m] logical xor acc to data memory description data in the specifed data memory and the accumulator perform a bitwise logical xor operation. the result is stored in the data memory. operation [m] acc xor [m] affected fag(s) z xor a,x logical xor immediate data to acc description data in the accumulator and the specifed immediate data perform a bitwise logical xor operation. the result is stored in the accumulator. operation acc acc xor x affected fag(s) z
rev. 1.10 114 ?e???a?? 1?? ?01? rev. 1.10 115 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu package information note that the package information provided here is for consultation purposes only. as this information may be updated at regular intervals users are reminded to consult the holtek website (http://www.holtek.com.tw/english/literature/package.pdf) for the latest version of the package information. 48-pin lqfp (7mmx7mm) outline dimensions                    symbol dimensions in inch min. nom. max. a 0.?50 D 0.?58 b 0.?7? D 0.?80 c 0.?50 D 0.?58 d 0.?7? D 0.?80 e D 0.0?0 D ? D 0.008 D g 0.05? D 0.057 h D D 0.06? i D 0.004 D j 0.018 D 0.0?0 k 0.004 D 0.008 0 D 7 symbol dimensions in mm min. nom. max. a 8.90 D 9.10 b 6.90 D 7.10 c 8.90 D 9.10 d 6.90 D 7.10 e D 0.50 D ? D 0.?0 D g 1.?5 D 1.45 h D D 1.60 i D 0.10 D j 0.45 D 0.75 k 0.10 D 0.?0 0 D 7
rev. 1.10 114 ?e???a?? 1?? ?01? rev. 1.10 115 ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu 64-pin lqfp (7mmx7mm) outline dimensions                    symbol dimensions in inch min. nom. max. a 0.?50 D 0.?58 b 0.?7? D 0.?80 c 0.?50 D 0.?58 d 0.?7? D 0.?80 e D 0.016 D ? 0.005 D 0.009 g 0.05? D 0.057 h D D 0.06? i 0.00? D 0.006 j 0.018 D 0.0?0 k 0.004 D 0.008 0 D 7 symbol dimensions in mm min. nom. max. a 8.90 D 9.10 b 6.90 D 7.10 c 8.90 D 9.10 d 6.90 D 7.10 e D 0.40 D ? 0.1? D 0.?? g 1.?5 D 1.45 h D D 1.60 i 0.05 D 0.15 j 0.45 D 0.75 k 0.09 D 0.?0 0 D 7
rev. 1.10 116 ?e???a?? 1?? ?01? rev. 1.10 pb ?e???a?? 1?? ?01? HT98R068-1 two way radio 8-bit mcu HT98R068-1 two way radio 8-bit mcu holtek semiconductor inc. (headquarters) no.?? c?eation rd. ii? science pa?k? hsinch?? taiwan tel: 886- ?-56?-1999 ?ax: 886-?-56? -1189 http://www.holtek.com.tw holtek semiconductor inc. (taipei sales offce) 4?-?? no. ?-?? y ?anq? st.? nankang softwa?e pa?k? taipei 115? taiwan tel: 886- ?-?655-7070 ?ax: 886-?-?655-7?7? ?ax: 886-?-?655-7?8? (inte?national sales hotline) holtek semiconductor inc. (shenzhen sales offce) 5 ?? unit a? p?od?ctivit? b?ilding? no.5 gaoxin m ?nd road? nanshan dist?ict? shenzhen? china 518057 tel: 86-755-8616-9908 ? 86-755-8616-9?08 ?ax: 86-755-8616-97?? holtek semiconductor (usa), inc. (north america sales offce) 467?9 ??emont blvd.? ??emont? ca 945?8? usa tel: 1-510- ?5?-9880 ?ax: 1-510-?5?-9885 http://www.holtek.com cop??ight ? ?01? ?? holtek semiconductor inc. the info ? mation appea? ing in this data sheet is ? elieved to ?e acc?? ate at the time of p?? lication. howeve ?? holtek ass ? mes no ? esponsi ?ilit ? a? ising f ? om the ? se of the specifications desc? i? ed. the applications mentioned he?ein a?e ?sed solel? fo? the p??pose of ill?st? ation and holtek makes no wa??ant ? o? ?ep? esentation that s? ch applications will ?e s? ita? le witho? t f ?? the? modification? no? ? ecommends the ? se of its p?od? cts fo? application that ma? p? esent a ? isk to h? man life d? e to malf?nction o? othe?wise. holtek's p?od?cts a?e not a?tho?ized fo? ?se as c? itical components in life support devices or systems. holtek reserves the right to alter its products without prior notifcation. for the most ?p-to-date info?mation? please visit o?? we? site at http://www.holtek.com.tw.


▲Up To Search▲   

 
Price & Availability of HT98R068-1

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