Difference between revisions of "ADC max1027"

From ArmadeusWiki
Jump to: navigation, search
(add picture)
m
Line 1: Line 1:
 
Instructions to install and use the MAX1027 ADC. '''This device is an option of the [[APF9328]] boards.''' To know if you have one on your board, take a look at the connectors side:<br><br>
 
Instructions to install and use the MAX1027 ADC. '''This device is an option of the [[APF9328]] boards.''' To know if you have one on your board, take a look at the connectors side:<br><br>
[[Image:APF9328_with_MAX1017.jpg]]
+
[[Image:APF9328_with_MAX1027.jpg]]
  
 
==Introduction==
 
==Introduction==
Line 44: Line 44:
  
 
The two configurations files allow direct access to the corresponding register in the MAX1027.
 
The two configurations files allow direct access to the corresponding register in the MAX1027.
For more details, take a look at the datasheet
+
For more details, take a look at the datasheet.
  
* http://datasheets.maxim-ic.com/en/ds/MAX1027-MAX1031.pdf
+
==Links==
 +
* [http://datasheets.maxim-ic.com/en/ds/MAX1027-MAX1031.pdf MAX1027 datasheet on Maxim website]
  
 
{{LanguageBar|ADC_max1027|CAN_max1027|Max1027}}
 
{{LanguageBar|ADC_max1027|CAN_max1027|Max1027}}

Revision as of 09:06, 5 September 2008

Instructions to install and use the MAX1027 ADC. This device is an option of the APF9328 boards. To know if you have one on your board, take a look at the connectors side:

APF9328 with MAX1027.jpg

Introduction

The Max1027 is a 8 channels 10 bits A/D converter with an integrated temperature sensor.
The 8 inputs voltage range is 0 - 3,3V. Don't try to put higher voltage on ADC inputs !!
The i.MXL SPI_1 interface is used to communicate with the device.
For the Linux kernel, the Max1027 is considered as a Hardware Monitoring device. For the moment only a low speed interface (/sys) is available: the eight channels and the temperature are updated every 10ms.

Installation

  • From the top directory:
$ make linux-menuconfig
  • Then select in Device Drivers->SPI support->Freescale iMX SPI controler driver (builtin not module !!)

SPI Linux Config.png

  • Then select in Device Drivers->Hardware Monitoring Support->MAX1027 sensor chip (Module)

HWMonitor Linux Config.png

MAX1027 Linux Config.png

  • Once the new config saved, rebuild your image
$ make

and copy hwmon.ko and max1027.ko driver to your target or reflash your rootfs.

  • On the target, the driver can be started like this:
# insmod /lib/modules/drivers/hwmon/hwmon.ko
# insmod /lib/modules/drivers/hwmon/max1027.ko
  • or like this if you reflashed your rootfs:
# modprobe max1027

Usage

Several interfaces in /sys/bus/spi/are created in order to

  • read the 8 inputs (inx_input). Result in mV
  • read the temperature (temp_input). Result in deg celsius
  • modify the default configuration (config and conv)

An input can be read like that

# cat /sys/bus/spi/devices/spi1.0/in0_input

The temperature can be read like that

# cat /sys/bus/spi/devices/spi1.0/temp1_input

The two configurations files allow direct access to the corresponding register in the MAX1027. For more details, take a look at the datasheet.

Links

Other languages:

English Flag.svg English  •  French Flag.svg Français