Presentation is loading. Please wait.

Presentation is loading. Please wait.

ECE Department: University of Massachusetts, Amherst ECE 354 Lab 4: Remote Control of a Digital Camera.

Similar presentations


Presentation on theme: "ECE Department: University of Massachusetts, Amherst ECE 354 Lab 4: Remote Control of a Digital Camera."— Presentation transcript:

1 ECE Department: University of Massachusetts, Amherst ECE 354 Lab 4: Remote Control of a Digital Camera

2 2 ECE 354 Big Picture Introduction  Transmit and Receive Ethernet packets between two DE2 boards  Use the 5-layer Internet model you implemented in lab 3 to communicate picture data between two DE2 boards  Use serial protocol developed in lab 2 to acquire picture data and perform image processing  Use a preexisting SOPC system from the DE2_NET project.

3 3 ECE 354 Skills to learn  Re-use previously written code  Understand simple network handshaking  Conform to a protocol specified by a third party  Inter-group communication  Implement a half-duplex Data-Link layer with error control

4 4 ECE 354 Additional Hardware  Two DE2 boards  Ethernet cable  Digital camera used in Lab 2  Extra VGA monitor

5 5 ECE 354 Overview of Lab  Similar procedure to lab 3  Request a snapshot (640x480 1-bit grey-scale) to be taken by a remotely located DE2 board  Also have the option of having the remote device do image processing before transmitting (as in lab 2 but now relayed over a network interface)

6 6 ECE 354 Modes of Operation  Device will run in 1 of 2 modes: Master Sends commands/requests to the slave, to take pictures or get pictures. Will use switches to select command codes. And a button will transmit command. Display images from the Slave on a VGA monitor. Slave Process commands/requests from the master. Be able to take pictures from the camera used in lab2  You are required to support both modes of operation in your code.

7 7 ECE 354 Handshaking Protocol  Slave mode is required to support 8 commands. These can be specified by the 3 least-significant switches on the master device. The command is sent by pressing a key of your choice.  Commands include: take snapshot, get image, and various forms of image processing  You are only required to implement 2 forms of image processing. Ambitious groups can do more.  A slave, on receiving an unsupported command, must reply to the master with a NAK (no acknowledge)

8 8 ECE 354 Commands / Requests (Layer 5) Bit# Switch position Command Name 76543210 xxxACK10101010 xxxNAK11111111 000 Take snapshot 00000000 001 Get raw image 00000001 010 Image Processing 1 00000010 011 Image Processing 2 00000011 100 Image Processing 3 00000100 101 Image Processing 4 00000101 110 Image Processing 5 00000110 111Image Processing 6 00000111

9 9 ECE 354 Handshaking Protocol  The master and slave device will indicate an ACK or NAK by lighting all of the green or red LEDs respectively.  The commands specified on the previous slide will be the payload of a 64 byte UDP-packet. Please see lab 3 for packet format information.

10 10 ECE 354 Example session of Handshaking Protocol MasterSlave Time Key: 1: Take snapshot 2: Get Data 3: Data 4: ACK 5: NAK or ACK 1 2 3 5 5

11 11 ECE 354 Data-link Layer Error Control  You will implement layer 2 error-control by acknowledging individual packets  Transmission may take place over multiple packets; each individual packet must be acknowledged  Set the payload of an ACK frame to: 0b11110000 (0xF0)  IMPORTANT: The ACK specified above is for layer 2 error control and has nothing to do with the handshaking protocol described earlier

12 12 ECE 354 Handshaking - Detailed View MasterSlave Time Key: 1: Take snapshot 2: Get Data 3: Data 4: ACK 5: NAK or ACK 6: Layer2 ACK 1 2 3 6 4 5 6 6 6* 6

13 13 ECE 354 Data-link Layer Error Control  After sending a packet, the master/slave will u_sleep for a fixed amount of time and then look for an ACK packet in their receive buffer.  If an ACK is not found, the frame recipient assumes data was corrupted.  This is similar to a busy-wait protocol with a fixed timeout.  Please calculate a suitable time-out value based on transmission size and link speed.  This process occurs within a receive or transmit function, and the handshaking protocol will never be aware of data-loss.

14 14 ECE 354 Error Control MasterSlave Time Key: 1: Take snapshot 2: Get Data 3: Data 4: ACK 5: NAK or ACK 6: Layer2 ACK 1 6 1

15 15 ECE 354 Gotchas  Image transmitted over network must follow a specific format to minimize network transmission time and avoid confusion  Format required is a 640x480 1-bit grey scale image, where each pixel is represented by 1-bit One byte contains 8 pixels. 640x480 Image is of size 38400 bytes. (76800 / 2)  Carefully adhere to the protocol defined by these slides  38400 bytes is too large for one packet. Sending an image will require more then one packet. Make sure to read headers to get size of data when reading an image off the network.

16 16 ECE 354 Image Display  The image sent to the master by the slave will be displayed on the VGA monitor attached to each device.  This is accomplished using the code from lab 2.  REMEMBER: The image you send across the data link must conform to the standard specified previously.

17 17 ECE 354 Comments and/or Questions


Download ppt "ECE Department: University of Massachusetts, Amherst ECE 354 Lab 4: Remote Control of a Digital Camera."

Similar presentations


Ads by Google