Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
resources:tools-software:uc-drivers:renesas:adxl345 [24 Feb 2012 14:22] – Added an image with the onboard accelerometer. Dragos Bogdanresources:tools-software:uc-drivers:renesas:adxl345 [24 Jan 2021 17:22] (current) – Fix bad links Dragos Bogdan
Line 1: Line 1:
-====== ADXL345 - Microcontroller No-OS Driver ====== +====== ADXL345 - No-OS Driver for Renesas Microcontroller Platforms ====== 
- +{{page>:resources:tools-software:uc-drivers:adxl345}}
-===== Supported Devices ===== +
-  * [[adi>ADXL345]] +
- +
-===== Evaluation Boards ===== +
-  * [[http://www.digilentinc.com/Products/Detail.cfm?Prod=PMOD-ACL|PmodACL]]  +
- +
-===== Overview ===== +
- +
-The [[adi>ADXL345]] is a small, thin, low power, 3-axis accelerometer with high resolution (13-bit) measurement at up to ±16 g. Digital output data is formatted as 16-bit twos complement and is accessible through either a SPI (3- or 4-wire) or I2C digital interface. The [[adi>ADXL345]] is well suited for mobile device applications. It measures the static acceleration of gravity in tilt-sensing appli-cations, as well as dynamic acceleration resulting from motion or shock. Its high resolution (4 mg/LSB) enables measurement of inclination changes less than 1.0°. +
- +
-{{ :resources:tools-software:uc-drivers:renesas:pmod_acl.jpg? |}} +
- +
-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/products/tools/introductory_evaluation_tools/renesas_demo_kits/yrdkrl78g13/index.jsp|Renesas Demo Kit for RL78G13 (Renesas)]] +  * [[https://www.renesas.com/us/en/products/microcontrollers-microprocessors/rl78-low-power-8-16-bit-mcus/yrdkrl78g13-yrdkrl78g13-demonstration-kit-rl78g13|Renesas Demo Kit for RL78G13 (Renesas)]] 
-  * [[http://am.renesas.com/products/tools/introductory_evaluation_tools/renesas_demo_kits/yrdkrx62n/index.jsp|Renesas Demo Kit for RX62N (Renesas)]]+  * [[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)]]
  
-===== Driver Description ===== +===== Downloads =====
-The driver contains two parts: +
-  * The driver for the ADXL345 part, which may be used, without modifications, with any microcontroller. +
-  * The Communication Driver, where the specific communication functions for the desired type of processor and communication protocol have to be implemented. This driver implements the communication with the device and hides the actual details of the communication protocol to the ADI driver. +
- +
-The Communication Driver has a standard interface, so the ADXL345 driver can be used exactly as it is provided.+
  
-If the SPI communication is chosen, there are three functions which are called by the ADXL345 driver: +<WRAP round download 80%> 
-  * SPI_Init() – initializes the communication peripheral+  * {{:resources:tools-software:uc-drivers:renesas:adxl345_rl78g13.zip|ADXL345 RL78G13 Driver}} 
-  * SPI_Write() – writes data to the device. +  * {{:resources:tools-software:uc-drivers:renesas:adxl345_rx62n.zip|ADXL345 RX62N Driver}} 
-  * SPI_Read() – reads data from the device. +  * **ADXL345 Driver:           ** https://github.com/analogdevicesinc/no-OS/tree/master/drivers/accel/adxl345 
- +  * **PmodACL Demo for RL78G14: ** https://github.com/analogdevicesinc/no-OS/tree/master/Renesas/RL78G14/PmodACL 
-{{ :resources:tools-software:uc-drivers:renesas:spi_architecture.png? |}} +  * **RL78G14 Common Drivers:   ** https://github.com/analogdevicesinc/no-OS/tree/master/Renesas/RL78G14/Common
-<WRAP centeralign> +
-SPI driver architecture+
 </WRAP> </WRAP>
  
-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 the communication peripheral. +This section contains a description of the steps required to run the ADXL345 demonstration project on a Renesas RL78G13 platform
-  * I2C_Write() – writes data to the device. +
-  * I2C_Read() – reads data from the device.+
  
-{{ :resources:tools-software:uc-drivers:renesas:i2c_architecture.png? |}} +==== Required Hardware ==== 
-<WRAP centeralign> +  * [[https://www.renesas.com/us/en/products/microcontrollers-microprocessors/rl78-low-power-8-16-bit-mcus/yrdkrl78g13-yrdkrl78g13-demonstration-kit-rl78g13|Renesas Demo Kit for RL78G13 (Renesas)]] 
-I2C driver architecture +  * [[http://www.digilentinc.com/Products/Detail.cfm?Prod=PMOD-ACL|PmodACL]] (optional, because an ADXL345 part is installed on Renesas Demonstration Kit (RDK) for RL78G13)
-</WRAP>+
  
-The implementation of these three functions depends on the used microcontroller.+==== Required Software ==== 
 +  * [[http://www.iar.com/en/Products/IAR-Embedded-Workbench/Renesas-RL78/|IAR Embedded Workbench for Renesas RL78 Kickstart]]
  
-<note important>The communication protocol has to be chosen in the header file of the Communication Driver.+==== 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+{{ :resources:tools-software:uc-drivers:renesas:adxl345_rl78g13.jpg? |}}
  
-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</note>+{{ :resources:tools-software:uc-drivers:renesas:pmod_acl_rl78g13.jpg? |}}
  
-The driver for ADXL345 contains functions for reading or writing any of the registers, for placing the device into standby or measure modefor enable or disable various types of events detectionetc.+==== 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 occurson the LCD screen appears a corresponding message.
  
-The following functions are implemented in this version of ADXL345 driver: +{{ :resources:tools-software:uc-drivers:renesas:adxl345_rl78g13_screen.jpg? |}}
-^ Function       ^ Description     ^ +
-| void ADXL345_SetRegisterValue(unsigned char registerAddress, unsigned char registerValue) | Writes data into a register. | +
-| 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/measure mode. | +
-| 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/disables the tap detection. | +
-| void ADXL345_SetActivityDetection(unsigned char actOnOff, unsigned char actAxes, unsigned char actAcDc, unsigned char actThresh, unsigned char actInt) | Enables/disables the activity detection. | +
-| void ADXL345_SetInactivityDetection(unsigned char inactOnOff, unsigned char inactAxes, unsigned char inactAcDc, unsigned char inactThresh, unsigned char inactTime, unsigned char inactInt) | Enables/disables the inactivity detection. | +
-| void ADXL345_SetFreeFallDetection(unsigned char ffOnOff, unsigned char ffThresh, unsigned char ffTime, unsigned char ffInt) | Enables/disables the free-fall detection. | +
-| void ADXL345_SetOffset(unsigned char xOffset, unsigned char yOffset, unsigned char zOffset) | Calibrates the accelerometer. |+
  
-===== Downloads ===== +==== Software Project Setup ==== 
-  * {{:resources:tools-software:uc-drivers:renesas:adxl345_generic.zip|ADXL345 Generic Driver}} +{{page>rl78g13_software_tutorial_without_applilet3}}
-  * {{:resources:tools-software:uc-drivers:renesas:adxl345_rl78g13.zip|ADXL345 RL78G13 Driver}} +
-  {{:resources:tools-software:uc-drivers:renesas:adxl345_rx62n.zip|ADXL345 RX62N Driver}}+
  
-====== Renesas RL78G13 Quick Start Guide ====== +====== Renesas RL78G14 Quick Start Guide ====== 
- +This section contains a description of the steps required to run the ADXL345 demonstration project on a Renesas RL78G14 platform using the PmodACL.
-This section contains a description of the steps required to run the ADF4118 demonstration project on a Renesas RL78G13 platform. +
  
 ==== Required Hardware ==== ==== Required Hardware ====
-  * [[http://am.renesas.com/products/tools/introductory_evaluation_tools/renesas_demo_kits/yrdkrl78g13/index.jsp|Renesas Demo Kit for RL78G13 (Renesas)]] 
-  * [[http://www.digilentinc.com/Products/Detail.cfm?Prod=PMOD-ACL|PmodACL]] (optional, because an ADXL345 part is installed on Renesas Demonstration Kit (RDK) for RL78G13) 
  
 +  * [[https://www.renesas.com/us/en/products/microcontrollers-microprocessors/rl78-low-power-8-16-bit-mcus/yrdkrl78g14-yrdkrl78g14-demonstration-kit-rl78g14|Renesas Demo Kit for RL78G14 (Renesas)]]
 +  * [[http://www.digilentinc.com/Products/Detail.cfm?Prod=PMOD-ACL|PmodACL]] (optional, because an ADXL345 part is installed on Renesas Demonstration Kit (RDK) for RL78G14)
 ==== Required Software ==== ==== Required Software ====
   * [[http://www.iar.com/en/Products/IAR-Embedded-Workbench/Renesas-RL78/|IAR Embedded Workbench for Renesas RL78 Kickstart]]   * [[http://www.iar.com/en/Products/IAR-Embedded-Workbench/Renesas-RL78/|IAR Embedded Workbench for Renesas RL78 Kickstart]]
 +  * 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**,  the **PmodACL Demo for RL78G14** and the **RL78G14 Common Drivers**.
 +
 +All three parts have to be downloaded.
 +</WRAP>
 ==== Hardware Setup ==== ==== Hardware Setup ====
- 
 There are two options: There are two options:
  
-  * 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.+  * The ADXL345 part installed on the Renesas Demonstration Kit (RDK) for RL78G14 can be used. In this case, the I2C protocol has to be chosen with 'ADXL345_Init()' function.
  
-{{ :resources:tools-software:uc-drivers:renesas:adxl345_rl78g13.jpg? |}}+{{ :resources:tools-software:uc-drivers:renesas:adxl345_rl78g14.jpg? |}}
  
-  * 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 with 'ADXL345_Init()' function.
  
-{{ :resources:tools-software:uc-drivers:renesas:pmod_acl_rl78g13.jpg? |}}+{{ :resources:tools-software:uc-drivers:renesas:pmod_acl_rl78g14.jpg? |}}
  
 ==== Reference Project Overview ==== ==== Reference Project Overview ====
 +The reference project:
 +  * reads and displays the data for each axis on LCD;
 +  * it displays also on LCD if the interrupts “Single Tap”, “Double Tap” or “Free-Fall” were activated. 
  
-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+{{ :resources:tools-software:uc-drivers:renesas:adxl345_rl78g14_screen.jpg? |}}
  
-{{ :resources:tools-software:uc-drivers:renesas:adxl345_rl78g13_screen.jpg? |}} 
  
-==== Software Project Setup ==== +==== Software Project Tutorial ==== 
-{{page>rl78g13_software_design}}+{{page>rl78g14_software_tutorial}} 
  
 ====== Renesas RX62N Quick Start Guide ====== ====== Renesas RX62N Quick Start Guide ======
Line 114: Line 88:
  
 ==== Required Hardware ==== ==== Required Hardware ====
-  * [[http://am.renesas.com/products/tools/introductory_evaluation_tools/renesas_demo_kits/yrdkrx62n/index.jsp|Renesas Demo Kit for RX62N (Renesas)]] +  * [[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://www.digilentinc.com/Products/Detail.cfm?Prod=PMOD-ACL|PmodACL]] (optional, because an ADXL345 part is installed on Renesas Demonstration Kit (RDK) for RX62N)
  
 ==== Required Software ==== ==== Required Software ====
-  * [[http://www.renesas.com/products/tools/ide/ide_hew/index.jsp|High-performance Embedded Workshop for RX62N family]] +  * [[https://www.renesas.com/us/en/software-tool/high-performance-embedded-workshop|High-performance Embedded Workshop for RX62N family]] 
-  * [[http://am.renesas.com/products/tools/middleware_and_drivers/c_driver_gen/driver_gen_rpdl/index.jsp|Renesas Peripheral Driver Library for RX62N family]]+  * [[https://www.renesas.com/us/en/software-tool/renesas-peripheral-driver-library|Renesas Peripheral Driver Library for RX62N family]]
  
 ==== Hardware Setup ==== ==== Hardware Setup ====
-For this project it was used the ADXL345 part installed on the Renesas Demonstration Kit (RDK) for RX62N.+There are two options:
  
-==== Reference Project Overview ====+  * The ADXL345 part installed on the Renesas Demonstration Kit (RDK) for RX62N can be used. In this case, the I2C protocol has to be chosen.
  
 +{{ :resources:tools-software:uc-drivers:renesas:adxl345_rx62n.jpg? |}}
 +
 +  * A PmodACL can be connected to the Renesas Demonstration Kit (RDK) for RX62N (in this case, the SPI protocol has to be chosen):
 +
 +    PmodACL Pin 1 (CS)   → YRDKRX62N J8 connector Pin 15
 +    PmodACL Pin 2 (MOSI) → YRDKRX62N J8 connector Pin 19
 +    PmodACL Pin 3 (MISO) → YRDKRX62N J8 connector Pin 22
 +    PmodACL Pin 4 (CLK)  → YRDKRX62N J8 connector Pin 20
 +    PmodACL Pin 5 (GND)  → YRDKRX62N J8 connector Pin 4
 +    PmodACL Pin 6 (VCC)  → YRDKRX62N J8 connector Pin 3
 +
 +{{ :resources:tools-software:uc-drivers:renesas:pmod_acl_rx62n.jpg? |}}
 +
 +==== 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 131: Line 120:
 ==== Software Project Setup ==== ==== Software Project Setup ====
 {{page>rx62n_software_design}} {{page>rx62n_software_design}}
 +
 +====== More information ======
 +{{page>:resources:tools-software:uc-drivers:more-information}}
resources/tools-software/uc-drivers/renesas/adxl345.1330089762.txt.gz · Last modified: 24 Feb 2012 14:22 (external edit)