Skip to content

Latest commit

 

History

History

COLOR

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Pmod COLOR

Contents of Readme

  1. About
  2. Brief information about Pmod COLOR (and TCS3472)
  3. Interface Description
  4. Test
  5. Status Information
  6. Issues
  7. Possible Future Improvements
  8. Licence

About

Simple interface for the Digilent Pmod COLOR or any other TCS3472. This interface uses modified version of my I²C module.

Brief information about Pmod COLOR (and TCS3472)

The Digilent Pmod COLOR contains AMS TCS3472, a color sensor with IR blocking filter. Module communicates with the host board via I²C bus, and has the address of 0x29. Module measures red, green, blue and clear light with 16 bit precision and has adjustable gain.

Interface Description

colorlite

Module colorlite provides a simple interface for TCS3472 with basic functionality. Module colorlite reads red, green and blue data, however not the clear one. Module does not do any calculations on the gathered data, and outputs raw data.

Port Type Width Description
clk I 1 System Clock
rst I 1 System Reset
i2c_clk I 1 I²C Clock Source (Max. 800 kHz)
SCL O 1 I²C Clock (Max. 400 kHz)
SDA IO 1 I²C Data
LEDenable O 1 Enable sensor LED for reflective measurement
measure I 1 Get RGB data, keep high for getting continuously
enable I 1 Low: Put sensor in sleep mode, High: Put sensor in RGBC mode
gain I 2 Gain setting (Updates automatically when changed)
reflectiveMode I 1 Reflective measurement mode, enables LED when measuring
red O 16 Red data
green O 16 Green data
blue O 16 Blue data
ready O 1 Ready for a new measurement

I: Input O: Output

(Synthesized) Utilization of colorlite on Artix 7:

  • Slice LUTs: 57 (as Logic)
  • Slice Registers: 136 (as Flip Flop)

clockGen_i2c

Module clockGen_i2c can be used to generate I²C clock source, i2c_clk, with 781.25 kHz frequency. Whit this module, I²C clock will have 390.62 kHz frequency. This module requires 100 MHz clk to generate right frequencies.

Port Type Width Description
clk I 1 Input Clock
rst I 1 System Reset
i2c_clk O 1 Output Clock

I: Input O: Output

(Synthesized) Utilization of clockGen_i2c on Artix 7:

  • Slice LUTs: 7 (as Logic)
  • Slice Registers: 7 (as Flip Flop)

Test

colorlite Module:

Module colorlite tested with color_test.v and Arty-A7-100-0.xdc. Two colorlite modules are used; one connected to a Digilent Pmod COLOR other to a Adafruit TCS34725 Color Sensor. Outer RGB LEDs connected to Pmod inners connected to Adafruit sensor. Switch 0 used to enable/disable sensor (by putting it into sleep mode). Switches 2 and 1 are connected to gain ports. Switch 3 is connected to reflectiveMode. I²C signals and MSByte of RGB data registers (red, green, blue) are monitored with Digilent Digital Discovery.

Status Information

Last Test: 21 January 2021, on Digilent Arty A7.

Issues

  • Nothing for now

Possible Future Improvements

  • Full module that enables more features, such as interrupts
  • Some processing over color data to make it more accurate

License

CERN Open Hardware Licence Version 2 - Weakly Reciprocal