MCP41010: ;SET VOLUME
;P1.1=CS2 ;NO-USE
;P1.6=CS1
;P1.7=SI
;P5.4=SCK
;CMD=XXCCXXPP CC=CONTROL=01=WRITE PP=01=WRITE TO 0-VR
CLR P1.6 ;LOW ALLOW TO CLOCK IN DATA
NOP
CLR P5.4
MOV A, #00010001B ;CMD WRITE
LCALL MCPIN
MOV A, 31H
MOV B, #2
MUL AB
;LCALL SENTONEBYTE1
LCALL MCPIN
NOP
SETB P1.6 ;HIGH CS
NOP
RET
MCPIN:
MOV R6, #8
MCPIN1:
RLC A ;CLOCK IN
JC SI_H
CLR P1.7
JMP SI_L
SI_H:
SETB P1.7
SI_L:
NOP
SETB P5.4 ;RISE UP TO CLOCK DATA IN
NOP
CLR P5.4
DJNZ R6,MCPIN1
RET
|