; .ObjReadOneSectorFromSDCard.SRC generated from: ....MP3播放器规范化MP3ReadOneSectorFromSDCard.c ; COMPILER INVOKED BY: ; C:KeilC51BINC51.EXE ....MP3播放器规范化MP3ReadOneSectorFromSDCard.c BROWSE DEBUG OBJECTEXTEND PRINT(.ObjReadOneSectorFromSDCard.lst) SRC(.ObjReadOneSectorFromSDCard.SRC)
SPI_CLK BIT P1.7 SPI_MOSI BIT P1.5 SPI_MISO BIT P1.6 ACC_7 BIT ACC.7 ACC_6 BIT ACC.6 ACC_5 BIT ACC.5 ACC_4 BIT ACC.4 ACC_3 BIT ACC.3 ACC_2 BIT ACC.2 ACC_1 BIT ACC.1 ACC_0 BIT ACC.0
NAME READONESECTORFROMSDCARD
?PR?Read_OneSector_From_SDCard_To_SRAM?READONESECTORFROMSDCARD SEGMENT CODE PUBLIC Read_OneSector_From_SDCard_To_SRAM ; void Read_OneSector_From_SDCard_To_SRAM(void)
RSEG ?PR?Read_OneSector_From_SDCard_To_SRAM?READONESECTORFROMSDCARD Read_OneSector_From_SDCard_To_SRAM: ; SOURCE LINE # 1 ; { ; SOURCE LINE # 2 ; ; ; } ; SOURCE LINE # 4
;Save Background ; PUSH B ; PUSH ACC
MOV R7,#02H SD_ReadData_Loop2:
;Initialize Loop Count Register MOV B,#080H ;Loop Connect is 128X4 = 512 Byte
;Loop Enter ReadOneByte_From_SDCard_LoopEnter_1: ;Loop Body
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Read The Fist Byte --1 SETB SPI_MOSI ;Read Byte Bit7 CLR SPI_CLK SETB SPI_CLK MOV C,SPI_MISO RLC A
;Read Byte Bit6 CLR SPI_CLK ;1 SETB SPI_CLK ;1 MOV C,SPI_MISO RLC A ;Read Byte Bit5 CLR SPI_CLK SETB SPI_CLK MOV C,SPI_MISO RLC A ;Read Byte Bit4 CLR SPI_CLK SETB SPI_CLK MOV C,SPI_MISO RLC A ;Read Byte Bit3 CLR SPI_CLK SETB SPI_CLK MOV C,SPI_MISO RLC A ;Read Byte Bit2 CLR SPI_CLK SETB SPI_CLK MOV C,SPI_MISO RLC A ;Read Byte Bit1 CLR SPI_CLK SETB SPI_CLK MOV C,SPI_MISO RLC A ;Read Byte Bit0 CLR SPI_CLK SETB SPI_CLK MOV C,SPI_MISO RLC A
MOVX @DPTR,A INC DPTR
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Read The Second Byte --2 ;Read Byte Bit7 CLR SPI_CLK SETB SPI_CLK MOV C,SPI_MISO RLC A
;Read Byte Bit6 CLR SPI_CLK ;1 SETB SPI_CLK ;1 MOV C,SPI_MISO RLC A ;Read Byte Bit5 CLR SPI_CLK SETB SPI_CLK MOV C,SPI_MISO RLC A ;Read Byte Bit4 CLR SPI_CLK SETB SPI_CLK MOV C,SPI_MISO RLC A ;Read Byte Bit3 CLR SPI_CLK SETB SPI_CLK MOV C,SPI_MISO RLC A ;Read Byte Bit2 CLR SPI_CLK SETB SPI_CLK MOV C,SPI_MISO RLC A ;Read Byte Bit1 CLR SPI_CLK SETB SPI_CLK MOV C,SPI_MISO RLC A ;Read Byte Bit0 CLR SPI_CLK SETB SPI_CLK MOV C,SPI_MISO RLC A
MOVX @DPTR,A INC DPTR ;loop untill The 512 Byte Read Complete DJNZ B,ReadOneByte_From_SDCard_LoopEnter_1 DJNZ R7,SD_ReadData_Loop2
;Restore Background ; POP ACC ; POP B
RET ; END OF Read_OneSector_From_SDCard_To_SRAM
END |