STM32F0 Discovery board with the ADXL335 analog accelerometer and ILI9163 128×128 LCD

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!).

P1020493
Top down view of the setup, the 5v wire is used for the backlight for additional brightness!

P1020494
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!

Advertisements

3 responses to “STM32F0 Discovery board with the ADXL335 analog accelerometer and ILI9163 128×128 LCD

  1. Pingback: ADXL335 normalization and calibration | Harris' Electronics·

    • 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!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s