ChipFind - документация

Электронный компонент: HA0064E

Скачать:  PDF   ZIP
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)
3
Program Flowchart
INITIAL
VTCOUNT1=0?
VTCOUNT0=0?
Clear VT pin
Clear VTBIT
VTCOUNT1=E3H
VTCOUNT0
Decrease 1
VTCOUNT1
Decrease 1
DECODERPIN=0
DECODER_STATUS=0
LO_COUNT Increase 1
Z=1?
Return to Main
LO_COUNT
Decrease 1
Clear DECODER_STATUS
Move LO_COUNT to
LO_COUNT_SAVE
Clear LO_COUNT
HI_COUNT_SAVE<
MAXDURATION?
Return to Main
DECODER_STATUS=1?
HI_COUNT Increase 1
Z=1?
Return to Main
LO_COUNT
Decrease 1
Set DECODER_STATUS
Move HI_COUNT to
HI_COUNT_SAVE
LO_COUNT_SAVE<
MAXDURATION?
HI_COUNT_SAVE
>LO_COUNT_SAVE
Clear C
Set C
RRC
DECODER_CODE[1]
RRC
DECODER_CODE[0]
BITCOUNTER
Decrease 1
BITCOUNTER=0?
Return to Main
WORDCNT=3?
Move
DECODER_CODE[1]
to DATARES
WORDCNT
Decrease 1
A
BITCOUNTER=12
Clear
DECODER_CODE[0],DE
CODER_CODE[1]
N
Y
B
B
A
Read 10-bit address
Match with
receives '?
WORDCNT=0?
MATCHBIT=0?
WORDCNT=1?
Set MATCHBIT
Return to Main
Output data to data
pins
VTCOUNT1=E3H
VTCOUNT0=06H
Set VT
and VTBIT
Return to Main
Clear
DECODER_FLAG,
MATCHBIT
Clear LO_COUNT_SAVE
and HI_COUNT_SAVE
Return to Main
Y
N
N
Y
Y
N
Y
N
Y
N
Y
N
Y
N
Y
N
Y
N
Y
N
Y
N
N
Y
Y
N
Y
N
Y
N
RRC
DECODER_CODE[2]
Set
DECODER_FLAG
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.