em78c156e+1621 shows assembly example
; XS1621 ,3.58,OUT 20001 /6/22
INDI EQU 0X0
RT CC EQU 0X1
PC EQU 0X2
STATUS EQU 0X3
FSR EQU 0X4
PORT5 EQU 0X5
PORT6 EQU 0X6
STACK_A EQU 0X10
STACK_S EQU 0X11
XS1 EQU 0X12
XS2 EQU 0X13
XS3 EQU 0X15
XS4 EQU 0X16
XS5 EQU 0X17
XS6 EQU 0X18
XS7 EQU 0X19
XS8 EQU 0X1A
JP1 EQU 0X1B
JP2 EQU 0X1C
JP3 EQU 0X1D
JP4 EQU 0X1E
XS9 EQU 0X20
XS10 EQU 0X21
ORG 0
JMP MAIN
ORG 8
MOV STACK_A,A
SWAP STACK_A
SWAPA STATUS
MOV STACK_S,A
CLR 0XF
SWAPA STACK_S
MOV STATUS,A
SWAPA STACK_A
RETI
BIAO:
ADD 0X2,A
RETL @0B11101110 ;0
RETL @0B01001000 ;1
RETL @0B10111010 ;2
RETL @0B11011010 ;3
RETL @0B01011100 ;4
RETL @0B11010110 ;5
RETL @0B11110110 ;6
RETL @0B01001010 ;7
RETL @0B11111110 ;8
RETL @0B01011110 ;9
RETL @0B00000000 ;A
XSZW:
MOV A,JP1
CALL BIAO
MOV XS3,A
MOV A,JP2
CALL BIAO
MOV XS4,A
MOV A,JP3
CALL BIAO
MOV XS5,A
MOV A,JP4
CALL BIAO
MOV XS6,A
MOV A,@7
MOV XS1,A
AWS:
RLC XS10
RLC XS9
RLC XS8
RLC XS7
JBS XS6,1
JMP ASD1
BS XS10,4
JMP ASG1
ASD1:
BC XS10,4
ASG1:
RRC XS6
RLC XS10
RLC XS9
RLC XS8
RLC XS7
JBS XS5,1
JMP ASD2
BS XS10,4
JMP ASG2
ASD2:
BC XS10,4
ASG2:
RRC XS5
RLC XS10
RLC XS9
RLC XS8
RLC XS7
JBS XS4,1
JMP ASD3
BS XS10,4
JMP ASG3
ASD3:
BC XS10,4
ASG3:
RRC XS4
RLC XS10
RLC XS9
RLC XS8
RLC XS7
JBS XS3,1
JMP ASD4
BS XS10,4
JMP ASG4
ASD4:
BC XS10,4
ASG4:
RRC XS3
DJZ XS1
JMP AWS
RET
YSA:
MOV A,@2
MOV XS3,A
LOP1:
NOP
DJZ XS3,A
JMP LOP1
RET
XSS: ;HT1621 XS 8-BITS COMMAND MODE
BS PORT5,1
BC PORT5,0 ;CS=0
CALL YSA
BC PORT5,1
CALL YSA
BS PORT5,1 ;DATA=1
BC PORT5,2
BC PORT5,1
CALL YSA
BS PORT5,1 ;DATA=0
BC PORT5,1
CALL YSA
BS PORT5,1 ;DATA=0
MOV A,@8
MOV XS1,A
XSC:
JBS XS2,7
JMP XSD
BS PORT5,2 ;DATA=1
JMP XSG
XSD:
BC PORT5,2 ;DATA=0
XSG:
BC PORT5,1
CALL YSA
BS PORT5,1
RLC XS2
DJZ XS1
JMP XSC
BC PORT5,1
CALL YSA
BS PORT5,1 ;DATA=?
BS PORT5,0 ;CS=1
RET
XSA: ;HT1621XS WRITE MODE
MOV A,@8
MOV XS1,A
WXC:
JBS XS2,7
JMP WXD
BS PORT5,2 ;DATA=1
JMP WXG
WXD:
BC PORT5,2 ;DATA=0
WXG:
BC PORT5,1
CALL YSA
BS PORT5,1
RLC XS2
DJZ XS1
JMP WXC
RET
MAIN:
MOV A,@0X0
IOW 0X0E
MOV A,@0B11000000
CONTW
CLR 0X0F
MOV A,@0X01
IOW 0X0F
ENI
MOV A,@0X10
MOV 0X4,A
LOPKN:
MOV A,@0
MOV 0X0,A
JBS 0X4,6
JMP KOL
JMP KIL
KOL:
NOP
INC 0X4
JMP LOPKN
KIL:
BS 0X4,6
MOV A,@0B11110000
IOW PORT5
CLR PORT5
MOV A,@0B11111111
IOW PORT6
CLR PORT6
NOP
MOV A,@0x0F
MOV PORT5,A
MOV A,@8
MOV JP1,A
MOV A,@8
MOV JP2,A
MOV A,@0
MOV JP3,A
MOV A,@9
MOV JP4,A
CALL XSZW
BC PORT5,0 ;CS=0
CALL YSA
BS PORT5,0 ;CS=1
CALL YSA
BC PORT5,0 ;CS=0
CALL YSA
BS PORT5,0 ;CS=1
CALL YSA
MOV A,@0B11100011 ;COMMAND NORAML MODE
MOV XS2,A
CALL XSS
MOV A,@0B00011000 ;SYSTEM RC 256K
MOV XS2,A
CALL XSS
MOV A,@0B00101001 ;BIAS 1/3 4 COMMONS
MOV XS2,A
CALL XSS
MOV A,@0B00000001 ;SYS EN
MOV XS2,A
CALL XSS
MOV A,@0B00001001 ;TONE ON
MOV XS2,A
CALL XSS
MOV A,@0B01000000 ;WRITE
MOV XS2,A
BC PORT5,0 ;CS=0
CALL YSA
BS PORT5,2
BC PORT5,1
CALL YSA
BS PORT5,1 ;DATA=1
CALL XSA
MOV A,XS7 ;1
MOV XS2,A
CALL XSA
MOV A,XS8 ;2
MOV XS2,A
CALL XSA
MOV A,XS9 ;3
MOV XS2,A
CALL XSA
MOV A,XS10 ;4
MOV XS2,A
CALL XSA
MOV A,@0XFF ;5
MOV XS2,A
CALL XSA
BS PORT5,0 ;CS=1
MOV A,@0B00000011 ;LCD ON
MOV XS2,A
CALL XSS
NOP
KK:
NOP
NOP
NOP
NOP
NOP
JMP KK
EOP
Previous article:Simulate 8(COM)*8(SEG) LCD driver on EM78Pxx
Next article:pt2262 source code written by EM78P156
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
- Brief Analysis of Automotive Ethernet Test Content and Test Methods
- How haptic technology can enhance driving safety
- Let’s talk about the “Three Musketeers” of radar in autonomous driving
- Why software-defined vehicles transform cars from tools into living spaces
- How Lucid is overtaking Tesla with smaller motors
- Wi-Fi 8 specification is on the way: 2.4/5/6GHz triple-band operation
- "Circuit Garden" by artist Kelly Heaton
- Newbie help, the light flashes five times, the buzzer sounds once, now it flashes and sounds
- An 80W power amplifier for LS band, equalizer adjustment
- Protel99 generates a network table where some components have no connections
- Common problems in debugging the TMS320C3x series?
- Regarding GaN devices, these issues should be paid attention to!
- TI C64X DSP interrupt vector table configuration (hardware interrupt)
- How to create a hit product of 49 yuan NB-IOT locator?
- Taking a “family-first” approach to op amp design
- Who knows the name of the chip?