- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I have a question on how to put the UART to sleep. My set up is an UART with the interrupt pin connected to the 'drq' of a DMA.
At the moment I have configured the UART to indicate the DMA to transmit data from the memory (RAM) to the UART's buffer once the UART has its buffer empty.
Now I want to put the UART to sleep, and what I have thought is using the DMA "nrq" interrupt and read the TX status register of the UART:
if(DMA_UART_flag == 1){
DMA_UART_flag = 0;
reg = UART_ReadTxStatus();
while((reg & UART_TX_STS_COMPLETE) != UART_TX_STS_COMPLETE){
reg = UART_ReadTxStatus();
}
UART_Sleep();
}
However, it remains in the loop... Any idea?
Thank you in advance!
- Labels:
-
PSoC 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try to post your complete code...it'll give a clear indication of what exactly is happening!!!
Also, do you want your UART to remain in sleep mode........how & when do you want it to come out of sleep mode?
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Furthermore you may post the complete project here, so we all can have a look at. To do so, use the "Create Workspace Bumdle" function of Creator 2.2 and upload the resulting .zip-file,
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Something need to ask.
1) How much Tx buffer size? Is it enough for DMA transfer?
2) Use UART_TX_STS_FIFO_EMPTY instead of UART_TX_STS_COMPLETE?
3) How about programming without DMA, before use DMA?
4) Would you mind of Build Setting / Compiler / Optimization,
highest size reduce setting is effective to communication program,
I don't know the reson but from my experience anyway.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Wave1 is DMA and 2 is UART.
It seems UART work once, sleep, wakeup, work again and sleep forever.
Maybe UART can't wakeup again.
Cheers ! Please think and do again yourself.
Can't help you, because my mom say.
Do not take away the fun of debugging, It's a sin.