-
Notifications
You must be signed in to change notification settings - Fork 4
Home
#Welcome to the teensy webcam project page!
Teensy 2.0 is a complete USB-based microcontoller development system based on Atmel ATMEGA32U4.
The Teensy UVC webcam project implements a standard USB Video Class (UVC) device using the Teensy 2 board.
#FAQ
UVC is a USB specification for video class devices, including webcams. The spec can be downloaded from here. The advantage of implementing a standard class device is that all major OSs includes host drivers for them.
I did not include a real camera sensor in my project. The idea was to understand how the UVC standard is implemented, not to produce a real camera. In theory, a real sensor could be attached to Teensy through its pins, however the Atmel ATMEGA32U4 probably does not have enough cpu juice nor memory to push data from a sensor.
It produces a moving color bars (inspired by the linux vivi driver).
I added one brightness control. More could be easily added.
Not necessary, just burn the hex image into Teensy, and use a camera application (e.g skype, camorama etc)
I attached a serial cable to Teensy and i print some debug strings from the code to the UART pins.
160x120 using YV12 pixel format. You can add your own.
No, the driver is included with the OS. Its a standard USB device, did i mention this?
I programmed the USB controller directly using the Atmel datasheet as a reference. All the webcam controls (negotiating pixel formats, querying the device capabilities etc) are done using endpoint 0, the default control endpoint. Video streaming on the other hand is done using a USB isochronous endpoint.
Teensy 2 is not a high speed USB device, it is capable of full speed only, and is limited in memory and compute power. Teensy 3 is a the latest revision and has more processing power. Having said that, i used a 256 endpoint size for isochronous streaming. I also used ping pong buffer config. This means that Teensy has 2 buffers it can toggle - So while the host is reading one buffer, Teensy cpu can write to the second buffer in parallel to increase throughput.
See lsusb output.
I did it because it is fun and for educational purposes. Who knew that such a small and inexpensive device could become a webcam? :)