cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 5, 3 & 1 MCU

HuEl_264296
New Contributor II

Hi,

I am trying to use DMA to transmit 10 bytes from the UART, but I am only seeing one byte.

Image4.png

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));
}
0 Likes
1 Solution
Len_CONSULTRON
Honored Contributor II

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.

pastedImage_0.png

Len

Len
"Engineering is an Art. The Art of Compromise."

View solution in original post

0 Likes
1 Reply