Well, its been an extremely long time since I wrote a blog post and sadly this one is a short one too! 😦 Over the summer, I’ve been working at Imagination Technologies again and going from a lazy student to full time work really takes it out of you. I will however resume my blog making once my work placement is over (3 weeks to go)!
For you all to look forward to:
- Open source touch screen library – The latest Eon Watch has a touch screen, albeit a resistive as opposed to capacitive screen – getting small capacitive screens without being a megacorp ain’t easy! One problem I had was finding an easy to use, efficient and accurate C library for simple touch gesture detection, along with point decoding. As with lots of things in life, I didn’t seem to be able to find an all in one solution so decided to roll my own. Using a TI note on 3 point touch screen calibration, I started with merely calibrating the touch screen. This required some 3×3 matrix math, along with reading from the touch sensor (AD7843 in this case) through SPI. Once calibrated, one could read the co-ordinates with relative ease, the problem however came with decoding touches from noise and other such problems. This could be done through the PenIRQ but I decided to go down a different route – using the (0, 0) co-ordinate as “no touch” and anything else as a touch. Add in a few filters and voila! A relatively stable touch detection system. I created a main struct that can detect gestures (up swipe, down swipe, left swipe, right swipe and tap), along with storing the points (in pixels) of where the pen was pressed and released. This allowed me to build simple GUIs and other such things that used the touch library as the human input.
- Guitar note frequency detection – This is quite a hard one to do on a low processing power budget! As ever, I did it using my STM32F0 discovery board and while it wasn’t the stable detection method, after the initial transient, note detection was relatively consistent. I then wired this up to a simple DDS sawtooth generator and used my bass to produce sawtooth waves! The main methodology behind this was to use an adaptive Schmitt trigger where the thresholds are dependent on the peaks of the input waveform. Essentially: When the input signal exceeds the positive peak detector by X, set Schmitt output to 1, when the signal then negatively exceeds the negative peak detector by X, set the Schmitt output to zero. The peak detectors are required to ensure this works across a multitude of amplitudes (for example as the note dies out). The problem however comes with the fact that a vibrating string changes its harmonic content as the amplitude of the vibrations dies down, meaning towards the end of the vibration, the predominant harmonic is the second. This causes the the peak detect method to jump in frequency from the fundamental, to the second harmonic producing weird effects towards the end of the note. I’m still looking to fix this by introducing a short time window after the initial transient where the frequency is allowed to change, after that window, the frequency stays constant until the next major transient where the same window is applied again. This one is work in progress!
- THE PHOBASS! As ever, my favourite project of all, is truly nearly complete! I’ve been drastically improving it over these last few days/weeks and I’m actually getting to the point where it is nearly at the end of its project lifecycle. It feels weird getting to this point as I’ve never formally finished a project, they generally tend to melt into the past or carry on going (like the watch). Current features include: A multitude of audio modulation sources (14 to be exact!), string bending ability, pressure sensitive control, envelope click reduction – useful for sinewave stuff! A soon to be wireless foot pedal which can be assigned to certain effects, along with change patches, talking about patches! The Phobass supports 10 banks of 10 patches, read and stored from an SD card 1 bank at a time being stored locally to allow for swift patch changes in a live situation. Finally, battery power! A phobass hasn’t been battery powered since Phobass II so it will be nice to introduce it again to Phobass V!
- OV7670 FIFO camera interfaced to an LCD. OV7670 cameras are ridiculously cheap! They can be had for under £10 on eBay from the far lands and generally work. This caveat doesn’t apply to the one I received but fortunately, the seller was kind enough to send me another so I’m waiting for that to arrive. The FIFO versions of the camera are great because you don’t need to be able to process the data at the speed of the pixel clock meaning you can capture an image into the FIFO and stream it out at your own leisure – some dude on the internet did it through USART from an MSP430! I however am intending to display the image on one of those cheapo LCDs you can buy from anywhere – 1.8″ 160×128 pixel jobbies, like the one used on my latest watches. The camera outputs (in standard mode) an image of RGB565 at 640×480 pixels. Through simple pixel skips (skip every 640/160 = 4 pixels and 480/120 = 4 lines to produce an image at 160×120), an image can be drawn to the screen with minimal effort. This will lead eventually to A night vision project!
- I’m forever on the hunt for a suitable and cheap eye projection module or transparent OLED display for a HUD, if anybody finds anything cool, post a comment!
Sorry for the delays! I’ll be putting up a few more STM32 tutorials in the near future too.