Electronics > Projects, Designs, and Technical Stuff

*Changed* dsPIC UART Rx not working

(1/3) > >>

I'm using the dsPIC30F2011 for a project which is an 18pin chip. One thing to note about the chip is that it doesn't have any RTS or CTS pins for the UART.

Long story short, I've got this chip in my project with the UARX and UATX pins connected to another micro, along with two other pins, and I need to communicate between the two. Sooooo, my question is: How do you do UART communication without handshaking (or faking it) with PIC micro's? I know its possible, but the datasheet isn't very clear on how to do it. Something about keeping the Rx line high until data is sent. Anyone have a clue?

i did it, with only Rx and Tx only, but not on the mentioned mcu. both line should be kept high (which is default to mcu with the feature), once get low, the receiving mcu will detect it as the beginning of comm, and start its phase locking sequence, iirc the term is. for uart, there will be always a start bit (low), for the locking do its stuff properly. and to note, both mcu must be set as the same bps setting manually by the programmer. you should see how the uart implementation/registers for your pic in the datasheet.

It's entirely dependent on your application, and what you're talking to. Your device may be fast enough that it can always take the data at full speed, so no need to handshake. You may have a protocol that has acknowledges to regulate the flow of data.
Serial handshaking is rarely used in embedded applications as the protocol will usually be designed to avoid the need for the extra pins- apart from general-purpose comms devices like modems & similar I don't think I've ever seen it used.

If you need handshaking, you could always use software handshake. ie become responsive to XON/XOFF characters embedded in the received data stream.

You could also send an XOFF if you need time to handle a batch of received data....

Yes it requires more work, but as already stated, it all depends upon the actual usage.
If only low speed (say < 2400) you probably won't need handshaking.

Thanks for the replys. I now realize that I just experienced a retard moment.

I don't really "need" handshaking for my application. The UART is operating at a low enough speed that it should be just fine without the RTS/CTS lines. I just assumed that I needed it given the way the registers are setup for the UART. Just about all the other higher pin count 16-bit PICs give you the option of handshaking in the SFR setup for the UART, but this series of dsPICs does not, so I assumed it had it by default as I thought the higher pin micros in this series had CTS/RTS pins. I don't know why, I just did. But now that I look at the entire series of dsPICs I am using, I now realize that none of them have CTS or RTS pins, so obviously there would be no option for this in the configuration register.

Well, that was a waste of a couple hours. I'm off to bed.  :(


[0] Message Index

[#] Next page

There was an error while thanking
Go to full version