[an error occurred while processing this directive]
|
Не забыть разрешить прерывания от DMA в IER
и не забыть в прерываниях считывать соответствующие DMA_CSR для сбросов флагов.
;FEDCBA9876543210
mov #0000000000000000b,port(#SPCR1_1)
mov #0000001000000000b,port(#SPCR2_1)
mov #1Fa0h,port(#RCR1_1)
mov #1,port(#RCR2_1)
mov #1Fa0h,port(#XCR1_1)
mov #1,port(#XCR2_1)
mov #0117h,port(#SRGR1_1)
mov #33ffh,port(#SRGR2_1)
mov #0,port(#MCR1_1)
mov #0,port(#MCR2_1)
mov #0b00h,port(#PCR1)
; Program DMA ch #0 for BSP TX operation
;FEDCBA9876543210
mov #0001001101000110b, port(#DMA_CCR0)
mov #0000000000001000b, port(#DMA_CICR0)
mov #0000011100000110b, port(#DMA_CSDP0)
mov #(DXR2_1 << 1 ) & 0FFFFh, port(#DMA_CDSA_L0)
mov #(DXR2_1 >> 15) & 1 , port(#DMA_CDSA_U0)
mov #(bsp_dma_txbuf1 << 1 ) & 0FFFFh, port(#DMA_CSSA_L0)
mov #(bsp_dma_txbuf1 >> 15) & 1 , port(#DMA_CSSA_U0)
mov #256,port(#DMA_CEN0)
mov #1,port(#DMA_CFN0)
mov #0,port(#DMA_CEI0)
mov #0,port(#DMA_CFI0)
; Program DMA ch #1 for BSP RX operation
;FEDCBA9876543210
mov #0100001101000101b, port(#DMA_CCR1)
mov #0000000000001100b, port(#DMA_CICR1)
mov #1000001000001110b, port(#DMA_CSDP1)
mov #(bsp_dma_rxbuf1 << 1 ) & 0FFFFh, port(#DMA_CDSA_L1)
mov #(bsp_dma_rxbuf1 >> 15) & 1 , port(#DMA_CDSA_U1)
mov #(DRR2_1 << 1 ) & 0FFFFh, port(#DMA_CSSA_L1)
mov #(DRR2_1 >> 15) & 1 , port(#DMA_CSSA_U1)
mov #256,port(#DMA_CEN1)
mov #1,port(#DMA_CFN1)
mov #0,port(#DMA_CEI1)
mov #0,port(#DMA_CFI1)rpt #10
nop
mov #0c0h,port(#SPCR2_1)rpt #400 ; greater than two SRGR clocks
nopor #80h,port(#DMA_CCR0) ; enable DMA TX
or #80h,port(#DMA_CCR1) ; enable DMA RXmov #0c1h,port(#SPCR2_1) ; enable transmiter
mov #1,port(#SPCR1_1) ; enable receiverret
E-mail: info@telesys.ru