lpcware

Config SCTimer DMA 0 as DMA trigger input on LPC824

Discussion created by lpcware Employee on Jun 15, 2016
Content originally posted in LPCWare by fengyinb on Tue Dec 16 06:27:25 MST 2014
Hi Everybody,

Recently come up a project to use DMA move data from SCTimer capture register to SRAM. Since no direct sample code can be found to start from, I decided to use the periph_dma_uart/periph_acmp (Yes, it's periph_acmp, I want to make sure the DMA trigger input configuration is fully worked before turn to SCTimer).

What I have done to periph_dma_uart is:
1. Add relative ACMP initialization code into periph_dma_uart and enable ACMP
2. Change DMA channel config from  DMA_CFG_PERIPHREQEN to DMA_CFG_HWTRIGEN
Chip_DMA_SetupChannelConfig(LPC_DMA, DMAREQ_USART0_RX,(DMA_CFG_HWTRIGEN | DMA_CFG_TRIGBURST_SNGL | DMA_CFG_CHPRIORITY(3)));
3. Select ACMP_O as DMA trigger input source in input MUX
Chip_DMATRIGMUX_SetInputTrig(LPC_DMATRIGMUX, DMAREQ_USART0_RX, DMATRIG_ACMP_O);

The ACMP works find because I can see the green light turns on/off when I manually toggle ACMP positive input. Plus the dma_uart also works fine before I changing the trigger source/method.

I expect at every falling edge of ACMP_O the DMA will trigger one byte transfer from UART_RDATA register (it should be zero, I guess) to destination buffer, and after 8 bytes transfer done, UART will send the 8 bytes data to PC.

But it doesn't work. No more UART traffic after 5 initial string send. Looks like it's never triggered by ACMP_O. Any comments are welcome, thanks! 

Outcomes