A nice presentation about how to get USB running on an sub-$1 Cortex M0+ ARM microcontroller that has no built in USB hardware. The talk describes the implementation of a new bitbanged USB stack, starting with a primer on the USB PHY layer and continuing up the stack, concluding with “Palawan”, a feature-complete open-source bitbanged USB Low Speed stack available for use on microcontrollers priced for under a dollar. We’ll go over requirements for getting USB to work, as well as talking about USB timing, packet order, and how to integrate everything together.
TCS3771 and alike are a range of I2C RGB sensors allowing one to read not only light intensity but also it’s color. With a bit of care and consideration, the light intensity can be calculated with quite a precision. They provides red, green, blue, and clear (RGBC) light sensing and proximity detection (when coupled with an external IR LED). They detect light intensity under a variety of lighting conditions and through a variety of attenuation materials.
The device contains a 4 × 4 photodiode array, integrating amplifiers, ADCs, accumulators, clocks, buffers, comparators, a state machine, and an I2C interface. The 4 × 4 photodiode array is composed of red-filtered, green-filtered, blue-filtered, and clear photodiodes – four of each type. Four integrating ADCs simultaneously convert the amplified photodiode currents to a digital value providing up to 16 bits of resolution. Upon completion of the conversion cycle, the conversion result is transferred to the data registers. The transfers are double-buffered to ensure that the integrity of the data is maintained. Communication to the device is accomplished through a fast (up to 400kHz), two-wire I2C serial bus for easy connection to a microcontroller or embedded controller.
This article hooks up a TCS3771 to LPC1114 and provides some explanation and code to read the RGB and C values from the device.