UART with PIC receiving issue

9 posts / 0 new
Last post
aeris
Offline
Last seen:5 years 9 months ago
加入:2015-03-05 14:45
UART with PIC receiving issue

Hello, again :p

My PIC can't receive data from the PAN1740 USB dongle.
I try to dialog with dongle and USB UART : working
I try to dialog with PIC and USB UART : working
I plug PIC to dongle, all work with flow control but PIC don't receive...
The DSPS android app see flow control and can send data.

PIC have internal weak pull-up on RX and CTS.
图片使其reception, then put RTS up and wait for interrupt. I try to add a 1ms delay before setting RTS, change nothing.

I think DA14580 is more strict than FTDI chip, maybe I have a delay issue somewhere, but I dont know how...

Thanks.

Morgane Vallée

Keywords:
Device:
MT_dialog
Offline
Last seen:2 months 2 weeks ago
工作人员
加入:2015-06-08 11:34
Hi aeris

Hi aeris

Sorry aeris can you restate what you are trying to do ? You want to send data to your PIC but the PIC doesn't seem to receive the data?

Thanks MT_dialog

aeris
Offline
Last seen:5 years 9 months ago
加入:2015-03-05 14:45
Yes, I try to send data to my

Yes, I try to send data to my PIC with DSPS app and PAN1740 USB dongle.
DSPS app see flow control and can receive data.

MT_dialog
Offline
Last seen:2 months 2 weeks ago
工作人员
加入:2015-06-08 11:34
Hi aeris,

Hi aeris,

Can you tell me a bit more details about your setup because i can't follow.

Thanks MT_dialog

aeris
Offline
Last seen:5 years 9 months ago
加入:2015-03-05 14:45
I have a pad with my DSPS app

I have a pad with my DSPS app connected to a PAN1740 USB devboard.
The PAN1740 module is connect trough UART to a PIC16 with hardware flow control. The PIC have a software implement of flow control.
The DSPS app can receive data from the PIC trough BT with flow control.
I want to send data with the pad to my PIC but PIC receive nothing and flow control look working.
I try to connect my PIC to a FTDI USB UART for testing, and it work.
I try to connect the PAN1740 devboard to the FTDI UART and it work too.
And if I connect PAN1740 to PIC the PIC don't receive.

MT_dialog
Offline
Last seen:2 months 2 weeks ago
工作人员
加入:2015-06-08 11:34
Hi aeris,

Hi aeris,

You said that the da uses hardware flow control and the PIC uses software flow control.....what do you mean by software flow control, i assume that your code is driving GPIOs as RTS, CTS in order to signal the da for the uart transaction. Is that correct? If this is the case make sure that the da is awake before sending any actual data. You can do this by using the RTS signal in order to wake up the da. Once the da is ready will set the CTS high. Alternative you can awake the da without using RTS/CTS by having a wakeup dummy byte send over the TX line and in the da code define the RX uart line to awake the da. Once the da is awake it you should programm it to send an acknoledge sequence like ok or ready to the PIC, then you know that you can send the real data. Please note that the duration for awaking the da is about 3-4ms.

Thanks MT_dialog

aeris
Offline
Last seen:5 years 9 months ago
加入:2015-03-05 14:45
Your assume is right, I use

Your assume is right, I use GPIO of the PIC16 that don't have native flow control.

They are two main version of hardware flow control :
- the one you explain here, that's an old version
- the other case, every device put his RTS line down when it can receive, the over-one wait for this RTS (his CTS) go down to send
Are you sure the DA implementation is the case you explain ? because in my first test I use this and that don't work :-/

Edit : When you say "high" that mean logic 1 but voltage level 0, right ?
When I say "down" that mean voltage level 0.

My PIC go to sleep too, when it wake-up it put his RTS down, the DSPS app see this control, it receive a XON (flow control trough BT) and send his data, then say "write ok" but PIC don't see this data.

MT_dialog
Offline
Last seen:2 months 2 weeks ago
工作人员
加入:2015-06-08 11:34
Hi aeris,

Hi aeris,

Can you please check the voltage levels in PIC's GPIO's, on the DA (should be 0-3v) and on the FTDI which you verified it works and let us know ? It shouldn't be a logical error either on PIC or on the DA since they both work with the FTDI.

Thanks MT_dialog

aeris
Offline
Last seen:5 years 9 months ago
加入:2015-03-05 14:45
The PIC supply is 3.3V and

The PIC supply is 3.3V and the FTDI dongle I used 5V...