AnsweredAssumed Answered

How to program the Meshbee, or any JN516x based zigbee

Question asked by Colin MacKenzie on Apr 27, 2018

I've searched the Internets high and low and I couldn't find clear info on how to make the programmer for the JN516x based boards, in particular the Meshbee. Using my scope and a lot of trial and error I finally did get it so I thought I would share my notes here.

 

  • Programmer communicates on UART0 which is not part of the Xbee breakout I had, so you need an actual UartsBee v5, or use a FTDI cable and make your own by wiring GND, RX0, TX0, CBUS2, and CBUS3. The default UART1 channel didnt respond for me like some others suggested.
  • Meshbee /RST is connected to FT232RL CBUS2 aka C2 (pin 13)
    • This line will go low for 200ms
  • Meshbee SPIMISO is connected to FT232RL CBUS3 aka C3 (pin 14)
    • This line will go low for 400ms on reset, with the leading edges of RST and SPIMISO coinciding
  • I would also suggest adding pull-up resistors to RST and SPIMISO line. It seemed to work without them but voltages were weak.
  • Wire RX0, TX0 on Meshbee to TX0 and RX0, respectively, on FT232 breakout. (RX/TX crossed)
  • My FT232 breakout powers the Meshbee, so I connected 5V on FT232 to 5V on the Meshbee.
    • WARNING! I connected 5v to Meshbee's voltage regulator, not directly to JN516x! JN516x is 3.3v only so make sure you don't connect 5v to any pin on that chip or to the 3.3v rail on the Meshbee.
  • Must use the FTDI Uart Configuration Tool (FT_Prog) to set the C2 and C3 pins to IO pins
    • Run FT_Prog
    • Hit Magnifying glass to detect FT devices (or Devices | Scan and Parse)
    • Expand FT EEPROM | Hardware Specific | IO Controls
    • Set C2 and C3 properties to I/O MODE
      • By default they are set to C2=TXDEN, C3=PWREN#
    • Hit Lightning icon on toolbar (or Devices | Program) to store config to the FT device
  • You're all set! If it doesnt work, ensure the TX/RX lines are crossed properly.

Flash Programmer

To test your programmer load the NXP prrogrammer and select the COM port for the FT232 breakout. The "Connect" chechkbox should be checked. The programmer should populate the Device area information below. For example, mine says:

   Device: JN5168, BL 0x00080006

 

Also the MAC Address at the bottom should be non-zero. If you dont get this result then your programmer cable isn't working yet. You can fiddle and check the steps above and hit Refresh on the MAC to retry the cable until it works. 

 

Timing Diagram

It might help to understand how the reset sequence of the programmer puts the bootloader into program mode. The programmer software uses the FT232 driver to send active-low pulses to the RST and SPIMISO pins. The bootloader software on RESET immediately checks the SPIMISO pin, if it is low it enters programming mode - otherwise it runs the user code in memory.

RST      ¯¯¯¯\___200ms__/¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

 

SPIMISO  ¯¯¯¯\___400ms____________/¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

I hope this tutorial helps someone out there not go through the trials I did.

 

Outcomes