spacer

Wireless Base Station Alpha

In the last installment I implemented wireless communication for Fitzy and Carraldo. The diminutive mRF24J40MA cards gave the robots an RF voice. Originally I had planned to extend that voice to my PC by using the MicroChip ZENA packet sniffer. I thought that it should be possible to access the device just like the Wireless Development Studio did. In the end, however, my lack of experience with Windows USB programming convinced me I should take a more proven path.

I decided to make my own wireless dongle. I had previously made a board using a PIC18F2553 to attach to the PC's USB, creating a virtual COM port for which I could easily write software.

The simplest design would be to couple an mRF24J40MA with a PIC18F2553. In the past, however, I had purchased some FT232RL USB chips I was itching to use. I also decided to leverage my dsPIC33 port of NerdFever's code. So in the end I threw in a dsPIC33FJ12MC202 that I had left over from a previous project.

One bonus of this design is that I can neatly package the wireless code from the last installment for release. Eventually all the code will be released but it may take a handful of months to reach that stage.

FT232RL - USB Virtual Com Port

The FT232RL is a simple way to add a USB virtual com port to a project. On one side, the FT232RL plugs into the PC's USB port. On the other it communicates with the microcontroller via a serial port. The nice thing is that the USB code is entirely encapsulated unlike the MicroChip USB capable microcontrollers that still need programming. Certainly the latter is more flexible but if the FT232RL provides what you need, it's a lot simpler.

Once you plug the FT232RL into your PC it creates a virtual COM port that you can communicate with. Anything you send to the virtual COM port goes out via the USB, through the FT232RL, and on to the microcontroller. And of course, the microcontroller can communicate the same way.

There is a utility that you can use, FT_PROG, to customize the behaviour of the chip. In my case, I used the utility to assign special functions to the 5 I/O lines the FT232RL sports. These lines can be assigned to drive signal LEDs when data is received from or sent to the PC. They can also be set up to signal low power, sleep mode so the microcontroller can also go into low power mode. They can even provide a clock signal to drive another chip. In this design, one line is a transmit/receive signal line, a low power signal, and a 12MHz clock to drive the dsPIC33.

The FT232RL chip also takes the USB 5V and provides a 3.3V output. This output can only supply about 50mA and some of this is used by the FT232RL itself. I was afraid I'd need a bit more so I added a separate 150mA 3.3V LDO regulator.

FT232RL Settings For This Project

When you first plug the project into the USB bus, Windows may first need to install a device driver. In my case, Windows 7 found the driver and installed it. If necessary you can download the driver from the ftdichip.com site. Once the driver is installed and the FT232RL has been recognized you will run FT_PROG to setup the chip.

This utility, used to configure the FT232RL chip, can be found on the www.ftdichip.com by searching for FT_PROG. Once installed, you use "Devices, Scan & Parse" to locate the FTDI device. While there are a number of configuration options for the device, I left mine all default except for the assignment of functions to the five I/O lines.

  • C0 - POWERON#
  • C1 - TX&RXLED#
  • C2 - SLEEP#
  • C3 - CLK12
  • C4 - SLEEP#

Once this is done you will write the changes to the FT232RL chip using "Devices, Program".

The Board

The FT232RL chip has a 0.65 mm pitch and is still within the limits of toner transfer. The PCB board is about 2.3" x 0.9". All the traces are on the top side (except for the clock transfer line) and the bottom is a ground plane.

Toner transfer PCB board for base station

Here's the first populated version of the board. The flying leads are used to program the dsPIC. In a later version I expanded the board size a bit and added a proper programming header and an extra noise decoupling capacitor and ferrite bead. Noise introduced via the USB lines is a serious concern and FTDI and others publish guidelines (Google Search) on proper PCB design to mitigate against this. This involves bypass capacitors, ferrite beads to absorb high frequency noise, and good layout. I tried my best and it seems to work.

Populated test board
First populated board. A newer layout included below adds a programming header,
an extra ferrite bead and decoupling capacitor.

Here is what you'll need to build your own. These represent the latest versions of the design.

Bill of Materials
Qty Part Description
1 10nF SMD 1206
5 0.1uF SMD 1206
2 1.0uF SMD 1206
1 4.7uF SMD 1206
1 10uF SMD 1206
2 220R (current limiting) SMD 1206
1 4K7 or similar SMD 1206
2 LED (virtually any 20mA or less LED) SMD 1206
1 dsPIC33FJ12MC202 SOIC 28
1 FT232RL SSOP 28
1 WM3983CT-ND (MOLEX USB connecter)  
1 MCP1801_OT (3.3V Reg., 150mA)  
2 MI0805K400R-10 or similar
40ohm, 1.5A Ferrite Bead, Laird-Signal Integrity Products
SMD 0805
1 AO3401A (P-Channel MOSFET) or similar SOT-23
1 mRF24J40MA (Microchip Wireless Module)  

Best of luck to anyone who uses the code or design. I place no restrictions on how the code or design are used but you do so at your own risk. I accept no liability for how you may use this material.

Next Section: Feeding Fitzy - Variable Buck Regulator