Rev. 2.50 38 June 22, 2017 Rev. 2.50 39 June 22, 2017
HT66F20/HT66F30/HT66F40/HT66F50/HT66F60
HT66FU30/HT66FU40/HT66FU50/HT66FU60
A/D Flash MCU with EEPROM
HT66F20/HT66F30/HT66F40/HT66F50/HT66F60
HT66FU30/HT66FU40/HT66FU50/HT66FU60
A/D Flash MCU with EEPROM
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
mova,offsetadres1 ;AccumulatorloadedwithrstRAMaddress
movmp0,a ;setupmemorypointerwithrstRAMaddress
loop:
clrIAR0 ;clearthedataataddressdenedbyMP0
inc mp0 ; increment memory pointer
sdz block ; check if last memory location has been cleared
jmp loop
continue:
Theimportantpointtonotehereisthatintheexampleshownabove,noreferenceismadetospecic
RAMaddresses.
Bank Pointer – BP
Dependinguponwhichdeviceisused,theProgramandDataMemoryaredividedintoseveral
banks.SelectingtherequiredProgramandDataMemoryareaisachievedusingtheBankPointer.
Bit5oftheBankPointerisusedtoselectProgramMemoryBank0or1,whilebits0~2areusedto
selectDataMemoryBanks0~4.
TheDataMemoryisinitialisedtoBank0afterareset,exceptforaWDTtime-outresetinthePower
DownMode,inwhichcase,theDataMemorybankremainsunaffected.Itshouldbenotedthatthe
SpecialFunctionDataMemoryisnotaffectedbythebankselection,whichmeansthattheSpecial
FunctionRegisterscanbeaccessedfromwithinanybank.DirectlyaddressingtheDataMemory
willalwaysresultinBank0beingaccessedirrespectiveofthevalueoftheBankPointer.Accessing
datafrombanksotherthanBank0mustbeimplementedusingIndirectaddressing.
AsboththeProgramMemoryandDataMemorysharethesameBankPointerRegister,caremustbe
takenduringprogramming.
Device
Bit
7 6 5 4 3 2 1 0
HT66F20
HT66F40
— — — — — — — DMBP0
HT66F30
HT66F50
— — — — — —
DMBP1 DMBP0
HT66F60 — — PMBP0 — — DMBP2
DMBP1 DMBP0
BP Register List