Difference between revisions of "ADC Using Explore M3"
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
[[Category:Explore M3 Bare Metal]] | [[Category:Explore M3 Bare Metal]] | ||
+ | In this tutorial we will how how to read the ADC values on Explore M3 using Explore Embedded Libraries.<br> | ||
[[FILE:Lpc1768Adc.gif]] | [[FILE:Lpc1768Adc.gif]] | ||
+ | <br><br> | ||
+ | |||
+ | =Prerequisites= | ||
+ | Please check [[LPC1768: ADC Programming|this tutorial]] for detailed explanation on Lpc1768 ADC module.<br> | ||
+ | If you are doing it for the first time, then check the below links to setup the project for generating the .bin file. | ||
+ | #[[LPC1768: Keil Project For Bin File|Keil4 Setup]] | ||
+ | #[[Setting Up Keil5 For ExploreM3|Keil5 Setup]] | ||
+ | #[[Setting Up ARM GCC For ExploreM3 LPC1768|ARM GCC Setup]] | ||
+ | #[[Setting Up ARM GCC And Eclipse For ExploreM3 LPC1768|Eclipse & ARM GCC Setup]] | ||
+ | <br><br> | ||
+ | |||
+ | =ADC module= | ||
+ | Explore M3 comes with 5-ADC pins with 12-bit resolution.<br> | ||
+ | Below table shows the Explore M3 ADC pin mapping.<br> | ||
+ | {| class="table table-striped table-hover table-condensed table-bordered" | ||
+ | |-class="info" | ||
+ | !Adc Channel || LPC1768 Pin || Pin Functions | ||
+ | |- | ||
+ | |A0|| P0.23 || 0-GPIO, 1-<b>AD0[0]</b>, 2-I2SRX_CLK, 3-CAP3[0] | ||
+ | |- | ||
+ | |A1|| P0.24 || 0-GPIO, 1-<b>AD0[1]</b>, 2-I2SRX_WS, 3-CAP3[1] | ||
+ | |- | ||
+ | |A2|| P0.25 || 0-GPIO, 1-<b>AD0[2]</b>, 2-I2SRX_SDA, 3-TXD3 | ||
+ | |- | ||
+ | |A3|| P0.26 || 0-GPIO, 1-<b>AD0[3]</b>, 2-AOUT, 3-RXD3 | ||
+ | |- | ||
+ | |A4|| P1.31 || 0-GPIO, 1-SCK1, 2- , 3-<b>AD0[5]</b> | ||
+ | |}<br><br> | ||
+ | |||
+ | =Code= | ||
+ | The below code shows uart communication on all the four UART channels with different baud rate.<br> | ||
+ | *Note:Refer the uart.h file for interface details. | ||
+ | |||
+ | <html> | ||
+ | <script src="https://gist.github.com/SaheblalBagwan/4f80605ab6b5ff2aa005e7047cbf7d00.js"></script> | ||
+ | </html> | ||
+ | |||
+ | |||
+ | =Demo= | ||
+ | [[File:UartAdc.jpg]] |
Latest revision as of 10:43, 29 April 2016
In this tutorial we will how how to read the ADC values on Explore M3 using Explore Embedded Libraries.
Contents
Prerequisites
Please check this tutorial for detailed explanation on Lpc1768 ADC module.
If you are doing it for the first time, then check the below links to setup the project for generating the .bin file.
ADC module
Explore M3 comes with 5-ADC pins with 12-bit resolution.
Below table shows the Explore M3 ADC pin mapping.
Adc Channel | LPC1768 Pin | Pin Functions |
---|---|---|
A0 | P0.23 | 0-GPIO, 1-AD0[0], 2-I2SRX_CLK, 3-CAP3[0] |
A1 | P0.24 | 0-GPIO, 1-AD0[1], 2-I2SRX_WS, 3-CAP3[1] |
A2 | P0.25 | 0-GPIO, 1-AD0[2], 2-I2SRX_SDA, 3-TXD3 |
A3 | P0.26 | 0-GPIO, 1-AD0[3], 2-AOUT, 3-RXD3 |
A4 | P1.31 | 0-GPIO, 1-SCK1, 2- , 3-AD0[5] |
Code
The below code shows uart communication on all the four UART channels with different baud rate.
- Note:Refer the uart.h file for interface details.