Difference between revisions of "Component: Digital Potentiometer (MCP45XX / MCP46XX) (Analog Output)"

From Flowcode Help
Jump to navigationJump to search
 
(3 intermediate revisions by the same user not shown)
Line 77: Line 77:
  
 
''<span style="color:red;">No additional examples</span>''
 
''<span style="color:red;">No additional examples</span>''
 +
 +
 +
 +
 +
 +
 +
 +
  
  
Line 83: Line 91:
 
==Macro reference==
 
==Macro reference==
  
 +
===DecrementWiper===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''IncrementWiper'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''DecrementWiper'''
 
|-
 
|-
| colspan="2" | Increments a single volatile wiper value&nbsp;
+
| colspan="2" | Decrements a single volatile wiper value&nbsp;
 
|-
 
|-
 
|-
 
|-
Line 101: Line 110:
  
  
 +
===IncrementWiper===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''DecrementWiper'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''IncrementWiper'''
 
|-
 
|-
| colspan="2" | Decrements a single volatile wiper value&nbsp;
+
| colspan="2" | Increments a single volatile wiper value&nbsp;
 
|-
 
|-
 
|-
 
|-
Line 119: Line 129:
  
  
 +
===Initialise===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetWiper'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 
|-
 
|-
| colspan="2" | Sets the value of a single wiper&nbsp;
+
| colspan="2" | Startup the I2C peripheral ready for communications.&nbsp;
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Index
 
|-
 
| colspan="2" | Range: 0-1&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" | Value
 
|-
 
| colspan="2" | 129 Taps Range: 0-128 / 257 Taps Range: 0-256&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
 
| width="90%" | MemoryType
 
 
|-
 
|-
| colspan="2" | 0=Volatile, 1=Nonvolatile&nbsp;
 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
Line 147: Line 143:
  
  
 +
===ReadAddress===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 165: Line 162:
  
  
 +
===SetWiper===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WriteAddress'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetWiper'''
 
|-
 
|-
| colspan="2" | Writes a value to one of the registers on the device&nbsp;
+
| colspan="2" | Sets the value of a single wiper&nbsp;
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Address
+
| width="90%" | Index
 
|-
 
|-
| colspan="2" | Range: 0-15&nbsp;
+
| colspan="2" | Range: 0-1&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" | Value
 
| width="90%" | Value
 
|-
 
|-
| colspan="2" | Range: 0-256&nbsp;
+
| colspan="2" | 129 Taps Range: 0-128 / 257 Taps Range: 0-256&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
 +
| width="90%" | MemoryType
 +
|-
 +
| colspan="2" | 0=Volatile, 1=Nonvolatile&nbsp;
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
Line 188: Line 191:
  
  
 +
===WriteAddress===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WriteAddress'''
 +
|-
 +
| colspan="2" | Writes a value to one of the registers on the device&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Address
 +
|-
 +
| colspan="2" | Range: 0-15&nbsp;
 
|-
 
|-
| colspan="2" | Startup the I2C peripheral ready for communications.&nbsp;
+
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | Value
 
|-
 
|-
 +
| colspan="2" | Range: 0-256&nbsp;
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
 
 
  
  

Latest revision as of 13:11, 7 February 2023

Author Matrix TSL
Version 1.0
Category Analog Output


Digital Potentiometer (MCP45XX / MCP46XX) component

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

Component Source Code

Please click here to download the component source project: FC_Comp_Source_MCP45xx_46xx_Digital_Pot.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_MCP45xx_46xx_Digital_Pot.fcfx

Detailed description

No detailed description exists yet for this component

Examples

No additional examples







Macro reference

DecrementWiper

Fc9-comp-macro.png DecrementWiper
Decrements a single volatile wiper value 
Fc9-u8-icon.png - BYTE Index
Range: 0-1 
Fc9-void-icon.png - VOID Return


IncrementWiper

Fc9-comp-macro.png IncrementWiper
Increments a single volatile wiper value 
Fc9-u8-icon.png - BYTE Index
Range: 0-1 
Fc9-void-icon.png - VOID Return


Initialise

Fc9-comp-macro.png Initialise
Startup the I2C peripheral ready for communications. 
Fc9-void-icon.png - VOID Return


ReadAddress

Fc9-comp-macro.png ReadAddress
Reads a value from one of the registers on the device 
Fc9-u8-icon.png - BYTE Address
Range: 0-15 
Fc9-u16-icon.png - UINT Return


SetWiper

Fc9-comp-macro.png SetWiper
Sets the value of a single wiper 
Fc9-u8-icon.png - BYTE Index
Range: 0-1 
Fc9-u16-icon.png - UINT Value
129 Taps Range: 0-128 / 257 Taps Range: 0-256 
Fc9-bool-icon.png - BOOL MemoryType
0=Volatile, 1=Nonvolatile 
Fc9-void-icon.png - VOID Return


WriteAddress

Fc9-comp-macro.png WriteAddress
Writes a value to one of the registers on the device 
Fc9-u8-icon.png - BYTE Address
Range: 0-15 
Fc9-u16-icon.png - UINT Value
Range: 0-256 
Fc9-void-icon.png - VOID Return


Property reference

Fc9-prop-icon.png Properties
Fc9-conn-icon.png I2C Properties
Fc9-type-16-icon.png Channel
Channel selection 
Fc9-type-5-icon.png SDA
Pin used for SDA (data signal) 
Fc9-type-5-icon.png SCL
Pin used for SCL (clock signal) 
Fc9-type-16-icon.png Baud Select
Baud rate option selector 
Fc9-type-14-icon.png Baud Rate
Baud rate to be used 
Fc9-type-7-icon.png Stop Delay
On older microcontroller devices there is a potential for the I2C hardware channel to lock up if there is not a 10ms delay between an I2C stop event and the next I2C start event. Most modern microcontrollers will not have a problem so this property can be disabled to speed up the I2C communications.  
Fc9-conn-icon.png Device Properties
Fc9-type-16-icon.png Number of Outputs
 
Fc9-type-16-icon.png Number of Taps
 
Fc9-type-16-icon.png Address Bits
 
Fc9-conn-icon.png Simulation
Fc9-type-7-icon.png Simulate Comms