Jan 03, 2014
01:11 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 03, 2014
01:11 PM
I want to transfer the data from Memory to UART using the DMA. (XMC4500 RELAX KIT)
Is it possible to transfer two UARTs with DMA at the same time?
DMA003_Handle0 transfers them first 256 Bytes, and stops DMA003_Handle1.
my code:
UART001_Handle0 -> 115200 bps
UART001_Handle1 -> 1200 bps
size = 256
DMA_UART_TRANSFER(DMA003_Handle0, (uint32_t)&source_buffer, UART001_Handle0, size);
DMA_UART_TRANSFER(DMA003_Handle1, (uint32_t)&source_buffer, UART001_Handle1, size);
uint32_t DMA_UART_TRANSFER(DMA003_ChannelHandleType DMAH, uint32_t SRC, UART001_HandleType UART, uint32_t LEN)
{
uint8_t MappedSRno;
status_t status = DAVEApp_SUCCESS; // Declaration of return variable for DAVE3 APIs
DMAH.ChConfig.SrcAddress = (uint32_t)SRC;
DMAH.ChConfig.DstAddress = (uint32_t)&UART.UartRegs->IN[0]; // (&destination_buffer);
DMAH.ChConfig.BlockSize = LEN;
status = DMA003_SetChannelTransferParams(&DMAH,&DMAH.ChConfig);
if ( status != DAVEApp_SUCCESS)
return status;
status = DMA003_StartTransfer(&DMAH);
if (status != DAVEApp_SUCCESS)
return status;
MappedSRno = (((uint32_t)UART.UartRegs->TBCTR & USIC_CH_TBCTR_STBINP_Msk) >> USIC_CH_TBCTR_STBINP_Pos);
UART.UartRegs->FMR |= ((uint32_t)(0x01U << (USIC_CH_FMR_SIO0_Pos + MappedSRno)));
return status;
}
Is it possible to transfer two UARTs with DMA at the same time?
DMA003_Handle0 transfers them first 256 Bytes, and stops DMA003_Handle1.
my code:
UART001_Handle0 -> 115200 bps
UART001_Handle1 -> 1200 bps
size = 256
DMA_UART_TRANSFER(DMA003_Handle0, (uint32_t)&source_buffer, UART001_Handle0, size);
DMA_UART_TRANSFER(DMA003_Handle1, (uint32_t)&source_buffer, UART001_Handle1, size);
uint32_t DMA_UART_TRANSFER(DMA003_ChannelHandleType DMAH, uint32_t SRC, UART001_HandleType UART, uint32_t LEN)
{
uint8_t MappedSRno;
status_t status = DAVEApp_SUCCESS; // Declaration of return variable for DAVE3 APIs
DMAH.ChConfig.SrcAddress = (uint32_t)SRC;
DMAH.ChConfig.DstAddress = (uint32_t)&UART.UartRegs->IN[0]; // (&destination_buffer);
DMAH.ChConfig.BlockSize = LEN;
status = DMA003_SetChannelTransferParams(&DMAH,&DMAH.ChConfig);
if ( status != DAVEApp_SUCCESS)
return status;
status = DMA003_StartTransfer(&DMAH);
if (status != DAVEApp_SUCCESS)
return status;
MappedSRno = (((uint32_t)UART.UartRegs->TBCTR & USIC_CH_TBCTR_STBINP_Msk) >> USIC_CH_TBCTR_STBINP_Pos);
UART.UartRegs->FMR |= ((uint32_t)(0x01U << (USIC_CH_FMR_SIO0_Pos + MappedSRno)));
return status;
}
- Tags:
- IFX
3 Replies
Jan 07, 2014
09:00 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 07, 2014
09:00 AM
please i need to know if is possible to use this configuration, any response from anyone?
thanks in advance!
pd: sorry for my english
thanks in advance!
pd: sorry for my english
Jan 07, 2014
02:22 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 07, 2014
02:22 PM
already solved, thanks
Jan 08, 2014
01:40 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 08, 2014
01:40 AM
Hi edgardocerone,
can you describe your solution? or upload your example?
Thanks
can you describe your solution? or upload your example?
Thanks