Breadboard-able LPC1114 ARM Cortex-M0 Followup

Around the beginning of the year I posted this article about my idea for a breakout board for NXP’s LPC1114 ARM Cortex-M0 microcontrollers after being inspired their announcement for a DIP packaged Cortex-M0 micro. Earlier this month I received the PCBs for my design and built two of the boards using my reflow oven.

In the above pictures I didn’t populate the power LED, but everything else is in place and tested. The LPC1114 QFN package was actually a pleasure to work with using solder paste and a reflow oven. I didn’t have a small enough tip for my solder paste which meant I had a little too much solder in places but that was easily cleaned up with a fine tipped iron. The most obvious place where there is too much solder is around the crystal oscillator on the right, and the 0805 capacitors on the left of the board.

After building two of the boards there were a few things I was happy with, and a few more disappointments. Firstly due to the pin layout of the LPC1114 chip in the QFN package I could make this breakout board quite small and still keep a fairly large ground plane. The small size was a goal of mine especially considering I wanted to be able to plug this board into a standard breadboard. It was almost something I would use!

Now on to the disappointments: My idea presented in my other post about reset and boot-loader buttons was a failure. I had an idea of using small edge mounted buttons to reset and enter the boot-loader mode on the LPC1114. While the idea worked in terms of functionality the implementation failed in terms of ergonomics. Pressing the buttons to load code onto the chip was an unpleasant experience which I think cost too much in usability. My next gripe which I thought might be a problem is that I still need to hook up an external device (In this case a FTDI USB to UART chip) to reprogram the LPC1114. Lastly the silkscreen on the board was blurry! Although this was my fault for making the size too small. It was legible, but it is nice to be able to read which pins you are connecting without squinting.

I am quite happy with building these breakout boards as a learning experience. I do plan on making a second revision which incorporates what I have learned. I plan on doing away with the buttons and instead adding a small FTDI USB to UART chip in a QFN package. This can also be used along with lpc21isp software to automatically reset and enter the ISP boot-loader. As an added bonus this would add USB serial functionality to the board without adding anything extra for easy debugging and prototyping. The external crystal could also be eliminated  with the pins being broken out so that any crystal could be used. This would offset some of the cost added with the FTDI chip and USB connector, especially considering the LPC1114 has a 12MHz internal oscillator.

I will post schematics and layouts for the updated version 2 of my breadboard-able ARM microcontrollers once I have them ready to send off.

LPC1769 Fast Fourier Transform

I recently discovered that NXP has published a DSP library for their ARM Cortex-M3 microcontrollers and I thought it would be fun to write an FFT example using my OpenLPC dev board. It works wonderfully!

I apologize for the video of a computer monitor, the screen capture software didn’t run well when trying to refresh the terminal that quickly.

The example code is actually fairly simple seeing as the heavy lifting is done by the pre-complied library. I turn on and set up the on-chip analog to digital converter and then take 1024 samples storing them in SRAM. There are no imaginary samples so I just store 0 every other sample. The array is then sent as an argument to the Fast Fourier Transform function along with a separate pointer to another location in SRAM on the LPC1769 where the results are stored. The magnitude is then calculated and scaled for printing to the terminal. Because I am using a higher resolution FFT I just print a few of the frequency bins (in the video I print 74) so that it will fit on my screen. My current code doesn’t use interrupts and so the sampling frequency depends on the execution time to store the ADC results in  SRAM along with some logic operations and the 65 clock cycles for the actual conversion. When it is all set and done I repeat the process at 20Hz.

The hardware setup was very simple. An arbitrary signal comes from my function generator centered at 1.5V and fed through an RC low pass filter with a cutoff frequency at ~70KHz for anti-aliasing. This is roughly around the Nyquist frequency of the ADC as I am sampling at around 160KSPS. For practical applications this wouldn’t work well and would allow a lot of signals to alias into the sampled signal, however it takes the edge off of what I was working with.

In all it took a couple hours to get everything set up and running correctly. I will clean up my code and use interrupts in the future to get a more predictable sampling frequency. For now my code is available on my GitHub repository.

https://github.com/willhb/lpc/tree/master/fft_adc.lpc17xx

Audi trunk latch failure analysis.

This is a trunk latch actuator from an Audi station wagon. When 12V is applied the motor will spin the white gear which is attached to a spring encased in the red plastic. The gear is also attached to a rod which is threaded into a second shaft which will be drawn in and release the trunk latch. What makes this interesting is there is no limit switch, the actuator is very minimal.

The other interesting factor is why the actuator needed to be replaced. Most of the time it worked perfectly, however on occasion it would fail the unlock the trunk. The failure to open increased in hot weather. What was happening to the motor was more obvious when it was out of the car. When 12V was repeatedly applied the motor would first pull very firmly and quickly but with each repeated actuation it would become weaker and weaker. This is obvious in the videos below.

Inside the case the brushed dc motor is attached directly to the terminals and there are no other electronics inside. The car must switch the power to the actuator on for a certain length of time to unlock after which it turns off and the spring returns the actuator to its resting position. If the switched signal is too short the actuator won’t work, however if it is too long the motor will stall. The only method the car has for feedback is that there will be a switch that shows when the trunk is open or closed, however if something is holding the trunk closed or it becomes stuck then this will not work. To ensure that the motor doesn’t stay stalled and burn out there has to be a fail-safe (which there is!).

Inside the motor housing there is a large PTC thermistor! When the motor becomes stalled the temperature in the thermistor will rise quickly due to the excess current until only a nominal current is drawn by the actuator. When the actuator is released the temperature in the thermistor drops rapidly and the motor can turn with full torque once again. I believe there are two possibilities to why this actuator stopped behaving as designed. The first is that the thermistor drifted out of spec and its resistance increased too much at lower temperatures. When the car was hot the thermistor resistance was too high to allow sufficient current to turn the motor. The other option is that as the motor brushes wore their resistance increased, so for the same voltage applied to the actuator the motor had less torque. This combined with higher heat and a slight increase in thermistor resistance meant the motor just stalled. If I had a second actuator to compare I could determine the culprit.

 

Dead bug soldering SMD.

Dead bug soldering of surface mount components can be a pain, but in some cases it is absolutely necessary. Many components with be based on a standard footprint (SOIC-8 for example), however occasionally parts will have their own footprint that is impossible to buy a breakout board for.

I wanted to test a MEMS I2S microphone made by Analog Devices which had a very interesting footprint. The eight square pads had a 5 mil pitch, however there is the round ground pad around the microphone port that needs to be connected. In this case I opted to flip the chip over and superglue it down to a different breakout board I had. The two following pictures are how it turned out.

 

I first fluxed all the pads, then added solder to both the breakout board as well as the pads on the microphone. Because the round ground pad was adjacent to another ground pad I bridged the gap with solder. After cleaning my iron and applying more flux I positioned single stranded wire ( I had removed the insulation with wire strippers) with tweezers and applied heat. The final product looks a little messy close up due to excess flux. The white haze is from the superglue.

After all the connections were made the I2S interface worked like a charm. I will post a tutorial on using I2S with the LPC1769 a little later in the month.

Apple Cinema Display Repair

A few weeks ago my 20″ Apple Cinema Display decided to stop working. Instead, the power LED flashed a short-long-short error code indicating that there was a fault in the power brick. A quick swap with another display revealed this was not the case (otherwise this would be a very short post).

After doing a bit of searching there were two solutions to the problem. One of the ‘fixes’ is to block a voltage sense pin on the power connector. It seems in many cases this will let the monitor start-up, however doing this will mean that the monitor is running at an unsafe voltage. The other solution in many cases was to replace a faulty voltage regulator. Because  most of the answers I found focused on the 23″ display I couldn’t be certain until I took apart my monitor.

The culprit: 1117-3.3sj.

I feel rather fortunate in that the voltage regulator that was the source of the display not turning on. Instead of putting out the expected 3.3V, I was able to read a little over 4V on my multimeter. This was very similar to a number of other posts I found (search for “1117-3.3sj”). Annoyingly the regulator was in a DPAK (or TO-252) package, and it is one of those things that I can’t imagine many people would have lying around. I couldn’t find a data sheet for the particular regulator, so I found a replacement regulator that was overkill for the application. I ordered an LD1086 3.3V 1.5A from Digikey on Friday and got it in this afternoon.

Desoldering the old regulator was time-consuming. I snipped the two small leads off and desoldered those first. The larger tab took a lot of time and heat before it came loose. I then wicked away the excess solder and installed the new regulator.

I ended up with a little excess flux, but overall the new regulator went into place easily. I was then able to test and see if I had fixed the problem.

Powering up the monitor a green LED indicator light up, the backlight came on, and upon testing the output voltage at the regulator I was happy to see  around 3.3V. I took a little time to inspect the rest of the board while I had the monitor apart and have included a gallery with all the pictures. Re-assembling the monitor went quickly, and the $1.50 for the regulator sure beats buying a new monitor!