Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

dsPIC flow control with DMA

Status
Not open for further replies.

x3.exe

Member level 1
Joined
Sep 8, 2009
Messages
33
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
Bradford
Activity points
1,653
Hi everyone,

I need to implement data flow control between PIC33 microcontroller and FT232r chip. I am using DMA feature in order to transfer data from microcontrollers RAM to UART's transmitter buffer. I know that the standard way for doing it is by assigning two microcontroller's I/O pins as CTS and RTS and controlling the data flow by asserting and deasserting them in the subroutine that writes data to TX buffer, like in this example:

void _putch (char ch)
{
while (PORTBbits.RB12 == 1) ; // wait for RTS#
while (U1STAbits.TRMT == 0) ;
U1TXREG = ch;
while (IFS0bits.U1TXIF == 0) ;
IFS0bits.U1TXIF = 0;
}

But the thing is, when using DMA for data transfer to the buffer, it is impossible to control the data flow like that ( or at least I don't know how to do it ). Can anyone please help me with that?

And one more thing I wanted to find out, what is the difference between the two settings of UxMODE.UENbits:

1)UEN=10 - UxTX, UxRX, UxCTS and UxRTS pins are enabled and used.
2)UEN=00 - UxTX and UxRX pins are enabled and used; UxCTS and UxRTS/BCLK pins controlled by port latches.

For UEN=10, if CTS and RTS are not controlled by port latches, then how are they controlled? Is it done atomatically in hardware, without the need to control them in the code?

Looking forward to your replies, thanks in advance.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top