This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28388D: UART使用DMA,怎么设置中断

Part Number: TMS320F28388D
Other Parts Discussed in Thread: C2000WARE

例程中没看到相关发送完或接收完触发的DMA中断

  • 您可以看一下

    C2000Ware_3_04_00_00\driverlib\f2838x\examples\cm\uart 

    下的 uart_ex2_loopback_udma

    This example showcases how to use UDMA with UART to transfer and receive data

  • 我都说我看例程了,例程里面没有中断,实际应用不能像例程while一直等啊

    while(UDMA_isChannelEnabled(UDMA_BASE, UDMA_CHANNEL_UART0_TX));
    while(UDMA_isChannelEnabled(UDMA_BASE, UDMA_CHANNEL_UART0_RX));

  • 我都说我看例程了

    TI例程太多了,在提问时请详细说明使用、参考的例程名称

    关于中断参考下面的代码,该程序使用 DMA 向 TX 写入 100 个字节,使用 DMA 从 RX(不带 fifo)读取 100 个字节,并在接收到 100 个字节后调用中断服务程序。

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    //#############################################################################
    //
    // FILE: uart_ex2_loopback_udma.c
    //
    // TITLE: UART loopback example
    //
    //! \addtogroup driver_example_cm_list
    //! <h1>UART Loopback example with UDMA</h1>
    //!
    //! This example showcases how to use UDMA with UART to transfer and receive data
    //!
    //! This configures the UART in loopback mode and sends and receives data for
    //! infinite time.
    //! cm_common_config_c28x example needs to be run on C28x1 before running this
    //! example on the CM core
    //!
    //! \b Configuration:
    //! - Find correct COM port
    //! - Bits per second = 115200
    //! - Data Bits = 8
    //! - Parity = None
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • 不能增加发送中断吗,在接收使能下面加个发送中断使能就会一直在中断中,无法跳出。除了改这里还需要改哪里吗

    UART_enableInterrupt(UART0_BASE,UART_INT_DMARX);

    UART_enableInterrupt(UART0_BASE,UART_INT_DMATX);

  • 还有个问题是我实际传输2560个字节,但是程序目前最多可传255个,大于这个数传输错误,请问该如何更改程序