Skip to content

Latest commit

 

History

History

16F15376_Curiosity_Nano_I2C_ADXL345.X

ADXL345 I2C demo

What this example does:

  • Read an ADXL345 accelerometer using I2C libraries generated by MPLAB Code Configurator. Axis output is on a 7-segment display driven by a MAX7219 and on the UART.

Notes:

  • SW0 is used to cycle single axe visualizazion on display
  • Board is configured for working at 3.3V
  • Accelerometer is powered Is mandatory from VTG pin (3.3V)
  • MAX7219 is powered from VBUS pin. If you want to use only UART, simply do not connect anytighing to MAX7219 ports
  • UART configured at 9600-N-8-1

System settings:

  • system clock: 32MHz

Connections

Function PIC16F15376 Curiosity Nano pin
SCL RC3
SDA RC4
MAX7219 data RC0
MAX7219 clock RC1
MAX7219 latch RC2

Schematic

Schematic

Link

I2C libraries generated by MCC explained. Article is in italian language but there is an automatic translation plugin that will translate the page in your language without your intervention.