Difference between revisions of "Component: PWM 16CH 12Bit (PCA9685) (General Output)"
From Flowcode Help
Jump to navigationJump to search| Line 15: | Line 15: | ||
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. | 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. | ||
| − | ==Component | + | ==Component Source Code== |
| − | + | Please click here for the component source code: [https://www.flowcode.co.uk/wikicopy/componentsource/FC_Comp_Source_PCA9685_16_Channel_PWM.fcfx FC_Comp_Source_PCA9685_16_Channel_PWM.fcfx] | |
==Detailed description== | ==Detailed description== | ||
| + | |||
| + | |||
| Line 34: | Line 36: | ||
==Examples== | ==Examples== | ||
| + | |||
| + | |||
| Line 334: | Line 338: | ||
|- | |- | ||
| colspan="2" | Number of microseconds the PWM output can resolve to | | colspan="2" | Number of microseconds the PWM output can resolve to | ||
| + | |- | ||
| + | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
| + | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | I2C Communications | ||
| + | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
| Line 365: | Line 373: | ||
| colspan="2" | 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. | | colspan="2" | 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. | ||
|- | |- | ||
| − | + | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | |
| − | + | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | | width="10%" align="center" style="background-color:# | ||
| − | | width="90%" style="background-color:# | ||
|- | |- | ||
|- | |- | ||
Revision as of 17:49, 9 November 2022
| Author | Matrix TSL |
| Version | 1.0 |
| Category | General Output |
Contents
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.
Component Source Code
Please click here for the component source code: FC_Comp_Source_PCA9685_16_Channel_PWM.fcfx
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 | |
| Return | |
| SetPWMFrequency | |
| Sets the PWM frequency for the entire chip, up to approx 1.6 KHz | |
| Frequency | |
| Floating point frequency that we will attempt to match | |
| Return | |
| Sleep | |
| Puts the module into Sleep mode | |
| Return | |
| SetExternalClock | |
| Sets EXTCLK pin to use the external clock | |
| Prescale | |
| External Clock Prescaler - Range: 3-255 | |
| Return | |
| SetAddress | |
| Allows a different I2C address to be specified allowing one component to control multiple PCA9685 modules. | |
| Address | |
| Range: 0x40 - 0x7F | |
| Return | |
| SetClockFrequency | |
| Sets the current clock frequency, used for things like calculating the PWM frequency and Microsecond duty. | |
| Clock | |
| Return | |
| GetClockFrequency | |
| Returns the current clock frequency | |
| Return | |
| Initialise | |
| Sets up the I2C ready for communications to begin | |
| Return | |
| WakeUp | |
| Wakes the module from Sleep mode | |
| Return | |