Component: Digital Potentiometer (MCP41XX MCP42XX) (Analog Output)

From Flowcode Help
Jump to navigationJump to search


Author Matrix TSL
Version 1.0 (Release)
Category Analog Output


Image Digital Potentiometer (MCP41XX MCP42XX) component

The MCP41XX and MCP42XX device range supports up to 2 digital potentiometers or rheostat outputs. 129 or 257 possible output resistance values for each channel.

Examples

No additional examples


Downloadable macro reference

IncrementWiper

Increments a single volatile wiper value

Parameters

BYTE Index
Range: 0-3


Return value

This call does not return a value


DecrementWiper

Decrements a single volatile wiper value

Parameters

BYTE Index
Range: 0-1


Return value

This call does not return a value


SetWiper

Sets the value of a single wiper

Parameters

BYTE Index
Range: 0-3
UINT Value
129 Taps Range: 0-128 / 257 Taps Range: 0-256
BOOL MemoryType
0=Volatile, 1=Nonvolatile


Return value

This call does not return a value


ReadAddress

Reads a value from one of the registers on the device

Parameters

BYTE Address
Range: 0-15


Return value

UINT


WriteAddress

Writes a value to one of the registers on the device

Parameters

BYTE Address
Range: 0-15
UINT Value
Range: 0-256


Return value

This call does not return a value


Initialise

Startup the SPI peripheral ready for communications.

Parameters

This macro has no parameters


Return value

This call does not return a value


Simulation macro reference

This component does not contain any simulation macros


Property reference

Channel

This property is of type Fixed list of ints and can be referenced with the variable name cal_spi1::CHANNEL.

SPI Channel selector

Prescale

This property is of type Fixed list of ints and can be referenced with the variable name cal_spi1::PR_SCALE.

Prescale option selector

MOSI

This property is of type Single digital pin and can be referenced with the variable name cal_spi1::MOSI.

SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode.

MOSI Remap Pin

This property is of type Fixed list of ints and can be referenced with the variable name cal_spi1::MOSIPins.

Select which the target pin to assign the MOSI hardware pin functionality.

MISO

This property is of type Single digital pin and can be referenced with the variable name cal_spi1::MISO.

SPI Data In Pin SDI - Also Known as Master In Slave Out (MISO) when used in Master mode.

MISO Remap Pin

This property is of type Fixed list of ints and can be referenced with the variable name cal_spi1::MISOPins.

Select which the target pin to assign the MISO hardware pin functionality.

CLK

This property is of type Single digital pin and can be referenced with the variable name cal_spi1::CLK.

SPI Clock Pin CLK - The Clock signal is driven by the SPI master.

CLK Remap Pin

This property is of type Fixed list of ints and can be referenced with the variable name cal_spi1::CLKPins.

Select which the target pin to assign the CLK hardware pin functionality.

CS / SS

This property is of type Single digital pin and can be referenced with the variable name cal_spi1::SS.

Chip Select / Slave Select Pin

Master Mode: General purpose output pin used to select the remote SPI device.

Slave Mode: Hardware chip select pin input used to select the SPI device.

Number of Outputs

This property is of type Fixed list of ints and can be referenced with the variable name NumOutputs.

No additional information


Number of Taps

This property is of type Fixed list of ints and can be referenced with the variable name NumTaps.

No additional information


Simulate Comms

This property is of type True or false and can be referenced with the variable name SimulateComms.

No additional information


Scope Traces

This property is of type True or false and can be referenced with the variable name cal_spi1::ScopeTraces.

Selects if the scope traces are automatically generated or not

Console Data

This property is of type True or false and can be referenced with the variable name cal_spi1::ConsoleData.

Selects if the console data is automatically generated or not

Injector

This property is of type Fixed list of ints and can be referenced with the variable name cal_spi1::Injector.

No additional information