Stream camera module input via Teensy

Status
Not open for further replies.

Andy

Member
Hi All

I have a project that combines a USB camera with a Teensy (serial and mouse). They both separately connect to the PC via USB. Can anyone suggest a way I can get a setup that works with just 1 cable?

Is it theoretically possible to stream the USB camera via the Teensy. I need a decent fps so I can't use a serial camera. The camera is a SCCB device. I'm not refering to interpreting the data but literally using the Teensy as a proxy.

I don't have much electronics skills / knowledge but have the ability to learn. I'm just struggling for a general direction to go. If I built a composite device from scratch on my own PCB how could I do this? I can just about understand how to build the 2 devices from scratch on a PCB but not how to integrate them.

The only solution I've got at the moment is to add a USB hub to a PCB with a custom arduino on one side and then connect to the camera module on the other.

Any direction someone could point me in would be appreciated. I'm interested in both quick win hacks (such as adding the usb hub) and/or doing it 100% properly like an expert would do.

Thanks

Andy
 
Is it theoretically possible to stream the USB camera via the Teensy. I need a decent fps so I can't use a serial camera. The camera is a SCCB device. I'm not refering to interpreting the data but literally using the Teensy as a proxy

Foreword: I don't know much about USB stuff; only did a USB-to-serial MIDI converter.

Yes you can read OV7640 and the likes via Teensy; Teensy 3.6 is best suited (much more powerful, more RAM).
Basically you generate a suitable XCLK on the Teensy via its analog functions (analogWriteFrequency + analogWrite) and feed it to the camera.
Then you read single pixels (PCLK-timed) over the camera parallel interface, store them in a buffer, send the buffer via USB (USB uses 64-bytes packet as a base. Could do larger block transfers, but then the latency could be too much).

Consider that the larger the resolution / frame rate, the higher you need the (Teensy-generated) XCLK and (Camera-generated) PCLK to be.

Here in the forum, there has been some success grabbing 160x120 @ 15 FPS (Teensy 3.6) and sending the frames to a LCD panel: it should not be much different to send that amount of data over USB.

But, is 160x120@15 enough for you?

As an alternative (using a different camera module), 320x240@14:
https://forum.pjrc.com/threads/54264-T3-6-Arducam-Mini2MP-recording-320x240-14-FPS-on-microSD-)
Of course you would replace outFile.write() with suitable USB writes.

Now I'm aiming for higher quality video by directly driving an OV2640 without FIFO and without CPLD, but I'm still waiting for the camera to arrive, so no hints to share yet.

Fernando
 
Status
Not open for further replies.
Back
Top