Attachments are accessible only for community members.
May 21, 2019
04:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May 21, 2019
04:46 AM
Hi,
I am trying to use DMA to transmit 10 bytes from the UART, but I am only seeing one byte.
As far as I can see, I am setting the transferCount to 10, so I should see 10 bytes.
What am I doing wrong?
Please find attached my project. Any help appreciated.
const unsigned char packet_num_bytes = 10;
unsigned char packet_out_buffer[256];
unsigned char packet_in_buffer[256];
void Configure_DMA()
{
CyDmaTdSetConfiguration( tx_td, // Set up the Transaction Descriptor for 32-bit reads
packet_num_bytes, // Length of transfer
CY_DMA_DISABLE_TD, // Works
TD_INC_SRC_ADR);
CyDmaTdSetAddress( tx_td,
LO16((uint32) packet_out_buffer),
LO16((uint32) UART_TXDATA_PTR));
CyDmaTdSetConfiguration( rx_td,
packet_num_bytes, // DMA both the address and the data packet
CY_DMA_DISABLE_TD,
TD_INC_DST_ADR | DMA_RX__TD_TERMOUT_EN);
CyDmaTdSetAddress( rx_td,
LO16((uint32) UART_RXDATA_PTR),
LO16((uint32) packet_in_buffer));
}
Solved! Go to Solution.
Labels
1 Solution
May 21, 2019
05:32 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May 21, 2019
05:32 AM
Hi,
Your code is missing one thing. DMA_TX is set to derived. However, the tx_interrupt used (FIFO_Not_Full) needs the DMA_TX set to LEVEL.
Once I set it to LEVEL, 10 bytes transmitted every 1 msec.
Len
Len
"Engineering is an Art. The Art of Compromise."
"Engineering is an Art. The Art of Compromise."
1 Reply
May 21, 2019
05:32 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May 21, 2019
05:32 AM
Hi,
Your code is missing one thing. DMA_TX is set to derived. However, the tx_interrupt used (FIFO_Not_Full) needs the DMA_TX set to LEVEL.
Once I set it to LEVEL, 10 bytes transmitted every 1 msec.
Len
Len
"Engineering is an Art. The Art of Compromise."
"Engineering is an Art. The Art of Compromise."