{"id":366,"date":"2021-05-13T03:11:51","date_gmt":"2021-05-13T03:11:51","guid":{"rendered":"https:\/\/vegaprocessors.in\/blog\/?p=366"},"modified":"2022-05-04T09:29:49","modified_gmt":"2022-05-04T09:29:49","slug":"interfacing-adxl345-digital-accelerometer-to-thejas-soc","status":"publish","type":"post","link":"https:\/\/vegaprocessors.in\/blog\/interfacing-adxl345-digital-accelerometer-to-thejas-soc\/","title":{"rendered":"Interfacing ADXL345 Digital Accelerometer to ARIES v2 Board"},"content":{"rendered":"\n<p>Now we are going to learn how we can interface <strong>ADXL345<\/strong> to <strong>ARIES v2 Board.<\/strong> The ADXL345 is a low-power, 3-axis MEMS accelerometer module with both I2C and SPI interfaces. The ADXL345 board features an onboard 3.3V voltage regulator and level shifter it simple to interface with microcontrollers.\u00a0<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">ADXL345 Digital Accelerometer<\/h2>\n\n\n\n<p>This&nbsp;<strong>ADXL345 Accelerometer module<\/strong>&nbsp;consists of an ADXL345 Accelerometer IC, Voltage Regulator IC, Level Shifter IC, resistors, and capacitors in an integrated circuit. Different manufacturers use different voltage regulator ICs. <strong>ADXL345 IC<\/strong>&nbsp;from Analog Devices is the brain of this module. The ADXL345 is a small, thin, low-power, complete 3-axis accelerometer with signal conditioned voltage outputs. The product measures acceleration with a minimum full-scale range of \u00b116g.<\/p>\n\n\n\n<p>The basic structure of the accelerometer consists of fixed plates and moving plates. When the acceleration is applied on an axis capacitance between fixed plates and moving plates is changed. This results in a sensor output voltage amplitude, which is proportional to the acceleration.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/adxl345sensormodule_01_lrg.jpg\" alt=\"\" class=\"wp-image-415\" width=\"694\" height=\"694\" srcset=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/adxl345sensormodule_01_lrg.jpg 1000w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/adxl345sensormodule_01_lrg-300x300.jpg 300w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/adxl345sensormodule_01_lrg-150x150.jpg 150w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/adxl345sensormodule_01_lrg-768x768.jpg 768w\" sizes=\"auto, (max-width: 694px) 100vw, 694px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Circuit Diagram<\/h2>\n\n\n\n<p>ADXL345 Accelerometer module consists of 8 pins. Using the ADXL345 module with a microcontroller is very easy. Connect VCC and GND pins to 3.3V and GND pins of Microcontroller. Also, connect SCL to I2C1-SCL and SDA to I2C1-SDA of ARIES v2 Board.<\/p>\n\n\n\n<p>Now, for powering up and programming the code into the ARIES v2 Board, we have to connect a <strong>micro USB type B<\/strong> (common data cable, used for mobile charging and data transfer) in the <strong>UART0<\/strong> port of the ARIES v2 Board, to a Laptop\/Desktop\/PC with preinstalled VEGA SDK and Toolchain.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2022\/05\/pinmap_Ar_ADXL345.jpg\" alt=\"\" class=\"wp-image-1172\" width=\"839\" height=\"750\" srcset=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2022\/05\/pinmap_Ar_ADXL345.jpg 602w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2022\/05\/pinmap_Ar_ADXL345-300x268.jpg 300w\" sizes=\"auto, (max-width: 839px) 100vw, 839px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><tbody><tr><td><strong>ADXL345<\/strong><\/td><td><strong>ARIES v2 Board<\/strong><\/td><\/tr><tr><td>3V3<\/td><td>+3V3<\/td><\/tr><tr><td>GND<\/td><td>GND<\/td><\/tr><tr><td>SCL<\/td><td>SCL-1<\/td><\/tr><tr><td>SDA<\/td><td>SDA-1<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<h2 class=\"wp-block-heading\">Procedure<\/h2>\n\n\n\n<p>After setting up the toolchain and SDK path environments, build the example program for the ADXL345 sensor by:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd vega-sdk\/examples\/i2c\/adxl345_demo<\/code><\/pre>\n\n\n\n<p><strong>make clean<\/strong> command to clean the executable :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>make clean<\/code><\/pre>\n\n\n\n<p>then use the <strong>make <\/strong>command to build it.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>make<\/code><\/pre>\n\n\n\n<p>Now, we can transfer the built program to the board, before transfer please ensure that you have connected the UART0 connector of the board to the PC.<\/p>\n\n\n\n<p>Open a new terminal and execute the following command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo minicom aries<\/code><\/pre>\n\n\n\n<p>Now you can see the minicom terminal opened and the board UART terminal is ready.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"820\" height=\"689\" src=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/minicom-3.png\" alt=\"\" class=\"wp-image-581\" srcset=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/minicom-3.png 820w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/minicom-3-300x252.png 300w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/minicom-3-768x645.png 768w\" sizes=\"auto, (max-width: 820px) 100vw, 820px\" \/><\/figure>\n\n\n\n<p>Use&nbsp;<strong>CTRL+A S<\/strong>&nbsp;to enter the file sending menu and select&nbsp;<strong>xmodem<\/strong>&nbsp;by pressing&nbsp;<strong>Enter<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"615\" height=\"143\" data-id=\"269\" src=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/xmodem.png\" alt=\"\" class=\"wp-image-269\" srcset=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/xmodem.png 615w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/xmodem-300x70.png 300w\" sizes=\"auto, (max-width: 615px) 100vw, 615px\" \/><\/figure>\n<\/figure>\n\n\n\n<p>In the next window, with&nbsp;the<strong> Space bar<\/strong>&nbsp;select the&nbsp;<strong>adxl345_demo.bin<\/strong>&nbsp;file to be transferred, by pressing&nbsp;<strong>Enter<\/strong>, the transfer process starts.<\/p>\n\n\n\n<p>Wait until the process is completed. The screen should display how much data has been transferred.<\/p>\n\n\n\n<p>After completing the transfer the Program will start to execute<\/p>\n\n\n\n<p>The output is displayed in the minicom UART terminal:<\/p>\n<\/div><\/div>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/adxl345.png\" alt=\"\" class=\"wp-image-370\" width=\"836\" height=\"588\" srcset=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/adxl345.png 969w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/adxl345-300x211.png 300w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/adxl345-768x541.png 768w\" sizes=\"auto, (max-width: 836px) 100vw, 836px\" \/><\/figure>\n\n\n\n<p>Xa, Ya, Za &#8212;&gt; 3-axis accelerometer output<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"ADXL345 Accelerometer Sensor Demo using VEGA Processor [ RISC-V ISA]\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/LxMwY7rTmHk?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>For additional pieces of information:<\/p>\n\n\n\n<p><a href=\"https:\/\/www.analog.com\/media\/en\/technical-documentation\/data-sheets\/ADXL345.pdf\">https:\/\/www.analog.com\/media\/en\/technical-documentation\/data-sheets\/ADXL345.pdf<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Now we are going to learn how we can interface ADXL345 to ARIES v2 Board. The ADXL345 is a low-power, 3-axis MEMS accelerometer module with both I2C and SPI interfaces. The ADXL345 board features an onboard 3.3V voltage regulator and level shifter it simple to interface with microcontrollers.\u00a0 ADXL345 Digital Accelerometer This&nbsp;ADXL345 Accelerometer module&nbsp;consists of [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15,14,1],"tags":[44,75,7,66,26,31,24],"class_list":["post-366","post","type-post","status-publish","format-standard","hentry","category-getting-started","category-tutorials","category-uncategorized","tag-adxl345","tag-aries-v2-board","tag-cdac","tag-iic","tag-thejas-64","tag-thejas32","tag-vegaprocessor"],"_links":{"self":[{"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/posts\/366","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/comments?post=366"}],"version-history":[{"count":15,"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/posts\/366\/revisions"}],"predecessor-version":[{"id":2263,"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/posts\/366\/revisions\/2263"}],"wp:attachment":[{"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/media?parent=366"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/categories?post=366"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/tags?post=366"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}