LED Control via I2C

LED Control via I2C

Pulse-based Control Application

A system may need a single LED that can change colors in a very wide spectrum. To accomplish this an RGB led control is used to change the duty cycle for different colors. I2C is used in this application as an easy way to change duty cycle.

 

Ingredients

GreenPAK Diagram

Design Steps

  1. Configure GPIO pins as open-drain outputs for RGB cathode connection.
  2. Add LUT logic and CNT/DLY2 to create a generator with EN signal.
  3. Configure a CNT/DLY block to rising-edge delay.
  4. Add and configure LUTs for each output using Technique: Configuring Standard Logic w/ LUT Macrocells.
  5. Connect each LUT output to the desired output pins.
  6. I2C virtual inputs can be changed individually or simultaneously using the I2C virtual output address.
  7. Counter data of CNT/DLY blocks can be changed individually or simultaneously using the I2C.

Resources

GreenPAK Designer files