[an error occurred while processing this directive]
|
все три MCBSP в SPI-мастеры
init_spi:
and #~1, port(#SPCR1_0) ; RRST=0
and #~(1+40h+80h), port(#SPCR2_0) ; XRST=0, GRST=0, frst=0
and #~1, port(#SPCR1_1) ; RRST=0
and #~(1+40h+80h), port(#SPCR2_1) ; XRST=0, GRST=0, frst=0
and #~1, port(#SPCR1_2) ; RRST=0
and #~(1+40h+80h), port(#SPCR2_2) ; XRST=0, GRST=0, frst=0
rpt #10
nop
mov #1800h,port(#SPCR1_0)
mov #0,port(#SPCR2_0)
mov #0b09h,port(#PCR0) ; 0b09
mov #0h,port(#RCR1_0)
mov #1,port(#RCR2_0) ;
mov #0h,port(#XCR1_0)
mov #1,port(#XCR2_0) ;
mov #0047h,port(#SRGR1_0) ; 00FF
mov #2000h,port(#SRGR2_0)
mov #0,port(#MCR1_0)
mov #0,port(#MCR2_0)
or #040h,port(#SPCR2_0) ; enable SR generator
mov #1800h,port(#SPCR1_1)
mov #0,port(#SPCR2_1)
mov #0b09h,port(#PCR1) ; 0b09
mov #0h,port(#RCR1_1)
mov #1,port(#RCR2_1) ;
mov #0h,port(#XCR1_1)
mov #1,port(#XCR2_1) ;
mov #00ffh,port(#SRGR1_1) ; 00FF
mov #2000h,port(#SRGR2_1)
mov #0,port(#MCR1_1)
mov #0,port(#MCR2_1)
or #040h,port(#SPCR2_1) ; enable SR generator
mov #1800h,port(#SPCR1_2)
mov #0,port(#SPCR2_2)
mov #0b09h,port(#PCR2) ; 0b09
mov #0h,port(#RCR1_2)
mov #1,port(#RCR2_2) ;
mov #0h,port(#XCR1_2)
mov #1,port(#XCR2_2) ;
mov #0047h,port(#SRGR1_2) ; 00FF
mov #2000h,port(#SRGR2_2)
mov #0,port(#MCR1_2)
mov #0,port(#MCR2_2)
or #040h,port(#SPCR2_2) ; enable SR generator
rpt #400h
nop ; wait for >=2 SR periodsor #1,port(#SPCR2_0)
or #1,port(#SPCR1_0)
or #1,port(#SPCR2_1)
or #1,port(#SPCR1_1)
or #1,port(#SPCR2_2)
or #1,port(#SPCR1_2)ret
E-mail: info@telesys.ru