Quantcast
Channel: Cypress Semiconductor - PSoC 4 Architecture
Viewing all articles
Browse latest Browse all 796

PSOC4 HOW TO USE UART SEND DATA

$
0
0

PSOC4 HOW TO USE UART SEND DATA?

when i send data more than TX buffer size(8),there are some problem.Because my LED is abnormal .

I want to use uart send 12(frame) data,and receive 10(frame) data.

but External Interrupt must set tx/rx Buffers size  8 can be use.

when i to use uart send 8(frame) data,and receive 8(frame) data,there is no problem to use External Interrupt.And the UART IS OK.

So i thing clear TX buffer may be ok.

but it only send wrong data to PC.How to fix it?What is the difference between External Interrupt and Internal Interrupt?

MCU CY8C4125 as a master.when it send data,Slaver  MCU response.The following is my program.

CY_ISR(MY_UART_ISR);

void Init_UART(void)
{
    /* Start SCB (UART mode) operation */
    UART_1_Start();
    UART_1_SCB_IRQ_StartEx(MY_UART_ISR);
}

CY_ISR(MY_UART_ISR)
{
    if (UART_1_GetRxInterruptSourceMasked() & UART_1_INTR_RX_NOT_EMPTY)
    {
        Deal_UartRX();
    }
    UART_1_SpiUartClearRxBuffer();
    UART_1_ClearRxInterruptSource(UART_1_INTR_RX_NOT_EMPTY);

}

void Deal_UartTX(void)  //20ms once
{

…………

UART_1_SpiUartPutArray(&UartTXData[0], 8);

UART_1_SpiUartClearTxBuffer();

UART_1_SpiUartPutArray(&UartTXData[8], 4);

}

 

 


Viewing all articles
Browse latest Browse all 796

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>