• AVR Freaks

Hot!RN4871 not entering Command mode

Author
christodoulos
New Member
  • Total Posts : 3
  • Reward points : 0
  • Joined: 2019/01/10 04:48:48
  • Location: 0
  • Status: offline
2019/11/11 09:09:14 (permalink)
0

RN4871 not entering Command mode

Hello,
 
We have a problem with our RN4871.  I checked the forums and I see people have similar problems but didn't find any solution.
 
Our RN4871 is soldered on a PCB with its RX/TX connected to TX/RX of a processor.  We also included breakout pins for pin 2_0 and TX/RX.  Reading the datasheet, we should be able to send data over UART just by printing on Serial using the processor.  Indeed, we had tested this using a mikroE RN4871 board prior to designing our PCB, where we just connected RX/TX to our processor and streamed data to the phone.  Now, the phone finds the RN4871 but it doesn't connect to it.  The LED blinks though.
 
Then we tried entering Command mode by pulling pin 2_0 low.  We then send $$$ command over the terminal but nothing happens.  We removed any code on the processor as it caused it to stream over Serial because the RX/TX pins are directly connected to the breakout pins and to the processor pins.
 
We are not sure what else to try.  Baud rate is correct and the mikroE breakout works fine with our processor.  We followed the connection diagram (RST high through the RC, antenna extended out of the pcb etc.)  We can't even enter command mode and we are stuck.  Any ideas are appreciated.
 
Thank you
Chris
#1

4 Replies Related Threads

    horace
    Junior Member
    • Total Posts : 101
    • Reward points : 0
    • Joined: 2006/10/28 05:38:47
    • Location: Horning, Norwich, UK
    • Status: offline
    Re: RN4871 not entering Command mode 2019/11/11 13:31:21 (permalink)
    0
    a few thoughts
    1. do you have Tx and Rx the correct way around?  have you checked the signals with an oscilloscope?
    2. could you have enabled hardware flow control (off by default) or fast data mode?
    I had similar problems with a RN4678 PictialPlus board which has hardware flow control enabled by default. 
    Sometimes $$$ would not work and no data was displayed on Teraterm.  For initial evaluation found that grounding CTS fixed the problem.
    #2
    ric
    Super Member
    • Total Posts : 24593
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: RN4871 not entering Command mode 2019/11/11 18:21:52 (permalink)
    0
    Make sure you are NOT sending a CR/LF straight after the "$$$".
    Often you need a one second period of no serial activity before and after that string.
     
    I've observed that the XC8 puts() function always adds a newline character after the string, whereas cputs() does not. Whatever compiler you are using for this unnamed "processor" may do the same.
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #3
    christodoulos
    New Member
    • Total Posts : 3
    • Reward points : 0
    • Joined: 2019/01/10 04:48:48
    • Location: 0
    • Status: offline
    Re: RN4871 not entering Command mode 2019/11/12 02:29:44 (permalink)
    0
    EDIT 2:  OK everything is under control now!  We can stream data from our processor to the phone. 
     
    For future reference, as I said I am using CoolTerm.  To enter CMD mode, connect P2_0 to 3.3V (Still doesn't make sense to me), remove any CR/LF as ric said and send the $$$.  However, any subsequent command needs LF so we have to reenable LF before sending anything else.  We then set SS,40 for transparent UART which makes the module acts as a data pipe to the phone.  To stream data, disconnect P2_0 and don't connect it anywhere.  I believed it is internally pulled high but I am not sure now.  Lastly, there shouldn't be any program on the processor if using the TTL/terminal way to communicate with the module.
     
    In any case, thanks for the help guys! 
     
     
    EDIT:
    OK this is very very strange.  I connected P2_0 to 3.3V and now I can enter CMD mode by sending $$$ for some reason.  I believed P2_0 had to be low to enter command mode?  I need to explore this further as it doesn't make sense, unless I confused the terminology...
     
     
    horace
    a few thoughts
    1. do you have Tx and Rx the correct way around?  have you checked the signals with an oscilloscope?
    2. could you have enabled hardware flow control (off by default) or fast data mode?
    I had similar problems with a RN4678 PictialPlus board which has hardware flow control enabled by default. 
    Sometimes $$$ would not work and no data was displayed on Teraterm.  For initial evaluation found that grounding CTS fixed the problem.




    Thank you for the ideas.  RX/TX are correct, I double check by swapping them around and testing it with no success but haven't tried the oscilloscope. I will look into the hardware flow control or fast data mode but I doubt it as the modules were soldered on the PCB as received.  I will try manually grounding CTS and see, thank you.
     
    ric
    Make sure you are NOT sending a CR/LF straight after the "$$$".
    Often you need a one second period of no serial activity before and after that string.
     
    I've observed that the XC8 puts() function always adds a newline character after the string, whereas cputs() does not. Whatever compiler you are using for this unnamed "processor" may do the same.
     


    Thank you for the reply.  Our processor is STM32L496RET6 but it is not currently used to send any commands to the RN4871.  It is however connected to it, do you think that might affect it?  I am currently using a TTL cable and CoolTerm to communicate with the module.    CoolTerm did have CR+LF enabled, I disabled them but still no success.  I am starting to think that the fact the processor is connected to the module might affect but it shouldn't.
    post edited by christodoulos - 2019/11/12 04:19:17
    #4
    HeliMan
    Starting Member
    • Total Posts : 40
    • Reward points : 0
    • Joined: 2008/01/16 09:24:56
    • Location: 0
    • Status: offline
    Re: RN4871 not entering Command mode 2019/11/14 09:59:37 (permalink)
    0
    P2_0 has no bearing on whether or not you can enter command mode. This pin is used for firmware updating (pull it low before using the update tool).
    #5
    Jump to:
    © 2019 APG vNext Commercial Version 4.5