Monday, March 10, 2014

Testing a new microcontroller

As my previous post describes, the latest batch of PCBs was unusable due to a simple design bug. So I spent one more evening fixing the bug from the "brain" board.

At this point I felt the STM32 family of microcontrollers might not be the easiest one to use. This wasn't due to the above mentioned bug, but because of the amount of hours needed to browse through the microcontroller's data sheets and other technical documentation to get the basics up and running. This includes the hardware and software side of things. The microcontroller's architecture felt a bit like lots of splinters were thrown together which somehow formed a functioning system.

I had heard rumours that grass might sometimes be greener on the other side of the fence. I felt curious. What if instead of ordering this new board, I would order two different boards: one STM32 based brain board and one based on the NXP microcontroller? This sounded like a nice test.

I delayed my next PCB order by about 1.5 weeks. I spent the evenings studying the NXP LPC4330 microcontroller's technical documentation and designing a PCB around it. LPC4330 is also an ARM Cortex family microcontroller, just like the STM32F373 I had used so far. Instead of being 72 MHz like the STM32, the LPC4330 was capable of running at 204 MHz speed. Not only that, but it was dual core! One of the cores was the M4 with a floating point unit, SIMD instructions and all the usual. The other core was M0 core, which could be used for slightly less math intensive tasks. Nice!

The next thing I noticed about the LPC was that the architecture and all the technical documentation were much more clear than on the STM32. This started to look really good, so I moved forward with the PCB design. I added couple of extra features on the LPC board: more MIDI outputs, an external flash memory, USB port and a JTAG port. I copied the designs fairly faithfully from official evaluation board schematics. Then I checked the board for bugs. I wasn't sure if the USB port would need something extra to work, but I decided to give it a go anyway.

Once I was satisfied with the board, I hit the order button. Twice. Once for the LPC4330 version and once for the STM32 version.

This time the PCBs arrived in about 1.5 weeks. I felt excited about the new LPC board so I decided to solder its components first. The hardest part was getting the 144 pins of the microcontroller to sit just right on the pads. If one corner pin was a bit off its mark, some other pin across the chip was likely to be 7 meters off the mark.

Once all the critical components were soldered, I plugged in my JTAG programmer and plugged some power on the board. My IDE recognised the board right away! Excitedly I wrote a quick and simple "Hello World" program for the LPC4330 and ran it. Success!

All the basics seemed to be working fine, so the next obvious step was to add rest of the components on the PCB.


No comments:

Post a Comment