Its been a fair bit of time since I last posted, mostly attributed to the fact that I’m no longer living down south and have moved home for the next two weeks until I return to university! None the less, after re-arranging my room at home to my liking (my family have the obsession of moving everything to positions which make me hate my room entirely!), I’ve got a new update for you guys!
Its a relatively simple one. Combining my ILI9163 LCD library with the standard peripheral STM32F0 ADC library, I’ve made a really simple analog accelerometer test app. All it does really is display un-normalised analog values on the LCD at a rate determined by how fast the LCD can be updated. The actual accelerometer module that I’m using is a really cheap one that I got off eBay, probably the cheapest accelerometer you can buy due to the fact that all it does is spit out an analog voltage relative to the level of acceleration the board is receiving (£1.24! http://goo.gl/mBYkLG – Link will expire!).
Top down view of the setup, the 5v wire is used for the backlight for additional brightness!
Hopefully the mass of wires is a little easier to see!
With regards to the wiring, hopefully the code comments help tell this but none the less:
- ADCX -> PA0
- ADCY -> PA1
- ADCX -> PA2
- LCD_CD -> PA3
- LCD_RST -> PA4
- LCD_AO -> PA6
- LCD_DAT -> PA7
- LCD_CLK -> PA5
I’ve not bothered to wire up the backlight or VCC to dedicated pins on my STM32F0.
The easiest way to explain what is happening is through a video so voila!
As per usual, the code is available on my github for those interested!
Hi
Where du you get the names for spi pins from, I have miso, mosi, ss and someothers, but not cd or dat
Hey!
SPI names are always different across the whole internet. In this case, since data isn’t bi-directional, only MOSI to MOSI is used. Therefore, DAT = MOSI, SS is CD. I’m not too sure where the naming convention for this comes from (SS being slave select and I’m not sure for CD! Though LCD’s from Asia generally have this notation). Hope that clears it up!