Difference between revisions of "MCP4912"

From ArmadeusWiki
Jump to: navigation, search
(New page: =Description= This 2 channels 10bits SPI DAC (Digital to Analog Converter) is mounted in standard on the APF21Dev development boards. ==Connections== On your Devlight/DevFull ther...)
 
(Description)
Line 1: Line 1:
 
=Description=
 
=Description=
This 2 channels 10bits [[SPI]] DAC (Digital to Analog Converter) is mounted in standard on the [[APF21Dev]] development boards.
+
This 2 channels 10bits [[SPI]] DAC (Digital to Analog Converter) is mounted in standard on the [[APF51Dev]] development boards.
  
 
==Connections==
 
==Connections==
 
On your Devlight/DevFull there are 3 signals to use the Max5821:
 
On your Devlight/DevFull there are 3 signals to use the Max5821:
* DAC_OUTA: corresponds to OUTA (pin 7) on Max5821. It's the first output.
+
* DAC_OUTA: corresponds to OUTA (pin 1 of J5 on the APF51Dev). It's the first output.
* DAC_OUTB: corresponds to OUTB (pin 8) on Max5821. It's the 2nd output.
+
* DAC_OUTB: corresponds to OUTB (pin 10 of J5 on the APF51Dev). It's the 2nd output.
* DAC_REF: corresponds to REF (pin 6) on Max5821. It's the reference voltage (max value that will be achieved by outputs). '''This input should be connected to a voltage reference between 0 and 3,3V.'''
+
  
 
== Driver ==
 
== Driver ==

Revision as of 15:54, 26 April 2011

Description

This 2 channels 10bits SPI DAC (Digital to Analog Converter) is mounted in standard on the APF51Dev development boards.

Connections

On your Devlight/DevFull there are 3 signals to use the Max5821:

  • DAC_OUTA: corresponds to OUTA (pin 1 of J5 on the APF51Dev). It's the first output.
  • DAC_OUTB: corresponds to OUTB (pin 10 of J5 on the APF51Dev). It's the 2nd output.

Driver

The driver is included in ARMadeus distribution, then to use it, select it :

[  ] $ make linux26-menuconfig
Device Drivers  --->
    <*> Staging drivers  --->
        <*> Industrial I/O support  --->
            <M> Microchip MCP4902, MCP4912, MCP4922 driver

Then compile the distribution :

[  ] $ make linux26;make

Use it

modprobe

To use the DAC first load module:

# modprobe mcp49x2

set values

# cd /sys/bus/spi/devices/spi0.1/
# ls
dac_power_mode_0  out0_raw          power             uevent
dac_power_mode_1  out1_raw          subsystem

To set the dac value :

# cat in5_input 
887

Links