This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
resources:tools-software:uc-drivers:renesas:adxl345 [19 Jul 2012 16:24] – Approved Dragos Bogdan | resources:tools-software:uc-drivers:renesas:adxl345 [24 Jan 2021 17:22] (current) – Fix bad links Dragos Bogdan | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== ADXL345 - Microcontroller | + | ====== ADXL345 - No-OS Driver |
- | + | {{page>: | |
- | ===== Supported Devices ===== | + | |
- | * [[adi> | + | |
- | + | ||
- | ===== Evaluation Boards ===== | + | |
- | * [[http:// | + | |
- | + | ||
- | ===== Overview ===== | + | |
- | + | ||
- | The [[adi> | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | The goal of this project (Microcontroller No-OS) is to be able to provide reference projects for lower end processors, which can't run Linux, or aren't running a specific operating system, to help those customers using microcontrollers with ADI parts. Here you can find a generic driver which can be used as a base for any microcontroller platform and also specific drivers for Renesas platforms. | + | |
**HW Platform(s): | **HW Platform(s): | ||
- | * [[http://am.renesas.com/ | + | * [[https://www.renesas.com/us/en/products/microcontrollers-microprocessors/rl78-low-power-8-16-bit-mcus/ |
- | * [[http://am.renesas.com/ | + | * [[https://www.renesas.com/us/en/products/microcontrollers-microprocessors/rx-32-bit-performance-efficiency-mcus/yrdkrx62n-yrdkrx62n-demonstration-kit-rx62n|Renesas Demo Kit for RX62N (Renesas)]] |
- | * [[http:// | + | |
- | * [[http:// | + | |
+ | ===== Downloads ===== | ||
- | ===== Driver Description ===== | + | <WRAP round download 80%> |
- | The driver contains two parts: | + | * {{: |
- | * The driver for the ADXL345 part, which may be used, without modifications, | + | * {{: |
- | * The Communication | + | * **ADXL345 Driver: |
- | + | * **PmodACL Demo for RL78G14: ** https:// | |
- | The Communication Driver has a standard interface, so the ADXL345 driver can be used exactly as it is provided. | + | * **RL78G14 Common Drivers: |
- | + | ||
- | If the SPI communication is chosen, there are three functions which are called by the ADXL345 driver: | + | |
- | * SPI_Init() – initializes the communication peripheral. | + | |
- | * SPI_Write() – writes data to the device. | + | |
- | * SPI_Read() – reads data from the device. | + | |
- | + | ||
- | {{ : | + | |
- | <WRAP centeralign> | + | |
- | SPI driver architecture | + | |
</ | </ | ||
- | If the I2C communication is chosen, there are three functions which are called by the ADXL345 driver: | + | ====== Renesas RL78G13 Quick Start Guide ====== |
- | * I2C_Init() – initializes | + | This section contains a description of the steps required |
- | * I2C_Write() – writes data to the device. | + | |
- | * I2C_Read() – reads data from the device. | + | |
- | {{ :resources:tools-software:uc-drivers:renesas: | + | ==== Required Hardware ==== |
- | <WRAP centeralign> | + | * [[https:// |
- | I2C driver architecture | + | * [[http:// |
- | </ | + | |
- | The implementation of these three functions depends on the used microcontroller. | + | ==== Required Software ==== |
+ | * [[http:// | ||
- | <note important> | + | ==== Hardware Setup ==== |
+ | There are two options: | ||
- | Example: | + | * The ADXL345 part installed on the Renesas Demonstration Kit (RDK) for RL78G13 can be used. In this case, the I2C protocol has to be chosen. |
- | #define ADXL345_COMMUNICATION SPI_COMMUNICATION | + | {{ : |
- | or | + | * A PmodACL can be connected to the PMOD1 connector. In this case, the SPI protocol has to be chosen. |
- | #define ADXL345_COMMUNICATION I2C_COMMUNICATION</ | + | {{ : |
- | The driver for ADXL345 contains functions for reading or writing any of the registers, | + | ==== Reference Project Overview ==== |
+ | In this example, the output data of each axis is read and displayed on the Renesas Demonstration Kit for RL78G13 board’s LCD. Were also activated “Single Tap”, “Double Tap” and “Free-Fall” interrupts. When one of them occurs, on the LCD screen appears a corresponding message. | ||
- | The following functions are implemented in this version of ADXL345 driver: | + | {{ :resources: |
- | ^ Function | + | |
- | | void ADXL345_SetRegisterValue(unsigned char registerAddress, | + | |
- | | unsigned char ADXL345_GetRegisterValue(unsigned char registerAddress) | Reads the value of a register. | | + | |
- | | unsigned char ADXL345_Init(void) | Initializes the communication peripheral and checks if the ADXL345 part is present. | | + | |
- | | void ADXL345_SetPowerMode(unsigned char pwrMode) | Places the device into standby/ | + | |
- | | void ADXL345_GetXyz(unsigned short* x, unsigned short* y, unsigned short* z) | Reads the output data of each axis. | | + | |
- | | void ADXL345_SetTapDetection(unsigned char tapType, unsigned char tapAxes, unsigned char tapDur, unsigned char tapLatent, unsigned char tapWindow, unsigned char tapThresh, unsigned char tapInt) | Enables/ | + | |
- | | void ADXL345_SetActivityDetection(unsigned char actOnOff, unsigned char actAxes, unsigned char actAcDc, unsigned char actThresh, unsigned char actInt) | Enables/ | + | |
- | | void ADXL345_SetInactivityDetection(unsigned char inactOnOff, unsigned char inactAxes, unsigned char inactAcDc, unsigned char inactThresh, | + | |
- | | void ADXL345_SetFreeFallDetection(unsigned char ffOnOff, unsigned char ffThresh, unsigned char ffTime, unsigned char ffInt) | Enables/ | + | |
- | | void ADXL345_SetOffset(unsigned char xOffset, unsigned char yOffset, unsigned char zOffset) | Calibrates the accelerometer. | | + | |
- | ===== Downloads ===== | + | ==== Software Project Setup ==== |
- | | + | {{page> |
- | * {{: | + | |
- | * {{: | + | |
- | * {{: | + | |
- | * {{: | + | |
- | ====== Renesas RL78G13 Quick Start Guide ====== | + | |
- | This section contains a description of the steps required to run the ADXL345 demonstration project on a Renesas | + | ====== Renesas RL78G14 Quick Start Guide ====== |
+ | This section contains a description of the steps required to run the ADXL345 demonstration project on a Renesas | ||
==== Required Hardware ==== | ==== Required Hardware ==== | ||
- | * [[http:// | ||
- | * [[http:// | ||
+ | * [[https:// | ||
+ | * [[http:// | ||
==== Required Software ==== | ==== Required Software ==== | ||
* [[http:// | * [[http:// | ||
- | * [[http://am.renesas.com/ | + | * The ADXL345 demonstration project for the Renesas RL78G14 platform. |
+ | <WRAP round info 80%> | ||
+ | The ADXL345 demonstration project for the Renesas RL78G14 platform consists of three parts: the **ADXL345 Driver**, | ||
+ | |||
+ | All three parts have to be downloaded. | ||
+ | </ | ||
==== Hardware Setup ==== | ==== Hardware Setup ==== | ||
There are two options: | There are two options: | ||
- | * The ADXL345 part installed on the Renesas Demonstration Kit (RDK) for RL78G13 | + | * The ADXL345 part installed on the Renesas Demonstration Kit (RDK) for RL78G14 |
- | {{ : | + | {{ : |
- | * A PmodACL can be connected to the PMOD1 connector. In this case, the SPI protocol has to be chosen. | + | * A PmodACL can be connected to the PMOD1 connector. In this case, the SPI protocol has to be chosen |
- | {{ : | + | {{ : |
- | ==== Software Setup ==== | + | ==== Reference Project Overview |
- | With the //**Applilet3 | + | The reference project: |
+ | | ||
+ | | ||
- | === CSI10 (Clocked Serial Interface 10) – For the ST7579 LCD and the ADXL345 part(if the SPI protocol is chosen) === | + | {{ :resources:tools-software:uc-drivers:renesas:adxl345_rl78g14_screen.jpg? |}} |
- | Choose to generate the Transmit/ | + | |
- | * Transfer mode setting: //**Single transfer mode**// | + | |
- | * Data length setting | + | |
- | * Transfer direction setting: // | + | |
- | * Specification of data timing: //**Type 1**// | + | |
- | * Transfer rate setting – Clock mode: // | + | |
- | * Transfer rate setting – Baudrate: // | + | |
- | * Interrupt setting – Transfer interrupt priority (INTCSI10): // | + | |
- | * Uncheck the callback functions. | + | |
- | === IICA0 (Inter Integrated Circuit Bus) - For the ADXL345 part(if the I2C protocol is chosen) === | ||
- | Choose the //**Single master**// transfer mode and configure the interface with the following settings: | ||
- | * Clock mode setting: // | ||
- | * Local address setting – Address: //**16**// | ||
- | * Operation mode setting : // | ||
- | * Operation mode setting – Transfer clock (fSCL): // | ||
- | * Interrupt setting – Communication end interrupt priority (INTIICA0): //**Low**// | ||
- | * Callback function setting: Check //**Master transmission end**// and //**Master reception end**// callback functions | ||
- | * Callback function enhanced feature setting: Check the // | ||
- | === TM00 (Timer 00) – For the DelayMs() function | + | ==== Software Project Tutorial ==== |
- | Configure TM00 as an interval timer: | + | {{page> |
- | * Interval timer setting - Interval value(16 bits): //**1**// ms | + | |
- | * Interval timer setting - Uncheck //Generates INTM00 when counting is started// | + | |
- | * Interrupt setting - Uncheck // End of timer channel 0 count, generate an interrupt (INTM00)// | + | |
- | === Watchdog Timer === | ||
- | Disable the watchdog timer: | ||
- | * Choose for the Watchdog timer operation setting: // | ||
- | |||
- | ==== Reference Project Overview ==== | ||
- | In this example, the output data of each axis is read and displayed on the Renesas Demonstration Kit for RL78G13 board’s LCD. Were also activated “Single Tap”, “Double Tap” and “Free-Fall” interrupts. When one of them occurs, on the LCD screen appears a corresponding message. | ||
- | |||
- | {{ : | ||
- | |||
- | ==== Software Project Setup ==== | ||
- | {{page> | ||
====== Renesas RX62N Quick Start Guide ====== | ====== Renesas RX62N Quick Start Guide ====== | ||
Line 151: | Line 88: | ||
==== Required Hardware ==== | ==== Required Hardware ==== | ||
- | * [[http://am.renesas.com/ | + | * [[https://www.renesas.com/ |
* [[http:// | * [[http:// | ||
==== Required Software ==== | ==== Required Software ==== | ||
- | * [[http:// | + | * [[https:// |
- | * [[http://am.renesas.com/ | + | * [[https://www.renesas.com/ |
==== Hardware Setup ==== | ==== Hardware Setup ==== | ||
Line 177: | Line 114: | ||
==== Reference Project Overview ==== | ==== Reference Project Overview ==== | ||
- | |||
In this example, the output data of each axis is read and displayed on the Renesas Demonstration Kit for RX62N board’s LCD. Were also activated “Single Tap”, “Double Tap” and “Free-Fall” interrupts. When one of them occurs, on the LCD screen appears a corresponding message. | In this example, the output data of each axis is read and displayed on the Renesas Demonstration Kit for RX62N board’s LCD. Were also activated “Single Tap”, “Double Tap” and “Free-Fall” interrupts. When one of them occurs, on the LCD screen appears a corresponding message. | ||
Line 184: | Line 120: | ||
==== Software Project Setup ==== | ==== Software Project Setup ==== | ||
{{page> | {{page> | ||
- | |||
- | ====== Digilent Cerebot MX3cK Quick Start Guide ====== | ||
- | This section contains a description of the steps required to run the ADXL345 demonstration project on a Digilent Cerebot MX3cK platform. | ||
- | |||
- | ==== Required Hardware ==== | ||
- | * [[http:// | ||
- | * [[http:// | ||
- | |||
- | ==== Required Software ==== | ||
- | * [[http:// | ||
- | * [[http:// | ||
- | |||
- | ==== Hardware Setup ==== | ||
- | A PmodACL can be connected to the J2 connector of Cerebot MX3cK development board for I2C operation, | ||
- | |||
- | {{ : | ||
- | |||
- | or to the JE connector of Cerebot MX3cK development board for SPI operation. | ||
- | |||
- | {{ : | ||
- | |||
- | ==== Reference Project Overview ==== | ||
- | Following commands were implemented in this version of AD7991 reference project for Cerebot MX3cK board. | ||
- | ^ Command ^ Description ^ | ||
- | | help? | Displays all available commands. | | ||
- | | communication= | Selects the communication interface. Accepted values: 0(I2C), | ||
- | | communication? | ||
- | | acceleration? | ||
- | | interrupts? | Displays the state of the interrupts. | | ||
- | |||
- | Commands can be executed using a serial terminal connected to the UART1 peripheral of PIC32MX320F128H. | ||
- | |||
- | The following image shows a list of commands in a serial terminal connected to processor’s UART peripheral. | ||
- | {{ : | ||
- | |||
- | ==== Software Project Setup ==== | ||
- | {{page>: | ||
- | |||
- | ====== Digilent Cerebot MC7 Quick Start Guide ====== | ||
- | This section contains a description of the steps required to run the ADXL345 demonstration project on a Digilent Cerebot MC7 platform. | ||
- | |||
- | ==== Required Hardware ==== | ||
- | * [[http:// | ||
- | * [[http:// | ||
- | |||
- | ==== Required Software ==== | ||
- | * [[http:// | ||
- | * [[http:// | ||
- | |||
- | ==== Hardware Setup ==== | ||
- | A PmodACL can be connected to the J6 connector of Cerebot MC7 development board for I2C operation, | ||
- | |||
- | {{ : | ||
- | |||
- | or to the JB connector of Cerebot MC7 development board for SPI operation. | ||
- | |||
- | {{ : | ||
- | |||
- | ==== Reference Project Overview ==== | ||
- | Following commands were implemented in this version of AD7991 reference project for Cerebot MC7 board. | ||
- | ^ Command ^ Description ^ | ||
- | | help? | Displays all available commands. | | ||
- | | communication= | Selects the communication interface. Accepted values: 0(I2C), | ||
- | | communication? | ||
- | | acceleration? | ||
- | | interrupts? | Displays the state of the interrupts. | | ||
- | |||
- | Commands can be executed using a serial terminal connected to the UART1 peripheral of dsPIC33FJ128MC706A. | ||
- | |||
- | The following image shows a list of commands in a serial terminal connected to processor’s UART peripheral. | ||
- | {{ : | ||
- | |||
- | ==== Software Project Setup ==== | ||
- | {{page>: | ||
====== More information ====== | ====== More information ====== | ||
- | {{page> | + | {{page>: |