{"id":720,"date":"2021-06-01T06:15:38","date_gmt":"2021-06-01T06:15:38","guid":{"rendered":"https:\/\/vegaprocessors.in\/blog\/?p=720"},"modified":"2022-06-01T11:24:14","modified_gmt":"2022-06-01T11:24:14","slug":"reading-adc-value-aries-v2-board","status":"publish","type":"post","link":"https:\/\/vegaprocessors.in\/blog\/reading-adc-value-aries-v2-board\/","title":{"rendered":"Reading ADC value: ARIES v2 Board"},"content":{"rendered":"\n<p>Analog-to-digital conversion (ADC) is necessary because, while embedded systems deal with digital values, their surroundings typically involve many analog signals such as temperature, speed, pressure, the output of a microphone, etc. They all need to be converted into digital data before being processed by the microcontroller. In this tutorial, we will learn how to get ADC values through the ARIES v2 Board.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Need of Analog to Digital Converter ??<\/h2>\n\n\n\n<p>When we build projects using a Microcontroller, we normally would connect different sensors to obtain information regarding the physical world and do some processing based on that information. So, when talking about communication, there are two types of signals that we often come across:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Analog Signals<\/li><li>Digital Signals<\/li><\/ul>\n\n\n\n<p>Analog signals are a type of continuous signal which are time-varying. Most of the environmental sensors such as temperature, light, pressure, and sound sensors communicate with microcontrollers using analog signals. These analog sensors output values in a specific range based on what the sensors are sensing.<\/p>\n\n\n\n<p>Digital signals are a type of discrete signal which are time-varying. The data is carried in the form of binary in a digital signal. This means it can either carry a \u201c0\u201d or a \u201c1\u201d. If you think about a switch, it sends out digital signals when pressing it to turn on while transmitting as a \u201c1\u201d and when pressed again to turn off while transmitting as a \u201c0\u201d.<\/p>\n\n\n\n<p>When you need to use analog sensors and communicate with a microcontroller, it is not possible for the microcontroller to directly understand these analog signals because microcontrollers only understand digital signals which are formed by 1\u2019s and 0\u2019s. Therefore, this kind of system needs an intermediate device that could convert the analog signals from these sensors to digital signals in order for the microcontroller to understand these signals.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"795\" height=\"267\" src=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/analog-to-digital-conversion-2.jpg\" alt=\"\" class=\"wp-image-725\" srcset=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/analog-to-digital-conversion-2.jpg 795w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/analog-to-digital-conversion-2-300x101.jpg 300w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/analog-to-digital-conversion-2-768x258.jpg 768w\" sizes=\"auto, (max-width: 795px) 100vw, 795px\" \/><\/figure>\n\n\n\n<p>For the demonstration, we use a <strong>Potentiometer <\/strong>and vary its value from Minimum to maximum and vice versa. For a better understanding, we have scaled the values to the corresponding output voltage.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Circuit Diagram<\/strong><\/h2>\n\n\n\n<p id=\"block-9a403a43-e9a0-46ec-9b3e-1f0189ce890c\">The\u00a0<strong>Potentiometer<\/strong> has three pins. Connect +3.3V and GND of ARIES v2 board to the terminal pins of the potentiometer. Then connect the middle pin of the potentiometer to the Analog pin<strong> A0 <\/strong> of the ARIES v2 Board.<\/p>\n\n\n\n<p id=\"block-0e3ea006-a350-4079-8003-c87a7b9fdec8\">Now, for powering up the ARIES v2 board via USB port of a Laptop\/Desktop\/PC and burning the code into the ARIES v2 board, we have to use a micro USB type B to USB type A cable. The cable should be connected to <strong>UART0<\/strong> port of the ARIES v2 board, and the Laptop\/Desktop\/PC should be preinstalled with VEGA SDK and Toolchain.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"952\" src=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2022\/05\/pinmap_Ar_ADC-1024x952.jpg\" alt=\"\" class=\"wp-image-1228\" srcset=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2022\/05\/pinmap_Ar_ADC-1024x952.jpg 1024w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2022\/05\/pinmap_Ar_ADC-300x279.jpg 300w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2022\/05\/pinmap_Ar_ADC-768x714.jpg 768w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2022\/05\/pinmap_Ar_ADC.jpg 1227w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><tbody><tr><td><strong>ADC demo<\/strong><\/td><td><strong>ARIES v2 Board<\/strong><\/td><\/tr><tr><td>VCC<\/td><td>+3.3V<\/td><\/tr><tr><td>GND<\/td><td>GND<\/td><\/tr><tr><td>Analog out (middle pin)<\/td><td>A0 <\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"block-f733e920-6f08-44b2-bad7-6f019b129f78\"><strong>Procedure<\/strong><\/h2>\n\n\n\n<p id=\"block-f897cf36-a3a3-4552-a4c5-e8788de88d1a\">After setting up the toolchain and SDK path environments are ready, build the example program for <strong>ADC demo<\/strong> by :<\/p>\n\n\n\n<pre id=\"block-e5f65447-01a4-4e6a-82d9-7153303b2d42\" class=\"wp-block-code\"><code>cd vega-sdk\/examples\/adc\/adc_demo<\/code><\/pre>\n\n\n\n<p id=\"block-7446427f-7416-4deb-b413-9b7fe26828d6\"><em>clean <\/em>command to clean the executable :<\/p>\n\n\n\n<pre id=\"block-262eb1eb-f5de-45ee-96bb-2e28480397c1\" class=\"wp-block-code\"><code>make clean<\/code><\/pre>\n\n\n\n<p id=\"block-a8bf25ca-799f-4d04-a085-c6bef0d44110\">then use <em>make<\/em> command to build it.<\/p>\n\n\n\n<pre id=\"block-88bc76c3-dba2-40b5-b824-57006d0b12fe\" class=\"wp-block-code\"><code>make<\/code><\/pre>\n\n\n\n<p id=\"block-ee6453f8-a4c2-4402-a097-19094ac23465\">Now, we can transfer the built program to the board, before transfer please ensure that you have connected the board UART connector to the PC.<\/p>\n\n\n\n<p id=\"block-e97c5cfb-c799-490c-a2ba-e487f20987d2\">Open a new terminal and execute the following command.<\/p>\n\n\n\n<pre id=\"block-2eeda0d1-1118-4367-96aa-b364fc66945a\" class=\"wp-block-code\"><code>sudo minicom aries<\/code><\/pre>\n\n\n\n<p id=\"block-bdda7ece-4f74-453d-9f10-0bc5cbea6978\">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\" id=\"block-d8e16507-6077-401e-9a79-67e61519c687\"><img decoding=\"async\" src=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/minicom-7.png\" alt=\"This image has an empty alt attribute; its file name is minicom-7.png\"\/><\/figure>\n\n\n\n<p id=\"block-c6c0a81d-3c4a-4d5e-8b57-ec9b09f8b4f6\">Use CTRL+A S to enter file sending menu and select xmodem by pressing Enter.<\/p>\n\n\n\n<figure class=\"wp-block-image\" id=\"block-10ed8cb4-13c5-4cad-b304-6ed356b4e951\"><img decoding=\"async\" src=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/Screenshot-from-2021-04-30-16-14-03.png\" alt=\"This image has an empty alt attribute; its file name is Screenshot-from-2021-04-30-16-14-03.png\"\/><\/figure>\n\n\n\n<p id=\"block-891d29c9-4956-4113-8916-bd443f730fdc\">In the next window, with the <strong>space bar<\/strong> select the <strong>adc_demo.bin<\/strong> file to be transferred, by pressing <strong>Enter<\/strong>, the transfer process starts.<\/p>\n\n\n\n<p id=\"block-69f26c06-c3fb-4423-928d-c911cf5767a1\">Wait until the process is completed. The screen should display how much data has been transferred.<\/p>\n\n\n\n<p id=\"block-eb9bf1c3-44e1-4008-a09e-7959005aeab9\">After completing transfer the Program will start to execute.<\/p>\n\n\n\n<p id=\"block-5ec0d781-587b-4f1e-819c-5367c117e5bc\">The output is displayed in minicom UART terminal:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"928\" height=\"699\" src=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/06\/Screenshot-from-2021-06-01-11-43-42.png\" alt=\"\" class=\"wp-image-738\" srcset=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/06\/Screenshot-from-2021-06-01-11-43-42.png 928w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/06\/Screenshot-from-2021-06-01-11-43-42-300x226.png 300w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/06\/Screenshot-from-2021-06-01-11-43-42-768x578.png 768w\" sizes=\"auto, (max-width: 928px) 100vw, 928px\" \/><\/figure>\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=\"VEGA Processor: ADC Demo\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/vK530QF6xyw?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","protected":false},"excerpt":{"rendered":"<p>Analog-to-digital conversion (ADC) is necessary because, while embedded systems deal with digital values, their surroundings typically involve many analog signals such as temperature, speed, pressure, the output of a microphone, etc. They all need to be converted into digital data before being processed by the microcontroller. In this tutorial, we will learn how to get [&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":[60,69,75,7,26,31,24],"class_list":["post-720","post","type-post","status-publish","format-standard","hentry","category-getting-started","category-tutorials","category-uncategorized","tag-adc","tag-analog-out","tag-aries-v2-board","tag-cdac","tag-thejas-64","tag-thejas32","tag-vegaprocessor"],"_links":{"self":[{"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/posts\/720","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=720"}],"version-history":[{"count":20,"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/posts\/720\/revisions"}],"predecessor-version":[{"id":1253,"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/posts\/720\/revisions\/1253"}],"wp:attachment":[{"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/media?parent=720"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/categories?post=720"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/tags?post=720"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}