The NetCamThe NetCam
MembersDarin Keever
Shannon McPhateDerek Leonard
Jeff Nadeau
Senior Design ProjectCPSC 483Group 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.
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
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
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.
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
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
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
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
Components of ProjectComponents of Project
• Network InterfaceNetwork Interface
• Camera InterfaceCamera Interface
• External Network DevelopmentExternal Network Development
Network InterfaceNetwork Interface
• BackgroundBackground
• Xilinx ControllerXilinx Controller
• SNI/AUI ChipsetSNI/AUI Chipset
• TestingTesting
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
Xilinx ControllerXilinx Controller
• FunctionFunction
• Interface to CameraInterface to Camera
• Interface to SNIInterface to SNI
• Design DescriptionDesign Description
Xilinx ControllerXilinx Controller
SNI/AUI ChipsetSNI/AUI Chipset
• SNI DescriptionSNI Description
• AUI AUI
• CircuitryCircuitry
TestingTesting
• Logic DesignLogic Design
• Timing IssuesTiming Issues
• Hardware ProblemHardware Problem
Xilinx Circuit TestingXilinx Circuit Testing
• Xilinx software simulationXilinx software simulation
• Logic analyzer Logic analyzer
• OscilloscopeOscilloscope
SNI/AUI Circuit TestingSNI/AUI Circuit Testing
AAGHHHHH!AAGHHHHH!!!!!
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.
Testing ConfigurationsTesting Configurations
• ClockClock
• Loopback ModeLoopback Mode
• Select InputSelect Input
• Reduce current flowReduce current flow
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.
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
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;
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
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
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)
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
Driving the CameraDriving the Camera
• Using VerilogUsing Verilog
• Asynchronous Design ProblemAsynchronous Design Problem
• State MachinesState Machines
• SubroutinesSubroutines
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)
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
State MachineState Machine
State1
State2
State3
State4
Drawbacks:Drawbacks:
•MANY statesMANY states
•repetitiverepetitive
Eliminate Drawbacks with Eliminate Drawbacks with SubroutinesSubroutines
State1
State2
Sub1
Sub1
Sub1
Sub1
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
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
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
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
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
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
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
ProblemsProblems
• Inverting raw data to correct valuesInverting raw data to correct values
• Output from Camera different than Output from Camera different than expectedexpected
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
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
Top Related