Video in Controller on DE1-SoC Computer

Video In Controller and Edge Detection

These are two single 32 bit register but only one bit is used [bit 2] of 0xff20306C and [bit 0] of 0xFF203070. The other bits are unused. When bit 2 of 0xFF20306C is set the video from the video in source is stored into the pixel buffer 0x08000000 . If you want to capture a still you would set bit 2 in the 0xFF20306C followed by writing a 0 into the same location.

To enable Edge Detection set Bit 0 of the Edge Detection register 0xFF302070.

DeviceVideo In buffer
Configuration 32-bit registers
Input/OutputOutput only
Address BaseVideo In Buffer: 0xFF20306C
Edge Detection: 0XFF302070 base+4
Address Map
AddressR/WDescription
baseWbit 2 - if set 1 enables streaming video from composite video in connector
base+4Wbit 0 - if set 1 enables edge detection ***Note*** video streaming must be enabled
Hardware SetupConnect video source to composite video connector

Notes

In order for video in to properly update pixel buffer the swap mode must be enabled on the Front Buffer 0xFF302030 . In order to enable double buffering a 1 must be written to this register. For more information on double buffering read Double Buffering 4.2.2

Assembly Example: Enable video streaming on the DE1-SoC board

.equ ADDR_Front_buffer, 0xFF203020
.equ ADDR_Video_in_controller, 0xFF20306C

  movia r2,ADDR_Video_in_controller
  movi  r3,0x4
  stwio r3,0(r2)        # Enable video in streaming

  movia r2,ADDR_Front_buffer
  movi  r3,0x1
  stwio r3,0(r2)        # Enable double buffer (swap pixel data from back buffer to front buffer)
normalstreaming

Example of live streaming video with comcorder connect to composite video connector

Assembly Example: To enable Edge detection just add the following code to the above example

.equ ADDR_Edge_detection, 0xFF203070

  movia r2,ADDR_Edge_detection
  movi  r3,0x1
  stwio r3,0(r2)        # Enable edge detection
detection

Same streaming video as above but with Edge Detection turned on