|
|
Line 16: |
Line 16: |
| | | |
| ==Detailed description== | | ==Detailed description== |
| + | |
| + | |
| | | |
| ''No detailed description exists yet for this component'' | | ''No detailed description exists yet for this component'' |
| | | |
| ==Examples== | | ==Examples== |
| + | |
| + | |
| | | |
| | | |
Revision as of 21:08, 16 November 2021
Author
|
Matrix TSL
|
Version
|
1.0
|
Category
|
General Output
|
PWM 16CH 12Bit (PCA9685) component
The PCA9685 is an I²C-bus controlled 16-channel LED controller optimized for Red/Green/Blue/Amber (RGBA) color backlighting or Servo motor applications. Each output has its own 12-bit resolution (4096 steps) fixed frequency individual PWM controller that operates at a programmable frequency from a typical of 24 Hz to 1526 Hz. All outputs are set to the same PWM frequency. Up to 64 devices can be chained together on a single I²C-bus to provide up to 1024 individual PWM outputs.
Detailed description
No detailed description exists yet for this component
Examples
No additional examples
Downloadable macro reference
|
Reset
|
Sends a reset command to the PCA9685 chip over I2C
|
- VOID
|
Return
|
|
SetPWMFrequency
|
Sets the PWM frequency for the entire chip, up to approx 1.6 KHz
|
[[File:]] -
|
Frequency
|
Floating point frequency that we will attempt to match
|
- VOID
|
Return
|
|
SetOutputMode
|
Sets the output mode of the PCA9685 to either open drain or push pull. Warning: LEDs with integrated zener diodes should only be driven in open drain mode.
|
[[File:]] -
|
Mode
|
0=OpenDrain, 1=Push/Pull
|
- VOID
|
Return
|
|
Sleep
|
Puts the module into Sleep mode
|
- VOID
|
Return
|
|
SetExternalClock
|
Sets EXTCLK pin to use the external clock
|
- BYTE
|
Prescale
|
External Clock Prescaler - Range: 3-255
|
- VOID
|
Return
|
|
SetAddress
|
Allows a different I2C address to be specified allowing one component to control multiple PCA9685 modules.
|
- BYTE
|
Address
|
Range: 0x40 - 0x7F
|
- VOID
|
Return
|
|
SetClockFrequency
|
Sets the current clock frequency, used for things like calculating the PWM frequency and Microsecond duty.
|
- ULONG
|
Clock
|
|
- VOID
|
Return
|
|
GetClockFrequency
|
Returns the current clock frequency
|
- ULONG
|
Return
|
|
WriteMicroseconds
|
Sets the PWM output of one of the PCA9685 pins based on the input microseconds, output is not precise
|
- BYTE
|
Output
|
One of the PWM output pins - Range: 0 to 15
|
- UINT
|
Microseconds
|
The number of Microseconds to turn the PWM output ON
|
- VOID
|
Return
|
|
SetPWM
|
Sets the PWM output of one of the PCA9685 pins
|
- BYTE
|
Output
|
One of the PWM output pins - Range: 0 to 15
|
- UINT
|
On
|
At what point in the 4096-part cycle to turn the PWM output ON
|
- UINT
|
Off
|
At what point in the 4096-part cycle to turn the PWM output OFF
|
- VOID
|
Return
|
|
Initialise
|
Sets up the I2C ready for communications to begin
|
- VOID
|
Return
|
|
WakeUp
|
Wakes the module from Sleep mode
|
- VOID
|
Return
|
|
SetPin
|
Sets pin without having to deal with on/off tick placement and properly handles a zero value as completely off and 4095 as completely on.
|
- BYTE
|
Output
|
One of the PWM output pins - Range: 0 to 15
|
- UINT
|
Duty
|
The number of ticks out of 4096 to be active
|
[[File:]] -
|
Invert
|
0=Normal, 1=Inverted
|
- VOID
|
Return
|
|
DrawRectangle2D
|
Draws a basic 2D rectangle onto the LEDs
|
- BYTE
|
X1
|
|
- BYTE
|
Y1
|
|
- BYTE
|
X2
|
|
- BYTE
|
Y2
|
|
- BYTE
|
DrawStyle
|
Sets the draw style - 0=Soild, 1=Edge, 2=Corners
|
- BYTE
|
R
|
|
- BYTE
|
G
|
|
- BYTE
|
B
|
|
- VOID
|
Return
|
|
ShiftLEDs2D
|
Shifts the contents of the display by the number of vertices specified ***Please Note that Wrap mode is currently unavailable***
|
[[File:]] -
|
X
|
Number of pixels to shift the display -1 to 1 / 0 = No Shift
|
[[File:]] -
|
Y
|
Number of pixels to shift the display -1 to 1 / 0 = No Shift
|
- BYTE
|
DataMode
|
0=ResetToZero, 1=WrapAroundDisplay, 2=Smear
|
- VOID
|
Return
|
|
GetLEDIndex3D
|
Gets the index of a single LED in RAM as a 3D array.
|
- UINT
|
X
|
LED Column to change the colour / Range: 0 to (LED Column - 1)
|
- UINT
|
Y
|
LED Row to change the colour / Range: 0 to (LED Row - 1)
|
- UINT
|
Z
|
LED Layer to change the colour / Range: 0 to (LED Layer - 1)
|
- UINT
|
Return
|
|
DrawCuboid3D
|
Draws a basic 3D cuboid onto the LEDs
|
- BYTE
|
X1
|
Start X pixel coordinate
|
- BYTE
|
Y1
|
Start Y pixel coordinate
|
- BYTE
|
Z1
|
Start Z pixel coordinate
|
- BYTE
|
X2
|
End X pixel coordinate
|
- BYTE
|
Y2
|
End Y pixel coordinate
|
- BYTE
|
Z2
|
End Z pixel coordinate
|
- BYTE
|
DrawStyle
|
Sets the draw style - 0=Soild, 1=Edge, 2=Corners
|
- BYTE
|
R
|
Red Colour Channel
|
- BYTE
|
G
|
Green Colour Channel
|
- BYTE
|
B
|
White Colour Channel
|
- VOID
|
Return
|
|
Initialise
|
Inisialises the RGB colour RAM to 0,0,0 = LED Off and clocks out the data to initialise all the LED ICs in the chain.
|
- VOID
|
Return
|
|
ShiftLEDs3D
|
Shifts the contents of the display by the number of vertices specified ***Please Note that Wrap mode is currently unavailable***
|
[[File:]] -
|
X
|
Number of pixels to shift the display -1 to 1 / 0 = No Shift
|
[[File:]] -
|
Y
|
Number of pixels to shift the display -1 to 1 / 0 = No Shift
|
[[File:]] -
|
Z
|
Number of pixels to shift the display -1 to 1 / 0 = No Shift
|
- BYTE
|
DataMode
|
0=ResetToZero, 1=WrapAroundDisplay, 2=Smear
|
- VOID
|
Return
|
|
Initialise
|
Sets up the data memory and draws the simulated LED cube on the panel.
|
- VOID
|
Return
|
Property reference
|
Properties
|
|
Address
|
Module I2C Address. This setting can be overridden using the SetAddress component macro.
|
|
Output Mode
|
Sets the output mode of the PCA9685 to either open drain or push pull. Warning: LEDs with integrated zener diodes should only be driven in open drain mode. Can be overridden using the SetOutputMode component macro.
|
|
Clock Type
|
Configures the input clock source to the module.
|
|
Clock Frequency
|
Frequency of the module. Internal oscillator defaults to 250000000 or 25MHz but can actually be anywhere from 23 to 27MHz. External clock frequency can be specified here up to a max value of 50000000 or 50MHz. This setting can be overridden using the SetClockFrequency component macro.
|
|
Prescaler
|
External Clock Prescaler Range: 3 to 255
|
|
Target PWM Frequency
|
The ideal PWM frequency we would like to generate on the output pins. Servo motors require an output frequency around 50Hz. LEDs require a mugh higher output frequency to avoid visible flicker.
|
|
Actual PWM Frequency
|
The calculated actual PWM frequency available using the Clock Frequency and Prescaler
|
|
PWM Resolution
|
Number of microseconds the PWM output can resolve to
|
|
Channel
|
Channel selection
|
|
Baud Select
|
Baud rate option selector
|
|
Baud Rate
|
Baud rate to be used
|
|
SDA
|
Pin used for SDA (data signal)
|
|
SCL
|
Pin used for SCL (clock signal)
|
|
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.
|
|
Scope Traces
|
Selects if the component pin connections are automatically generated on the data recorder window or not. Yes: Automatically add the component pins to a group on the data recorder which will reflect the sim data during simultion. No: Do not show the pin signals on the data recorder window.
|
|
Console Data
|
Selects if the console data is automatically generated or not
|
|
API
|
Specifies the API component on the panel to interact with to provide comms simulation.
|
|
Connections
|
|
Simulations
|
|
Simulate Comms
|
|