46
The NetCam The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2

The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2

  • View
    215

  • Download
    0

Embed Size (px)

Citation preview

Page 1: The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2

The NetCamThe NetCam

MembersDarin Keever

Shannon McPhateDerek Leonard

Jeff Nadeau

Senior Design ProjectCPSC 483Group 2

Page 2: The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2

IntroductionIntroduction

The Net Cam is a system which allows The Net Cam is a system which allows a camera to be placed on an a camera to be placed on an ethernet network allowing a host ethernet network allowing a host computer to capture images.computer to capture images.

Page 3: The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2

Practical UsesPractical Uses

• Inexpensive security systemInexpensive security system

• Monitoring scientific experimentsMonitoring scientific experiments

• Sharing life over internet Sharing life over internet “PeepingMoe.com”“PeepingMoe.com”

• Spying on people at water coolerSpying on people at water cooler

• Real time image capture has endless usesReal time image capture has endless uses

Page 4: The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2

Individual TasksIndividual Tasks

• Darin - Darin - Implement QuickCam drivers to Implement QuickCam drivers to hardware hardware

• Shannon - Data to packet conversionShannon - Data to packet conversion

• Derek - Derek - software to convert receive software to convert receive packet and convert to GIFpacket and convert to GIF

• Jeff - Jeff - Initial driver development, data Initial driver development, data to packet debuggingto packet debugging

Page 5: The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2

Problems EncounteredProblems Encountered

• The DP8391 network interface chip would The DP8391 network interface chip would not transmit data, even when tested not transmit data, even when tested without Xylinx design. without Xylinx design.

• This caused a barricade between the This caused a barricade between the camera and computer.camera and computer.

• Exceptional pre-planning still allowed Exceptional pre-planning still allowed other stages of development to conclude.other stages of development to conclude.

Page 6: The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2

Modifications to Original Modifications to Original DesignDesign

• Coding for the camera drivers done Coding for the camera drivers done in Verilog instead of ABEL.in Verilog instead of ABEL.

• Camera functions were realized from Camera functions were realized from Linux drivers because we did not Linux drivers because we did not have much luck with the logic have much luck with the logic analyzer.analyzer.

• The network interface chip used has The network interface chip used has changed. It is essentially the same changed. It is essentially the same chip, only without DMA buffering and chip, only without DMA buffering and controlcontrol

• The memory design is now an 8x256 The memory design is now an 8x256 bit RAM. As a result, we now must bit RAM. As a result, we now must use a 16 bit counter to address it.use a 16 bit counter to address it.

• Added time-outs to driver design Added time-outs to driver design improving reliabilityimproving reliability

Page 7: The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2

The 4 Project PhasesThe 4 Project Phases

• Have camera send images at Have camera send images at predetermined time intervals.predetermined time intervals.

• Have camera send image when any type Have camera send image when any type of UDP packet is received by the boardof UDP packet is received by the board

• Have board receive “control packet” from Have board receive “control packet” from computer with the image size to capturecomputer with the image size to capture

• Implement camera control as GIF image Implement camera control as GIF image serverserver

Page 8: The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2

The Final StatusThe Final Status

• Camera controller interacts flawlessly Camera controller interacts flawlessly with QuickCamwith QuickCam

• Network interface chip problem Network interface chip problem prevented us from testing network prevented us from testing network abilitiesabilities

• Host computer software receives Host computer software receives packets and translates to GIF formatpackets and translates to GIF format

Page 9: The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2

RankingsRankings

• Level of difficulty faced in implementation:Level of difficulty faced in implementation:– The project has been a challenge and has been time The project has been a challenge and has been time

consuming, especially the paperwork. Network chip has consuming, especially the paperwork. Network chip has provided us with much frustrationprovided us with much frustration

• Coordination among team membersCoordination among team members– Has been a little tough scheduling computer time with Has been a little tough scheduling computer time with

each other, however we all work well together.each other, however we all work well together.

• Support from TA’s and instructorSupport from TA’s and instructor– ExcellentExcellent

Page 10: The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2

Components of ProjectComponents of Project

• Network InterfaceNetwork Interface

• Camera InterfaceCamera Interface

• External Network DevelopmentExternal Network Development

Page 11: The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2

Network InterfaceNetwork Interface

• BackgroundBackground

• Xilinx ControllerXilinx Controller

• SNI/AUI ChipsetSNI/AUI Chipset

• TestingTesting

Page 12: The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2

BackgroundBackground

• The function of the Xilinx-to-Ethernet The function of the Xilinx-to-Ethernet component of the hardware was to take component of the hardware was to take the pixel data from the camera, put it into the pixel data from the camera, put it into an Ethernet standard transmission an Ethernet standard transmission packet, and drive the packet onto the packet, and drive the packet onto the Ethernet.Ethernet.

• Components - Xilinx 4003 FPGA and Components - Xilinx 4003 FPGA and SNI/AUI ChipsetSNI/AUI Chipset

Page 13: The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2

Xilinx ControllerXilinx Controller

• FunctionFunction

• Interface to CameraInterface to Camera

• Interface to SNIInterface to SNI

• Design DescriptionDesign Description

Page 14: The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2

Xilinx ControllerXilinx Controller

Page 15: The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2
Page 16: The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2

SNI/AUI ChipsetSNI/AUI Chipset

• SNI DescriptionSNI Description

• AUI AUI

• CircuitryCircuitry

Page 17: The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2
Page 18: The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2

TestingTesting

• Logic DesignLogic Design

• Timing IssuesTiming Issues

• Hardware ProblemHardware Problem

Page 19: The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2

Xilinx Circuit TestingXilinx Circuit Testing

• Xilinx software simulationXilinx software simulation

• Logic analyzer Logic analyzer

• OscilloscopeOscilloscope

Page 20: The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2

SNI/AUI Circuit TestingSNI/AUI Circuit Testing

AAGHHHHH!AAGHHHHH!!!!!

Page 21: The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2

ProblemProblem

The SNI does not output a The SNI does not output a differential transmit pair to the differential transmit pair to the AUI.AUI.

Page 22: The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2
Page 23: The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2

Testing ConfigurationsTesting Configurations

• ClockClock

• Loopback ModeLoopback Mode

• Select InputSelect Input

• Reduce current flowReduce current flow

Page 24: The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2

ResultResult

The SNI is the essential link The SNI is the essential link between the Xilinx controller between the Xilinx controller and the AUI, and between the and the AUI, and between the camera and the Ethernet. camera and the Ethernet. Therefore, we do not have Therefore, we do not have communication between the communication between the camera and the computer camera and the computer software.software.

Page 25: The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2

Camera InterfaceCamera Interface

• Introduction to Parallel PortIntroduction to Parallel Port

• Introduction to CameraIntroduction to Camera

• Driving the CameraDriving the Camera

• Output from CameraOutput from Camera

Page 26: The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2

Introduction to Parallel Introduction to Parallel PortPort

• Data, Status, Control : Data, Status, Control : eight bit registerseight bit registers

• Each bit of register Each bit of register corresponds to pincorresponds to pin

– example: example:

status(7) = pin 11status(7) = pin 11

• When programming,When programming,

wait(5s);wait(5s);

control = h5c;control = h5c;

Page 27: The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2

Introduction to CameraIntroduction to Camera

• 80x60 pixel image80x60 pixel image

• 4 bit shades - Black and White4 bit shades - Black and White

• Reset and Command sequences Reset and Command sequences availableavailable

Page 28: The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2

Reset Sequence Reset Sequence

Xilinx to CameraXilinx to Cameracontrol = h20control = h20

data = h75data = h75

wait 255wait 255ss

control = h0bcontrol = h0b

wait 255wait 255ss

control = h0econtrol = h0e

Page 29: The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2

Command SequenceCommand Sequence

Xilinx to CameraXilinx to Cameradata = commanddata = commandwait(255wait(255s)s)control = h06control = h06for(count = 0;status == 1;count++)for(count = 0;status == 1;count++)

if(count > command_timeout)if(count > command_timeout)reset()reset()

control = h0econtrol = h0efor(count = 0;status == 0;count++)for(count = 0;status == 0;count++)

if(count > command_timeout)if(count > command_timeout)reset()reset()

Camera to XilinxCamera to Xilinx

status(3) = 1status(3) = 1status(4-7) = command(lowbyte)status(4-7) = command(lowbyte)

status(3) = 0status(3) = 0status(4-7) = command(highbyte)status(4-7) = command(highbyte)

Page 30: The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2

Camera OperationCamera Operation

ResetResetCommand(brightness)Command(brightness)Command(brightness_value)Command(brightness_value)Command(contrast)Command(contrast)Command(contrast_value)Command(contrast_value)Command(white_balance)Command(white_balance)Command(white_balance_valuCommand(white_balance_valu

e)e)Command(resolution)Command(resolution)Command(resolution_value)Command(resolution_value)Command(get_byte)Command(get_byte)

• Timeouts vary for each Timeouts vary for each commandcommand

• repeat get_byte for the repeat get_byte for the number of pixels specified number of pixels specified by resolutionby resolution

Page 31: The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2

Driving the CameraDriving the Camera

• Using VerilogUsing Verilog

• Asynchronous Design ProblemAsynchronous Design Problem

• State MachinesState Machines

• SubroutinesSubroutines

Page 32: The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2

VerilogVerilog

• BenefitsBenefits– AsynchronousAsynchronous

– C type languageC type language

• DrawbacksDrawbacks– AsynchronousAsynchronous

– Only modular logic (no while, until, or Only modular logic (no while, until, or for)for)

Page 33: The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2

Asynchronous Design SolutionAsynchronous Design Solution

• Input a clockInput a clock

• Create States - Large State MachineCreate States - Large State Machine

• Have Next State, Present StateHave Next State, Present State

• On clock edge, Present State = Next On clock edge, Present State = Next StateState

Page 34: The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2

State MachineState Machine

State1

State2

State3

State4

Drawbacks:Drawbacks:

•MANY statesMANY states

•repetitiverepetitive

Page 35: The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2

Eliminate Drawbacks with Eliminate Drawbacks with SubroutinesSubroutines

State1

State2

Sub1

Sub1

Sub1

Sub1

Page 36: The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2

Eliminate Drawbacks with Eliminate Drawbacks with SubroutinesSubroutines

Example StateExample State scan_state4:scan_state4: beginbegin

command = 103;command = 103;stack = scan_state5;stack = scan_state5;timeout = timeout = command_timeout;command_timeout;NS = command_state1;NS = command_state1;

endend

• Input CommandInput Command• Set Stack for next Set Stack for next

StateState• Set Timeout for Set Timeout for

Individual Individual CommandCommand

• Set Next State Set Next State (NS) for subroutine(NS) for subroutine

Page 37: The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2

OutputOutput DataData

• Only to test outputOnly to test output

• Xilinx outputs data to BS2 (Basic Xilinx outputs data to BS2 (Basic STAMP)STAMP)– Only on get_byte commandsOnly on get_byte commands

– Uses subroutine within command Uses subroutine within command sequencesequence

• BS2 accepts data and outputs to a BS2 accepts data and outputs to a TerminalTerminal

Page 38: The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2
Page 39: The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2

Output continuedOutput continued

• Output to the SNIOutput to the SNI– Xilinx must send faster than SNI Xilinx must send faster than SNI

receivesreceives

– No need for memory buffer if timing No need for memory buffer if timing issues are resolvedissues are resolved

Page 40: The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2

ServerServer

• UDP protocolUDP protocol

• Captures raw data, writing to fileCaptures raw data, writing to file

• HEX values inverted for proper HEX values inverted for proper displaydisplay

Page 41: The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2

GIF ConversionGIF Conversion

• Converts raw data (02A9FD…) to Converts raw data (02A9FD…) to viewable GIFviewable GIF

• Viewable from anywhere with Web Viewable from anywhere with Web browserbrowser

Page 42: The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2

Web OutputWeb Output

• Portable: viewable from any Portable: viewable from any browserbrowser

• Rapid development time: develop Rapid development time: develop Web page and image filesWeb page and image files

• Ease of use: familiar to almost Ease of use: familiar to almost everyoneeveryone

Page 43: The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2

Server PushServer Push

• NT Workstation as server not NT Workstation as server not allowedallowed

• FTP image to remote Web serverFTP image to remote Web server

• Allows user to specify destination of Allows user to specify destination of datadata

• Output from CameraOutput from Camera

Page 44: The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2

ProblemsProblems

• Inverting raw data to correct valuesInverting raw data to correct values

• Output from Camera different than Output from Camera different than expectedexpected

Page 45: The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2

ChangesChanges

• FTP to remote server instead of FTP to remote server instead of local NT serverlocal NT server

• Used test client program to send Used test client program to send sample captured datasample captured data

• GIF to JPEG & back to GIFGIF to JPEG & back to GIF

Page 46: The NetCam Members Darin Keever Shannon McPhate Derek Leonard Jeff Nadeau Senior Design Project CPSC 483 Group 2

ConclusionConclusion

• Offered hands-on experience with Offered hands-on experience with hardware design and debugginghardware design and debugging

• Provided excellent teamwork Provided excellent teamwork experienceexperience

• Skills integrationSkills integration

• Presentation and documentation Presentation and documentation experienceexperience