3
12
Decoder (10+2 - Corresponds to HT6010/HT6012)
1
3
12
Decoder (10+2 - Corresponds to
HT6010/HT6012)
D/N: HA0064E
Introduction
This application shows how to use the HT48R50A-1 to simulate the HT6032 3
12
decoder
function to decode the 10 Address bits and 2 Data bits for the HT6010/HT6012.
Function and Theory
The 3
12
Decoder function can decode the 10 Address bits and 2 Data bits each of which
can be set individually to either 1 and 0.
MCU: HT48R50A-1
Method: uses the HT6032 decoding process (see the HT6032 datasheet) to check the
corresponding signal width to judge if the signal is either a 0, 1 or floating. The
corresponding width can decode skewed signals, the tolerance of which can be adjusted
by MAXDURATION in the program.
Pin Function:
PB0~PB7: Address input pins
PC0~PC1: Address input pins
PD2~PD3: Data output pins
PA5: Serial data input pin
PD4: Valid transmission pin
3
12
Decoder (10+2 - Corresponds to HT6010/HT6012)
2
Software IP: 3
12
_10+2 Decoder Subroutine Usage Description Table
IP Name
(Label)
System Resources
Functional Description
Function
Decode 12 bits of information from the 3
12
Encoder
MCU HT48R50A-1
ROM 213
RAM 15
Bytes:
HI_COUNTLO_COUNT
HI_COUNT_SAVE
LO_COUNT_SAVEBITCOUNTER
DATARESADD_RES2
ADD_RES1ADD_RES0
WORDCNTVTCOUNT1
VTCOUNT0DECODER_CODE[2]
DECODER_CODE[1]
DECODER_CODE[0]
5 Bits: DECODER_ENDECODER_FLAG
DECODER_STATUSMATCHBIT
VTBIT
Stack 1
level
used
Subroutine/Macro Subroutine
I/O lines
14 I/O lines
PB0~PB7: input pins(I/O), non-pull high
PC0~PC1: input pins(I/O), non-pull high
PD2~PD4: output pin(I/O), pull high
PA5: input pin(I/O), pull high
f
SYS
8MHz
RC
Other MCU resources TMR INTERUPT
3
12
_10+2D
User interface
Set address pins
CALL DECODER_INITIAL
3
12
Decoder (10+2 - Corresponds to HT6010/HT6012)
4
Program Description
Refer to the ASM file that contains one main program code file for users to follow and add
their own programs. Users need to add the INCLUDE 10+2.ASM and MAIN.ASM files to
their project. The ASM text file include the DEFINE.ASM, INTERUPT.ASM, STDUC.ASM,
MEMORY.ASM and MACRO.ASM files that should be added in the project.