MCP3KADC(4) | Device Drivers Manual | MCP3KADC(4)

# NAME

`mcp3kadc` —
Microchip 3x0x SAR analog to digital converter

# SYNOPSIS

`mcp3kadc* at spi? slave ? flags N`

# DESCRIPTION

The `mcp3kadc` driver reports the current voltage on the chip's ADC channels through the envsys(4) API. The driver calculates these values according to the currently selected reference voltage (`Vref`). It can be changed through the sysctl(8) node `hw.mcp3kadc0.vref`.

The following table shows the supported chips. The type of the chip can be selected with the flags argument in the config file.

Designation | Resolution | Input Channels | flags
`MCP3001` | 10 bits | 1 | 0
`MCP3002` | 10 bits | 2 | 1
`MCP3004` | 10 bits | 4 | 2
`MCP3008` | 10 bits | 8 | 3
`MCP3201` | 12 bits | 1 | 4
`MCP3202` | 12 bits | 2 | 5
`MCP3204` | 12 bits | 4 | 6
`MCP3208` | 12 bits | 8 | 7
`MCP3301` | 13 bits | 1 | 8
`MCP3302` | 13 bits | 4 | 9
`MCP3304` | 13 bits | 8 | 10

# SYSCTL VARIABLES

The following sysctl(3) variables are provided:

hw.mcp3kadc0.vref
  Defines the reference voltage on the chip's `Vref` pin in millivolts (mV). It defaults to the ADC's maximum output value + 1 in millivolts (e.g., 4096 for a 12-bit ADC).

# SEE ALSO

envsys(4), spi(4), sysctl(8)

# HISTORY

The `mcp3kadc` driver first appeared in NetBSD 8.0.

# AUTHORS

The `mcp3kadc` driver was written by Frank Wille.

August 18, 2015 | NetBSD 10.1