Hi,
我有一个问题与获得DMA被外部ADC触发。配置:< / p > < p > < / p > < p >------------------------- p > < p > Da14585 < / p > < p >外部ADC, SPI总线< / p > < p > DMA: 2频道,一个用于SPI tx一个用于SPI rx < / p > < p > < / p > < p > < / p > < p请求的功能 >----------------------- p > < p >每次样品准备好了,ADC集SPI_OUTPUT低,然后32位数据必须被转移。为此,我已将DMA配置为由外围设备触发。
问题
--------------------------
DMA开始触发,但在接收到第一个样本后,它不等待SPI_OUTPUT变低,然后再次请求数据。因此同样的样品会从ADC再次寄出。如果我把它编程为1024个样本,它会尽可能快地读取数据,等待下一个数据。因此DMA启动被正确触发,但我希望它与spi_output同步。
进一步信息:
ADC处于连续模式采样,采样频率为1024个采样/秒。因此,当我想要1024个样本时,我希望花费一秒钟。 However It goes much faster and issue is that dma just reads the same sample over and over again at full speed.
The current config is below, but I have also tried to have tx lengt = 1 and circular enabled.
DMA CONFIG
-------------------------
DMA_setup ti_ads1018_spidma_cnf[TI_ADS1018_DMA_TX+1] = { {//RX .channel_number = DMA_CHANNEL_0, .bus_width = DMA_BW_HALFWORD, .irq_enable = DMA_IRQ_STATE_ENABLED, .irq_nr_of_trans = 0, .dreq_mode = DMA_DREQ_TRIGGERED, .a_inc = DMA_AINC_FALSE, .b_inc = DMA_BINC_TRUE, .circular = DMA_MODE_NORMAL, .dma_prio = DMA_PRIO_7, .dma_idle = DMA_IDLE_BLOCKING_MODE, .dma_init = DMA_INIT_AX_BX_AY_BY, .dma_req_mux = DMA_TRIG_SPI_RXTX, .dma_sense = DMA_SENSE_LEVEL_SENSITIVE, .src_address = SPI_RX_TX_REG0, .dest_address = spi_data, .length = 1024, .callback = NULL, .user_data = NULL, }, {//TX .channel_number = DMA_CHANNEL_1, .bus_width = DMA_BW_HALFWORD, .irq_enable = DMA_IRQ_STATE_DISABLED, .irq_nr_of_trans = 0, .dreq_mode = DMA_DREQ_TRIGGERED, .a_inc = DMA_AINC_FALSE, .b_inc = DMA_BINC_FALSE, .circular = DMA_MODE_NORMAL, .dma_prio = DMA_PRIO_7, .dma_idle = DMA_IDLE_BLOCKING_MODE, .dma_init = DMA_INIT_AX_BX_AY_BY, .dma_req_mux = DMA_TRIG_SPI_RXTX, .dma_sense = DMA_SENSE_LEVEL_SENSITIVE, .src_address = NULL, .dest_address = SPI_RX_TX_REG0, .length = 1024, .callback = NULL, .user_data = NULL, } };