| Sunswift - CANtaloupe
| A CAN enabled microcontroller board
| Tags: embedded, sunswift
| Status: In use
CANtaloupe is a CAN bus enabled microcontroller board I designed in 2016 for use in the Sunswift Violet solar car. This board works as a base board onto which smaller daughterboards are attached, similar to HATs for the Raspberry Pi hat or shields for Arduino. Some example daughterboards the team used are a GPS receiver/environment sensor, a wireless network bridge and failsafe brake/accelerator pedal adaptors.
These boards are used for software development and as the actual hardware on the race itself. Often on the race you need to do rapid debugging (literally on the side of a highway) so its important that physical repairs and debugging are easy. The boards also have to be resilient to damage as solar cars are hot, full of mildly conductive sand and have stiff tires with less than ideal suspension. Based on those needs I came up with some requirements:
- 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
Choosing a microcontroller
The first step in the design was choosing a suitable 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
- Toolchain available on Mac, Windows and Linux
- Flexible pin muxing for simpler PCB design
- I wanted cheap, decent debuggers and a decent software library out of the box
I looked at a few options from vendors such as STMicro, NXP and Cypress (I’m a big fan of the PSoC series micros). Ultimately the LPC15xx series fit the bill on all of these aspects and the 72MHz Cortex M3 was more powerful than we required for Sunswift’s 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+Controller 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
The specific models we used were the LPC1519 and LPC1549 depending on if the design required the USB-UART bridge + UART bootloader solution or not. The USB-UART bootloader solution was easier as we could use the UART DTR and RTS lines to toggle the reset and bootstrap pins to start the UART bootloader, while for the built-in USB bootloader this was not possible. With more development time we could write a proper USB bootloader + platform driver for the LPC1549, however this wasn’t achievable with the resources and time we had so we had to go with the uart chip.
The design relied on a few key ICs with the rest of the components being passives or discrete transistors.
The key parts are:
- 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.
Feedback for the next revision
Overall the board performed well on the race however there were some small issues:
- The USB ports are weak and we occasionally broke them off. Luckily we brought plenty of spare parts but it wasn’t fun getting the hot air station running on a generator in the middle of a dry lake.
- We occasionally had boot up issues at high temperatures. This ended up being due to a rare chance that the DTR line on the FTDI would pull low, with the chance of this increasing at higher temperatures. We didn’t discover this in testing as the ambient temperature in Sydney is considerably lower than a desert (thankfully). This was fixed by bodging it with a schottky diode.
- Although we didn’t have ESD issues during my time on the team, later teams reported killing FTDI chips with ESD.
The suggested improvements are:
- Change USB port to one with better strain relief (many have additional pads under the port)
- Add shottky diode to PCB to fix the boot up issue so it is no longer a bodge
- ESD protection on the USB data lines