Rev. 1.50 32 August 28, 2017 Rev. 1.50 33 August 28, 2017
HT66F0175/HT66F0185
A/D Flash MCU with EEPROM
HT66F0175/HT66F0185
A/D Flash MCU with EEPROM
Special Function Register Description
MostoftheSpecialFunctionRegisterdetailswillbedescribedintherelevantfunctionalsection.
However,severalregistersrequireaseparatedescriptioninthissection.
Indirect Addressing Registers – IAR0, IAR1
TheIndirectAddressingRegisters,IAR0andIAR1,althoughhavingtheirlocationsinnormalRAM
registerspace,donotactuallyphysicallyexistasnormalregisters.Themethodofindirectaddressing
forRAMdatamanipulationusestheseIndirectAddressingRegistersandMemoryPointers,in
contrasttodirectmemoryaddressing,wheretheactualmemoryaddressisspecied.Actionsonthe
IAR0andIAR1registerswillresultinnoactualreadorwriteoperationtotheseregistersbutrather
tothememorylocationspeciedbytheircorrespondingMemoryPointers,MP0orMP1.Actingas
apair,IAR0andMP0cantogetheraccessdataonlyfromBank0whiletheIAR1registertogether
withMP1registerpaircanaccessdatafromanyDataMemorybank.AstheIndirectAddressing
Registersarenotphysicallyimplemented,readingtheIndirectAddressingRegistersindirectlywill
returnaresultof“00H”andwritingtotheregistersindirectlywillresultinnooperation.
Memory Pointers – MP0, MP1
TheMemoryPointers,knownasMP0andMP1,areprovided.TheseMemoryPointersare
physicallyimplementedintheDataMemoryandcanbemanipulatedinthesamewayasnormal
registersprovidingaconvenientwaywithwhichtoaddressandtrackdata.Whenanyoperationto
therelevantIndirectAddressingRegistersiscarriedout,theactualaddressthatthemicrocontroller
isdirectedtoistheaddressspeciedbytherelatedMemoryPointer.MP0,togetherwithIndirect
AddressingRegister,IAR0,areusedtoaccessdatafromBank0,whileMP1togetherwithIAR1are
usedtoaccessdatafromalldatabanksaccordingtothecorrespondingBPregister.
ThefollowingexampleshowshowtoclearasectionoffourDataMemorylocationsalreadydened
aslocationsadres1toadres4.
Indirect Addressing Program Example
data .section ‘data’
adres1 db ?
adres2 db ?
adres3 db ?
adres4 db ?
block db ?
code .section at 0 ‘code’
org 00h
start:
mov a,04h ; setup size of block
mov block,a
mov a,offset adres1 ; Accumulator loaded with rst RAM address
mov mp0,a ; setup memory pointer with rst RAM address
loop:
clr IAR0 ; clear the data at address dened by MP0
inc mp0 ; increment memory pointer
sdz block ; check if last memory location has been cleared
jmp loop
continue:
:
Theimportantpointtonotehereisthatintheexampleshownabove,noreferenceismadetospecic
RAMaddresses.