Sunswift - CANtaloupe

A CAN enabled microcontroller board
Tags: embedded, sunswift
Status: In use

alt text

The CANtaloupe is a controller area network (CAN) enabled microcontroller board I designed in 2016 for use in Sunswift’s Violet solar car. This board serves as a base board onto which smaller daughterboards are attached, similar to a Raspberry Pi hat or an arduino shield. Some examples of daughterboards that would be connected to this are a GPS receiver, a wireless transceiver or a brake/accelerator pedal adaptor.

These boards would be used for development and for use on the race itself. Often on the race you need to do quick debugging on the side of the road so it was important that repairs and debugging would be easy. The boards also had to be relatively resilient to damage and had to support a range of daughterboards, so the requirements I came up with for this design were:

  • Programmable over USB and a USB serial terminal
  • Must be hand solderable and relatively easy to repair in the field
  • Must be able to be powered over USB
  • Must operate at 60c ambient temperature (inside a solar car can get hot)
  • Provide up to 2A @ 3.3V to the daughterboard
  • Overvoltage protection and reverse polarity protection for 12V CAN power
  • Transient protection for CAN data lines

The important components chosen for this design were:

  • NXP LPC1519 microcontroller
    • 72MHz ARM Cortex M3
    • 36K SRAM, 256K flash, 4K EEPROM
    • CAN controller
    • 1 * I2C, 2 * SPI, 3 * UART
    • 2 * 12 bit, 1MSPS ADC
  • TI TCAN332 CAN transceiver
  • FTDI FT231X USB-UART bridge (with CTS + DTR)
  • TI TPS56428 DC-DC buck converter for 12V (CAN power) -> 3.3V
  • The CANtaloupe + daughterboard combo is designed to fit in a Hammond 1593BB enclosure.

Some improvements that could be made on the next revision:

  • Add strain relief pads on the micro USB connector footprint
  • ESD protection on the USB data lines

Choosing a microcontroller

When choosing a microcontroller there were a few key considerations:

  • Sunswift was a volunteer team of undergraduate students working in their free time while studying, we didn’t have extensive software/firmware development resources
  • I didn’t want to support multiple microcontrollers (+ tools, toolchain ect) so I wanted a microcontroller capable of handling all our use cases. These basic requirements were:
    • CAN controller
    • A good spread of peripherals (I2C, SPI, ADC, PWM, GPIO interrupt)
    • Ample flash and SRAM
    • Fast enough core speed
  • I wanted cheap, decent debuggers and a decent software library out of the box

The LPC15xx series fit the bill on all of these aspects and the 72MHz Cortex M3 was more powerful than we required for most of our use cases. Compared to other microcontrollers I looked at the LPC15xx had a few key advantages:

  • The team had previously used the LPC11C14 which shared the same CAN controller so we could re-use the existing CAN driver
  • A UART bootloader burnt into ROM, again saving us time instead of writing and verifying a bootloader
  • The LPC154x series also has a built in USB PHY that can enumerate as a mass storage device for loading firmware
  • Other potentially useful peripherals such as a DAC, high accuracy timers and a quadrature encoder interface
  • Flexible pin muxing which is helpful for simpler PCB design

For these reasons I settled on the LPC1519 and LPC1549 depending on if the design required the USB-UART bridge + UART bootloader solution. The USB-UART bootloader solution was easier as we could use the UART DTR and RTS lines to start the UART bootloader, while for the built-in USB bootloader we had no way to start the bootloader without pressing a button on the PCB which was difficult once the boards were in the car. If we had more time we could have skipped the USB-UART bridge and just used the built-in USB in the LPC1549, however BOM cost was not a concern and we definitely didn’t have the time to write and verify a USB driver so I opted for the easier solution.