pr. PIC32 USB-to-RS232 bridge / programmer

Microchip MCP2200 (based on PIC18F14K50 microcontroller) is probably the most optimized Microchip USB to RS-232 bridge, but it is hard to solder by hand and it only goes up to 921.600 bauds. PIC32MX250F128B is a 32-bit microcontroller in a classic DIP-28 casing, which is relatively easy to solder. It also goes up to 3.000.000 bauds (3 mega bauds), so it is also three times as fast. However, Microchip currently promotes PIC32 firmware development only through Microchip Harmony programming library, which on my opinion adds quite some programming overhead to USB CDC interface implementation. One solution is to use a non-Harmony development environment such as Microchip Application Library, but the library does not support newer PIC32 microcontrollers. So I decided to use PIC32MX250F128B for a start. The original MLA lacks configuration files for PIC32MX270F256B.

Let’s get to work! There are quite some USB to RS232 bridge open source firmware on the internet

that only support a bare USB CDC implementation with no control signals such as chip enable, reset and normal/programing mode. There are two options for improvements: HID interface may be added as it is the case with MCP2200, or HID CDC interface may be upgraded with nonstandard functionalities that enable to operate PIC32MX250F128B extra GPIOs, which is easier to do because USB descriptor and all but one USB routines remain the same. A trick is to modify CDC baud speed control procedure which is originally limited to 115.200 bauds to remove the limitation and to add pin control options. A new baud speed parameter is a two-byte integer that enables a user to set an arbitrary baud speed from a PC operating system such as Windows or Linux. But who needs exotic speeds like 191919 bauds? So, one may add additional programming to use such speed settings for form control pin operation. See the schematic with speed options legend. The schematic shows how to fully programmatically operate ESP8266 module with PIC32MX250F128B microcontroller with no need for manually operated micro switches.

Get a Windows.NET4.5 application to operater control signals and firmware for PIC32MX270F256B and PIC32MX250F128B microcontrollers here.