Helpful ReplyHot!RN4020 - MLDP mode send just one char and hangs

Author
joab
Starting Member
  • Total Posts : 55
  • Reward points : 0
  • Joined: 2017/05/25 05:55:05
  • Location: 0
  • Status: offline
2017/07/17 02:53:30 (permalink)
0

RN4020 - MLDP mode send just one char and hangs

I set up two modules for MLDP mode.
Central has features 0x9010_0000 and Peripheral 0x3010_0000.
I can discover each other and connect to the Peripheral from the Central. So far so good.
I have the CMD pin left open so I connect with command "I", I get the response MLDP on the Central and nothing on the peripheral.
When I send a character (I'm working with USB to UART cables), I get the MLDP answer on the peripheral (that didn't come out after the 'I' - but that could be because of some buffer) followed by that character. But then nothing else can be sent, and both modules are (assume) in MLDP mode as they don't answer to commands.
Any ideas?
 
post edited by joab - 2017/07/17 03:30:56
#1
Sh@dow
Starting Member
  • Total Posts : 60
  • Reward points : 0
  • Joined: 2009/04/08 11:49:15
  • Location: 0
  • Status: offline
Re: RN4020 - MLDP mode send just one char and hangs 2017/07/17 05:25:36 (permalink)
0
try 90000800 and 30002000. I can send constntly from on to another. In one way.
#2
joab
Starting Member
  • Total Posts : 55
  • Reward points : 0
  • Joined: 2017/05/25 05:55:05
  • Location: 0
  • Status: offline
Re: RN4020 - MLDP mode send just one char and hangs 2017/07/17 05:45:53 (permalink)
0
Sh@dow
try 90000800 and 30002000. I can send constntly from on to another. In one way.

No... I tried both sending from the central and peripheral. Nothing. I did set them up as above, then:
- connected the central module through usb-uart
- scan, identify peer, stop
- connect (e,0, id)
The text 'Connected' came out, noticed it went into MLDP mode (no answer), but nothing sent appeared on the Peripheral's RX.
I'm using 115200 bps for both modules and console, that's alright I assume...
#3
Sh@dow
Starting Member
  • Total Posts : 60
  • Reward points : 0
  • Joined: 2009/04/08 11:49:15
  • Location: 0
  • Status: offline
Re: RN4020 - MLDP mode send just one char and hangs 2017/07/17 05:56:37 (permalink)
0
>>The text 'Connected' came out, noticed it went into MLDP mode
 
No. YOu should send I command. And MLDP responce must be. YOu have not enabled MLDP on conect.
#4
RISC
Super Member
  • Total Posts : 4635
  • Reward points : 0
  • Status: offline
Re: RN4020 - MLDP mode send just one char and hangs 2017/07/17 07:40:42 (permalink) ☄ Helpfulby joab 2017/07/18 05:06:44
4 (2)
Hi,
Did you implement flow control (RTS / CTS) ?
The RN4020 evaluation board shows that flow control pins are connected.
From my past experience, you'll have trouble without implementing it...
Regards
 
#5
joab
Starting Member
  • Total Posts : 55
  • Reward points : 0
  • Joined: 2017/05/25 05:55:05
  • Location: 0
  • Status: offline
Re: RN4020 - MLDP mode send just one char and hangs 2017/07/17 07:53:39 (permalink)
3 (1)
RISC
Did you implement flow control (RTS / CTS) ?

No, I haven't... I'm typing on a console with an USB-UART cable and sending 1-2 bytes/sec. if I must use flow control (4 wires plus all the sw overhead) even at that byte rate, I would really, honestly, sincerely, stop using Microchip for the rest of my professional life (and it's less ahead than behind) and keep that fact as a justification.
#6
joab
Starting Member
  • Total Posts : 55
  • Reward points : 0
  • Joined: 2017/05/25 05:55:05
  • Location: 0
  • Status: offline
Re: RN4020 - MLDP mode send just one char and hangs 2017/07/18 02:54:34 (permalink)
0
Done.... the trick for MLDP is (seems to be):

Enable UART Flow Control event and don't use it

So I set up the central module with SR,9200000 and the peripheral with 32000800 (for auto MLDP)
Then communicating through USB-Uart to the central module, scanned, connected, had the TX pin connected to RX on the peripheral module, and voila! all characters I typed in came back. I had no flow control.
 
#7
Sh@dow
Starting Member
  • Total Posts : 60
  • Reward points : 0
  • Joined: 2009/04/08 11:49:15
  • Location: 0
  • Status: offline
Re: RN4020 - MLDP mode send just one char and hangs 2017/07/18 03:17:50 (permalink)
0
Can you send data in both directions?
#8
joab
Starting Member
  • Total Posts : 55
  • Reward points : 0
  • Joined: 2017/05/25 05:55:05
  • Location: 0
  • Status: offline
Re: RN4020 - MLDP mode send just one char and hangs 2017/07/18 05:06:00 (permalink)
4 (1)
Sh@dow
Can you send data in both directions?

Yes, I just checked. Here is what I did:
- Module A (central) set up with SR,92000000
- Module B (peripheral) set up with SR,32000000
- Connect USB-Uart cable to module A (only RX/TX/GND)
- Scan and connect to module B
- Connect CMD pin in module B to 3V (they were floating, so pulled down) [this may not be necessary if set up for Auto MLDP with SR, 32000800]
- Send "I" to module A, returns "MLDP"
- Connect RX and TX on module B
- Send characters on the console, they appear back [to discard you have 'local echo' fooling you, break the RX-TX connection and try again]
- Tried sending a txt file (short). It comes back after the round wireless trip :-)
 
- I swapped the USB cable to module B (again, only RX, TX, GND)
- Connected RX and TX on module A
- Typed in the console and text appeared back
 
Note: I read somewhere that MLDP traffic is limited to 50 kbps, so I changed the baud rade to 38400 with "SB,3" in both modules. This could be related to the need of flow control. Flow control is to prevent filling the buffers. My assumption is by sending not faster than the RF link, no buffer is ever filled up and no flow control is needed. Those with free time, love for adventure, no girlfriends/ wives waiting and hairs in the head to pull off, are invited to try other speeds (56k, 112k). I had already enough excitement. Microchip is not what they used to be...
#9
Sh@dow
Starting Member
  • Total Posts : 60
  • Reward points : 0
  • Joined: 2009/04/08 11:49:15
  • Location: 0
  • Status: offline
Re: RN4020 - MLDP mode send just one char and hangs 2017/07/18 05:38:25 (permalink)
0
As I understood you are not using the PICTail RN4020 evaluation board?
You connect USB UART cable directly to RN4020 module?
#10
joab
Starting Member
  • Total Posts : 55
  • Reward points : 0
  • Joined: 2017/05/25 05:55:05
  • Location: 0
  • Status: offline
Re: RN4020 - MLDP mode send just one char and hangs 2017/07/18 05:41:49 (permalink)
0
Sh@dow
As I understood you are not using the PICTail RN4020 evaluation board?
You connect USB UART cable directly to RN4020 module?

No, I'm not, I'm using the BLE2 click from MikroE that is a simple breakout board, so it's effectively the same as using the module pins
#11
Sh@dow
Starting Member
  • Total Posts : 60
  • Reward points : 0
  • Joined: 2009/04/08 11:49:15
  • Location: 0
  • Status: offline
Re: RN4020 - MLDP mode send just one char and hangs 2017/07/18 06:24:56 (permalink)
0
OK. Thanks. I guess my problem is the USB-UART converter chip on PICTail baard. I will try to use custom board with USB to UART converter which guarantee to work tomorrow.
#12
joab
Starting Member
  • Total Posts : 55
  • Reward points : 0
  • Joined: 2017/05/25 05:55:05
  • Location: 0
  • Status: offline
Re: RN4020 - MLDP mode send just one char and hangs 2017/07/18 06:38:36 (permalink)
0
Sh@dow
OK. Thanks. I guess my problem is the USB-UART converter chip on PICTail baard. I will try to use custom board with USB to UART converter which guarantee to work tomorrow.

I have the application board with an MCU connected to the BLE. I erase the MCU to have the pins in high-z so I can plug my uart wires to it. You can do that as well.
#13
RISC
Super Member
  • Total Posts : 4635
  • Reward points : 0
  • Status: offline
Re: RN4020 - MLDP mode send just one char and hangs 2017/07/18 07:01:22 (permalink)
3 (1)
Hi
I have the application board with an MCU connected to the BLE. I erase the MCU to have the pins in high-z so I can plug my uart wires to it. You can do that as well.

 
When the RN-4020-PICTAIL is used connected to an external microcontroller you must be very careful (I had this issue one year ago...) : the on-board PIC18F25K50 MUST be put in reset permanently to ensure that the pins are in HiZ. This is done by putting a jumper on JP1 
Regards
post edited by RISC - 2017/07/18 07:06:36
#14
Sh@dow
Starting Member
  • Total Posts : 60
  • Reward points : 0
  • Joined: 2009/04/08 11:49:15
  • Location: 0
  • Status: offline
Re: RN4020 - MLDP mode send just one char and hangs 2017/07/20 04:51:13 (permalink)
3 (1)
I have managed to implement MLDP in both directions. I have enabled flow control but that did not helped.
I see that you are not using 0x00002000 (Server only feature). I have disabled it on device which is peripheral and MLDP started working. How this setting affects MLDP can't imagine.
Thanks for help joab.
 
RISC i have removed the chip completely :) from the PCB. I will solder it back later.
#15
joab
Starting Member
  • Total Posts : 55
  • Reward points : 0
  • Joined: 2017/05/25 05:55:05
  • Location: 0
  • Status: offline
Re: RN4020 - MLDP mode send just one char and hangs 2017/07/20 05:01:13 (permalink)
0
Sh@dow
I have managed to implement MLDP in both directions. I have enabled flow control but that did not helped.
I see that you are not using 0x00002000 (Server only feature). I have disabled it on device which is peripheral and MLDP started working. How this setting affects MLDP can't imagine.
Thanks for help joab.
RISC i have removed the chip completely :) from the PCB. I will solder it back later.

Does it mean Server services are incompatible with MLDP? Shared resources? Bug?
Oh, the soldering iron solution.... that's my extreme :-)
#16
Sh@dow
Starting Member
  • Total Posts : 60
  • Reward points : 0
  • Joined: 2009/04/08 11:49:15
  • Location: 0
  • Status: offline
Re: RN4020 - MLDP mode send just one char and hangs 2017/07/20 05:08:39 (permalink)
0
>>Does it mean Server services are incompatible with MLDP? Shared resources? Bug?
 
I don't know currently. Can you check that on your system? Enable ServerOnly on device peripheral device.
#17
Jump to:
© 2017 APG vNext Commercial Version 4.5