|Targeted Hardware||phyBOARD-Zeta (i.MX7)|
|Targeted Software||Release PD17.2.0 (Coming Soon)|
This article will demonstrate how to set up and access X_ADC_IN0 on the phyBOARD-Zeta (i.MX7). Software release PD17.1.1 can be modified to enable the ADC1 channel following the instructions in this guide. Support for the ADC is planned to be incorporated in the PD17.2.0 software release.
ADC Access on the phyBOARD-Zeta
The ADC channel 1 pins on the phyCORE-i.MX7 are brought out to the expansion connector (X16) on the phyBOARD-Zeta as X_ADC_INx. This guide uses signal X_ADC_IN0 as an example, but the below table provides the location where alternative ADC input signals can be accessed.
|Net Name||Expansion Connector Pin (X16)|
Software release PD17.1.1 does not enable the ADC by default. The steps below can be used as a guide to enable the ADC, rebuild the device tree, and deploy/test the changes. Please note that the next BSP Release, PD17.2.0 will support ADC and these steps will not be required.
Configuring the device tree
To enable the ADC peripheral, you will need to modify the device tree.
Using a text editor, open the file called 'imx7d-phyboard-zeta.dts' located in the following directory:
Add the following device tree node to enable the ADC1 peripheral:
Next you want to edit the 'imx7d-pba-c-09.dtsi' file located in the same directory:
Add the following device tree node under the regulators section to enable the 1v8 voltage reference:
Rebuilding the Device Tree
After the necessary modifications to the device tree, you will need to rebuild the device tree.
Navigate to your build directory:
Run the following command to rebuild the kernel:
Mount an SD card with an existing PD17.1.1 image. If you do not have an SD card with image PD17.1.1, follow steps 1 through 3 in the 'Booting with Pre-built Images' section of the Quickstart guide.
Remove the existing device tree from the SD card using the following command:
Navigate to the directory on your build machine where the compiled images are deployed:
Copy and rename the device tree to the SD card using the following command:
Unmount the SD card.
- Install the SD card on the i.MX7 board and configure the boot switch (SD1)
SD Card (4-bit SD1 interface)
Implement the following test circuit:
DO NOT use an input voltage greater than 1.8V on any of the X_ADC_INx input channels.
- Start your favorite terminal software (such as Minicom or TeraTerm) on your host PC and configure it for 115200 baud, 8 data bits, no parity, and 1 stop bit (8n1) with no handshake.
- Apply power and press the power switch (S2) to boot Linux. This will boot the system so you can test the updates.
Now that all the software and hardware setup has been complete we can test the changes.
- At the login prompt, enter "root" as the username. There is no required password.
You should now be able to quickly test/read the ADC register by using the following command:
- Here is an example of three measurements of roughly 1.8V (4096), 0.9V (2048) and 0.0V (0).