Rev. 1.20 30 January 23, 2015 Rev. 1.20 31 January 23, 2015
BS82B12A-3/BS82C16A-3/BS82D20A-3
Touch Key 8-Bit Flash MCU with LED/LCD Driver
BS82B12A-3/BS82C16A-3/BS82D20A-3
Touch Key 8-Bit Flash MCU with LED/LCD Driver
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 is referenced
mov tblp,a
mov a,07h ; initialise high table pointer
mov tbhp,a
:
:
tabrd tempreg1 ; transfers value in table referenced by table pointer,
;
data at program memory address "0706H" transferred to tempreg1 and TBLH
dec tblp ; reduce value of table pointer by one
tabrd tempreg2 ; transfers value in table referenced by table pointer,
; data at program memory address "F05H" transferred to tempreg2 and TBLH
; in this example the data "1AH" is transferred to tempreg1 and data "0FH" to
; register tempreg2
:
:
org 0700h ; sets initial address of program memory
dc 00Ah, 00Bh, 00Ch, 00Dh, 00Eh, 00Fh, 01Ah, 01Bh
:
:
In Circuit Programming – ICP
TheprovisionofFlashtypeProgramMemoryprovidestheuserwithameansofconvenientandeasy
upgradesandmodicationstotheirprogramsonthesamedevice.Asanadditionalconvenience,
Holtekhasprovidedameansofprogrammingthemicrocontrollerin-circuitusinga4-pininterface.
Thisprovidesmanufacturerswiththepossibilityofmanufacturingtheircircuitboardscompletewith
aprogrammedorun-programmedmicrocontroller,andthenprogrammingorupgradingtheprogram
atalaterstage.Thisenablesproductmanufacturerstoeasilykeeptheirmanufacturedproducts
suppliedwiththelatestprogramreleaseswithoutremovalandre-insertionofthedevice.
TheHoltekFlashMCUtoWriterProgrammingPincorrespondencetableisasfollows:
Holtek Write Pins MCU Programming Pins Function
ICPDA PA0
Serial data/address input/output
ICPCK PA2 Serial Clock input
VDD VDD Power Supply
VSS VSS Ground
TheProgramMemoryandEEPROMdatamemorycanbothbeprogrammedseriallyin-circuitusing
this4-wireinterface.Dataisdownloadedanduploadedseriallyonasinglepinwithanadditional
linefortheclock.Twoadditionallinesarerequiredforthepowersupply.Thetechnicaldetails
regardingthein-circuitprogrammingofthedevicearebeyondthescopeofthisdocumentandwill
besuppliedinsupplementaryliterature.
DuringtheprogrammingprocessthePA0andPA2I/Opinsfordataand clockprogramming
purposes.Theusermusttheretakecaretoensurethatnootheroutputsareconnectedtothesetwo
pins.