Академический Документы
Профессиональный Документы
Культура Документы
Introduction
This application shows how to use the HT48R50A-1 to simulate the decoder function to decode the 3 Address bits and 0 Data bits of the HT6026.
9
Functional Description Decode 9 bits of information from the 3 Encoder HT48R50A-1 174
9
1 level used Subroutine 11 I/O lines PB0~PB7: input pins(I/O), non-pull high PC0: input pins(I/O), non-pull high PD4: output pin(I/O), pull high PA5: input pin(I/O), pull high 8MHz RC TMR INTERUPT, TMR Pin Set address pins CALL DECODER_INITIAL
Program Flowchart
ENTER IN TMR INT A N TIMEBEGIN CODE_IN_FLAG=0? Y SET CODE_IN_FLAG N STOPTIME RETURN TO MAIN BITCOUNTER=0? Y Clean up data SET TMR INTERNAL MODE BITCOUNTER=18 TIMEBEGIN N Clear T0F B Read 9-bit address Clear VT pin RETURN TO MAIN Match with receives ? RETURN TO MAIN Clear VT pin and VTBIT BITCOUNTER Decrease 1 Set DECODER_FLAG C
INITIAL TMR
Clear DECODER_CODE
CLEAR CODE_IN_FLAG
STOPTIMR WORDCNT=0? N SET TMR EXTERNAL MODE N MATCHBIT=0? Y N DECODERPIN=0 Y CLEAR C RETURN TO MAIN SET C WORDCNT=1? Y Set MATCHBIT C Clear ADD_RES1,ADD_RES0 Y C Clear DECODER_FLAG, and MATCHBIT
INITIAL TMR
SET VTBIT
RETURN TO MAIN
TIMEBEGIN
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 9+10.ASM and MAIN.ASM files to their project. The ASM text file includes DEFINE.ASM, INTERUPT.ASM, STDUC.ASM, MEMORY.ASM and MACRO.ASM files that should be added in the project.