• 0
charmander

How to interface video camera to Nexys 4 DDR

Question

Hello everyone,

I am using a Nexys 4 DDR for a school project. I am building a system that uses a video camera to detect and track human motion.

Several questions:

1. Which port should I use to connect the camera? The immediate one available on the board is the USB host connector, but is it possible to use it to connect a camera?

2. Are there any PMODs available to connect a camera module?

3. Any recommendations for a specific camera model to use for this project? Basically, I need to take the video input, perform some filtering to recognize face and arms, downsample the video and store it in a memory buffer, and output the video real-time to a VGA monitor.

Thanks!

Share this post


Link to post
Share on other sites

8 answers to this question

Recommended Posts

  • 1

Looking at the USB port on he Nexys4 DDR, it looks like it's a slave port to the computer that is hosting the board rather than an open port which may be used by something else.  Often, Digilent connects this USB port to a small microcontroller on the board rendering it really useful for the one purpose, but not very reprogrammable.

As for PMod's, I'll let the Digilent staff prove me wrong, but I don't think any of the PMod's will work with a camera.  Camera's tend to want to support high speed data streaming, and you sort of need to plan for that from the beginning.

Speaking of planning from the beginning, have you considered the Nexys Video?  That board has inputs for both DisplayPort and HDMI graphical inputs, as well as an HDMI ouput.  It shouldn't be too hard to find a camera that outputs one of these formats and HDMI displays are becoming more commonplace ...

Dan

Share this post


Link to post
Share on other sites
  • 1

I can't speak a lot for the FPGA side of it, but as per this forum thread there will be a replacement for the VmodCAM that we used to sell, which I believe might be in a Pmod form factor. But otherwise, Dan is correct there is no Pmods that currently work with a camera.

Thanks,
JColvin

Share this post


Link to post
Share on other sites
  • 1

@rappysaha,

Let's use this picture as a guide to our discussion.

The USB port labeled as #2 is a serial port to the PC/host computer.  It is labeled as a shared UART/JTAG port.  This is the "slave port" I was referencing earlier.

But what I think you are asking about is the port labeled as #21 in the picture.  This is labeled as a "USB host connector."  This is discussed in section 3.3 of the reference manual web page as a means of configuring the device, and again in chapter 8 as a means of getting PS2 input from either a keyboard or a mouse. Further, if you look at Sheet #4 of the schematic, at A3-A4 on the sheet, you'll see that this USB port connects to a PIC24.  This PIC connects to the SD-card and the Quad SPI flash for programming purposes, but also produces the PS2 CLK and DATA lines shown in the reference manual, chapter 8.  In other words, there is no direct connection between this USB connector and either the FPGA or a USB phy which would then connect to the FPGA.

Would it be possible to connect a camera to this USB port, and then stream data from the camera over the PS2 wires?  Or perhaps over the QSPI flash or SD card wires?  That would require reprogramming the PIC24.  The pins to do this are found in the J9 connector, also shown on page 4 of the schematic at about D2.  That said, I don't think this is a "Digilent supported" functionality.

We'll see if any Digilent staff pick up on this conversation and pipe up.  Were reprogramming the PIC24 "Digilent supported", I would expect an example program and (even more) the original program the PIC is loaded with so that you could recover your board in case of any errors ...  My guess is that this is not a supported interface.

Hope this helps to clarify my earlier answer.

Dan

Share this post


Link to post
Share on other sites
  • 0

Thanks for the feedback [email protected] and JColvin. It seems that USB is out of the question since its only a slave port. The only board I can use for this class is Nexys 4 DDR so my resources are limited. Now I am thinking of using I2C to connect a compatible video camera. Does anyone have any helpful tutorials or references to interface the video this way?

Thanks!
-Char

Edited by charmander

Share this post


Link to post
Share on other sites
  • 0

Sorry, I can't offer any suggestions or recommendations.  I've never done what you are doing before.  You might wish to sit back and have a chat with your instructor about this, if you haven't done so already.

That said, I just Googled "SPI camera interface" and came up with a ArduCam product for the Arduino that claims to work off of a SPI port.  You might find this useful, you might find others useful.  Your not dead in the water, but I don't think I can help you further.

Good luck!

Dan

Share this post


Link to post
Share on other sites
  • 0
On 5/18/2016 at 8:47 PM, [email protected] said:

Looking at the USB port on he Nexys4 DDR, it looks like it's a slave port to the computer that is hosting the board rather than an open port which may be used by something else.  Often, Digilent connects this USB port to a small microcontroller on the board rendering it really useful for the one purpose, but not very reprogrammable

 

Hi [email protected]
In the Nexsys 4 DDR, USB port is named as 'USB Host' but you are calling it 'slave port'. It is confusing to me. Can you explain in details why USB host can not support a USB camera? 

Actually, I don't have much knowledge about it. So it will be more helpful if you can.

Thanks.

Share this post


Link to post
Share on other sites
  • 0

rappysaha and charmander,

If you look here at the reference manual for the Nexys 4 ddr under section 8 USB HID host it explains that after programing of the fpga the microcontroller for the usb host changes modes to USB HID host. Then the pic24 microcontroller only knows how to communicate to a mouse or keyboard through PS/2 in this mode. Unfortunately, you would not be able to use a usb camera through the usb host on the Nexys 4 ddr. The "SPI camera interface" here that [email protected] suggested looks promising.

thank you,

Jon

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now