36
Supervisor: Fearghal Morgan Analog Devices: Ray Carter Dept. Electronic Engineering NUIG 23 April 2008 Software Driver for ADV7800 Video Decoder Nóirín Duggan

Supervisor: Fearghal Morgan Analog Devices: Ray Carter Dept. Electronic Engineering NUIG 23 April 2008 Software Driver for ADV7800 Video Decoder Nóirín

Embed Size (px)

Citation preview

Page 1: Supervisor: Fearghal Morgan Analog Devices: Ray Carter Dept. Electronic Engineering NUIG 23 April 2008 Software Driver for ADV7800 Video Decoder Nóirín

Supervisor: Fearghal Morgan

Analog Devices: Ray Carter

Dept. Electronic Engineering NUIG

23 April 2008

Software Driver for ADV7800 Video Decoder

Nóirín Duggan

Page 2: Supervisor: Fearghal Morgan Analog Devices: Ray Carter Dept. Electronic Engineering NUIG 23 April 2008 Software Driver for ADV7800 Video Decoder Nóirín

Project Outline

3

Software Driver for ADV7800 Video Decoder

Nóirín Duggan

Dept. Electronic Engineering NUIG

-> Project Outline

-> The software driver system

-> Implementation

-> Challenges

-> Outcome

Format of Presentation

Page 3: Supervisor: Fearghal Morgan Analog Devices: Ray Carter Dept. Electronic Engineering NUIG 23 April 2008 Software Driver for ADV7800 Video Decoder Nóirín

Software Driver for ADV7800 Video Decoder

Nóirín Duggan

Dept. Electronic Engineering NUIG

Project Outline

Page 4: Supervisor: Fearghal Morgan Analog Devices: Ray Carter Dept. Electronic Engineering NUIG 23 April 2008 Software Driver for ADV7800 Video Decoder Nóirín

Project Outline

3

Software Driver for ADV7800 Video Decoder

Nóirín Duggan

Dept. Electronic Engineering NUIG

The aim of this project was to create a basic operational software driver for the Standard Definition core of the ADV7800 Analog Devices video decoder which would dynamically configure the device when a CVBS or SVideo input is detected. The driver had to be clear, concise and portable allowing the end user to interact with the decoder without needing detailed knowledge of the part.

Project Outline

Page 5: Supervisor: Fearghal Morgan Analog Devices: Ray Carter Dept. Electronic Engineering NUIG 23 April 2008 Software Driver for ADV7800 Video Decoder Nóirín

Software Driver for ADV7800 Video Decoder

Nóirín Duggan

Dept. Electronic Engineering NUIG

The Software Driver System

Page 6: Supervisor: Fearghal Morgan Analog Devices: Ray Carter Dept. Electronic Engineering NUIG 23 April 2008 Software Driver for ADV7800 Video Decoder Nóirín

Software Driver for ADV7800 Video Decoder

Nóirín Duggan

Dept. Electronic Engineering NUIG

The Software Driver System

6

ADV7800

RCA jack/Din Connector

TV

Encoder/HDMI

GUI

VCR/DVD

uB

Push Buttons

Spartan 3 board

ADV7800 Evaluation Board

Analog Standard Definition interfaces:

S-Video/CVBS interface transmitting PAL/NTSC/

SECAM

GUI provides read back on device

driver, stating that it is running etc,,

source recognition, report on standard, quality of source,

read back on noise on input signal

Microblaze processor 32-bit Harvard

Reduced Instruction Set Computer architecture;

Only as much processor as you

need!

Spartan 3 boardUART, SRAM, Timer,

Pushbuttons

ADV7800 video decoder. Designed to showcase new 3D comb filter.

Supports SD standards NTSC, PAL, SECAM and component standards 525i, 625i, 525p, 625p, 720p, 1080i

and computer graphics modes

I2C communication lines

The hardware elements of the System

Page 7: Supervisor: Fearghal Morgan Analog Devices: Ray Carter Dept. Electronic Engineering NUIG 23 April 2008 Software Driver for ADV7800 Video Decoder Nóirín

Software Driver for ADV7800 Video Decoder

Nóirín Duggan

Dept. Electronic Engineering NUIG

The Software Driver System

7

Software Driver System

Handler/Task Functions LibraryLAYER 3

Feature Functions LibraryLAYER 2

Register Access Function LibraryLAYER 1

Application

GPIO, I2C driver

LAYER 0

LAYER 4

Page 8: Supervisor: Fearghal Morgan Analog Devices: Ray Carter Dept. Electronic Engineering NUIG 23 April 2008 Software Driver for ADV7800 Video Decoder Nóirín

Software Driver for ADV7800 Video Decoder

Nóirín Duggan

Dept. Electronic Engineering NUIG

The Software Driver System

8

User Interaction Model

Start

User -> Enables system-> Selects backend video processing device

User inserts interface cable

Driver configures decoder and other evaluation board

devices for selection

GUI provides readback information on driver

Page 9: Supervisor: Fearghal Morgan Analog Devices: Ray Carter Dept. Electronic Engineering NUIG 23 April 2008 Software Driver for ADV7800 Video Decoder Nóirín

Software Driver for ADV7800 Video Decoder

Nóirín Duggan

Dept. Electronic Engineering NUIG

The Software Driver System

9

Main Loop of System

Initialise HW System InitMB()

Start

Initialise SW System

Init_sys()

Is Driver Enabled?

Get Driver ModeGet_sys_mode()

Is mode==HRX

Is mode ACP?

Is Mode SDP?

PushButtonHandler()

SDP_main()

ACP_Main()

HRX_main()

Yes

Yes

No

Yes

No

Yes

UartCommandHandler()

Page 10: Supervisor: Fearghal Morgan Analog Devices: Ray Carter Dept. Electronic Engineering NUIG 23 April 2008 Software Driver for ADV7800 Video Decoder Nóirín

Software Driver for ADV7800 Video Decoder

Nóirín Duggan

Dept. Electronic Engineering NUIG

The Software Driver System

10

Application System Controller -> Layer 0

Start

Get system interface()

Graphics?

Component?

Svideo?

Set mode = ACPSet interface =

componentInitialise ACP application

Set mode = SDPSet interface = Svideo

Initialise SDP application

Set mode = SDPSet interface = CVBS

Initialise SDP application

CVBS?

Set mode =ACPSet interface =Graphics

Initialise ACP application

End

Page 11: Supervisor: Fearghal Morgan Analog Devices: Ray Carter Dept. Electronic Engineering NUIG 23 April 2008 Software Driver for ADV7800 Video Decoder Nóirín

Software Driver for ADV7800 Video Decoder

Nóirín Duggan

Dept. Electronic Engineering NUIG

The Software Driver System

11

Application Initialiser

Start

Reset microblaze

Configure Interrupts

Connect Callback function

Initialise Decoder

Set up input interface

End

Page 12: Supervisor: Fearghal Morgan Analog Devices: Ray Carter Dept. Electronic Engineering NUIG 23 April 2008 Software Driver for ADV7800 Video Decoder Nóirín

Software Driver for ADV7800 Video Decoder

Nóirín Duggan

Dept. Electronic Engineering NUIG

The Software Driver System

12

Flow of Control

Initialise HW System InitMB()

Start

Initialise SW System

Init_sys()

Is Driver Enabled?

Get Driver ModeGet_sys_mode()

Is mode==HRX

Is mode ACP?

Is Mode SDP?

PushButtonHandler()

SDP_main()

ACP_Main()

HRX_main()

Yes

Yes

No

Yes

No

Yes

UartCommandHandler()

Control is returned to main loop, where the

user selected application runs

Page 13: Supervisor: Fearghal Morgan Analog Devices: Ray Carter Dept. Electronic Engineering NUIG 23 April 2008 Software Driver for ADV7800 Video Decoder Nóirín

Software Driver for ADV7800 Video Decoder

Nóirín Duggan

Dept. Electronic Engineering NUIG

The Software Driver System

13

Application Main

Start

Run SDP driver interrupt handler

Has 10ms Timerexpired

Run SDP driver video handler

Reset Timer

End

Check if Interrupt has occurred

Page 14: Supervisor: Fearghal Morgan Analog Devices: Ray Carter Dept. Electronic Engineering NUIG 23 April 2008 Software Driver for ADV7800 Video Decoder Nóirín

Software Driver for ADV7800 Video Decoder

Nóirín Duggan

Dept. Electronic Engineering NUIG

The Software Driver System

14

Software Driver Handler Functions

Handler/Task Functions LibraryLAYER 3

Feature Functions LibraryLAYER 2

Register Access Function LibraryLAYER 1

Application

GPIO, I2C driver

LAYER 0

LAYER 4

Software Driver Interrupt handler

Called by application, reads status of standard definition video detect register, if set sets video state machine to video detected

Video Handler

Called by application, reads value of video state machine if valid video detected it retrieves standard identification from the decoder and passes it to application

Page 15: Supervisor: Fearghal Morgan Analog Devices: Ray Carter Dept. Electronic Engineering NUIG 23 April 2008 Software Driver for ADV7800 Video Decoder Nóirín

Software Driver for ADV7800 Video Decoder

Nóirín Duggan

Dept. Electronic Engineering NUIG

The Software Driver System

15

Application Video Handler

Start

Configure ADV7800

End

Configure Evaluation board devices

Page 16: Supervisor: Fearghal Morgan Analog Devices: Ray Carter Dept. Electronic Engineering NUIG 23 April 2008 Software Driver for ADV7800 Video Decoder Nóirín

Software Driver for ADV7800 Video Decoder

Nóirín Duggan

Dept. Electronic Engineering NUIG

The Software Driver System

16

Graphical User Interface

Page 17: Supervisor: Fearghal Morgan Analog Devices: Ray Carter Dept. Electronic Engineering NUIG 23 April 2008 Software Driver for ADV7800 Video Decoder Nóirín

Software Driver for ADV7800 Video Decoder

Nóirín Duggan

Dept. Electronic Engineering NUIG

Implementation Methodology

Page 18: Supervisor: Fearghal Morgan Analog Devices: Ray Carter Dept. Electronic Engineering NUIG 23 April 2008 Software Driver for ADV7800 Video Decoder Nóirín

Software Driver for ADV7800 Video Decoder

Nóirín Duggan

Dept. Electronic Engineering NUIG

Implementation Methodology

18

General Strategy for implementation

• Disassemble the project into its constituent subsystems

• Solve individually

• Glue together

Page 19: Supervisor: Fearghal Morgan Analog Devices: Ray Carter Dept. Electronic Engineering NUIG 23 April 2008 Software Driver for ADV7800 Video Decoder Nóirín

Software Driver for ADV7800 Video Decoder

Nóirín Duggan

Dept. Electronic Engineering NUIG

Implementation Methodology

19

General Strategy for implementation

• Disassemble the project into its constituent blocks

• Solve individually

• Glue together

What were the subsystems?

Page 20: Supervisor: Fearghal Morgan Analog Devices: Ray Carter Dept. Electronic Engineering NUIG 23 April 2008 Software Driver for ADV7800 Video Decoder Nóirín

Software Driver for ADV7800 Video Decoder

Nóirín Duggan

Dept. Electronic Engineering NUIG

Implementation Methodology

20

The blocks of the System

Handler/Task Functions Library

Feature Functions Library

Register Access Function Library

Application

GPIO, I2C driver

The Driver

Page 21: Supervisor: Fearghal Morgan Analog Devices: Ray Carter Dept. Electronic Engineering NUIG 23 April 2008 Software Driver for ADV7800 Video Decoder Nóirín

Software Driver for ADV7800 Video Decoder

Nóirín Duggan

Dept. Electronic Engineering NUIG

Implementation Methodology

21

Mini Driver 1.0

Handler/Task Functions Library

Feature Functions Library

Register Access Function Library

Application

GPIO, I2C driver

The Driver Mini driver1.0

Page 22: Supervisor: Fearghal Morgan Analog Devices: Ray Carter Dept. Electronic Engineering NUIG 23 April 2008 Software Driver for ADV7800 Video Decoder Nóirín

Software Driver for ADV7800 Video Decoder

Nóirín Duggan

Dept. Electronic Engineering NUIG

Implementation Methodology

22

Mini Driver 2.0

Handler/Task Functions Library

Feature Functions Library

Register Access Function Library

Application

GPIO, I2C driver

The Driver

Lower level Application: microblaze functions, push button handler etc

Mini driver1.0

Mini driver2.0

Page 23: Supervisor: Fearghal Morgan Analog Devices: Ray Carter Dept. Electronic Engineering NUIG 23 April 2008 Software Driver for ADV7800 Video Decoder Nóirín

Software Driver for ADV7800 Video Decoder

Nóirín Duggan

Dept. Electronic Engineering NUIG

Implementation Methodology

23

SD driver 1.0

Handler/Task Functions Library

Feature Functions Library

Register Access Function Library

Application

GPIO, I2C driver

The Driver

Top Level Application: config Video receiver etc

Lower level Application: microblaze functions, push button handler etc

Mini driver1.0

Mini driver2.0

SD driver1.0

Page 24: Supervisor: Fearghal Morgan Analog Devices: Ray Carter Dept. Electronic Engineering NUIG 23 April 2008 Software Driver for ADV7800 Video Decoder Nóirín

Software Driver for ADV7800 Video Decoder

Nóirín Duggan

Dept. Electronic Engineering NUIG

Implementation Methodology

24

SD driver 2.0

Handler/Task Functions Library

Feature Functions Library

Register Access Function Library

Application

GPIO, I2C driver

The Driver

Top Level Application: config Video receiver etc

Lower level Application: microblaze functions, push button handler etc

Mini driver1.0

Mini driver2.0

SD driver1.0 SD_driver2.0

Page 25: Supervisor: Fearghal Morgan Analog Devices: Ray Carter Dept. Electronic Engineering NUIG 23 April 2008 Software Driver for ADV7800 Video Decoder Nóirín

Software Driver for ADV7800 Video Decoder

Nóirín Duggan

Dept. Electronic Engineering NUIG

Implementation Methodology

25

Implementation Methodology

Successful Strategy?

Page 26: Supervisor: Fearghal Morgan Analog Devices: Ray Carter Dept. Electronic Engineering NUIG 23 April 2008 Software Driver for ADV7800 Video Decoder Nóirín

Software Driver for ADV7800 Video Decoder

Nóirín Duggan

Dept. Electronic Engineering NUIG

Challenges

Page 27: Supervisor: Fearghal Morgan Analog Devices: Ray Carter Dept. Electronic Engineering NUIG 23 April 2008 Software Driver for ADV7800 Video Decoder Nóirín

Software Driver for ADV7800 Video Decoder

Nóirín Duggan

Dept. Electronic Engineering NUIG

Challenges

27

Challenges

• No previous experience of either embedded system design/EDK tools or microblaze

Page 28: Supervisor: Fearghal Morgan Analog Devices: Ray Carter Dept. Electronic Engineering NUIG 23 April 2008 Software Driver for ADV7800 Video Decoder Nóirín

Software Driver for ADV7800 Video Decoder

Nóirín Duggan

Dept. Electronic Engineering NUIG

Challenges

28

Challenges

• No previous experience of either embedded system design/EDK tools or microblaze

• Limited knowledge of ADV7800 video decoder

Page 29: Supervisor: Fearghal Morgan Analog Devices: Ray Carter Dept. Electronic Engineering NUIG 23 April 2008 Software Driver for ADV7800 Video Decoder Nóirín

Software Driver for ADV7800 Video Decoder

Nóirín Duggan

Dept. Electronic Engineering NUIG

Challenges

29

Challenges

• No previous experience of either embedded system design/EDK tools or microblaze

• Limited knowledge of ADV7800 video decoder

• Limited experience of large software projects/device drivers/C programming

Page 30: Supervisor: Fearghal Morgan Analog Devices: Ray Carter Dept. Electronic Engineering NUIG 23 April 2008 Software Driver for ADV7800 Video Decoder Nóirín

Software Driver for ADV7800 Video Decoder

Nóirín Duggan

Dept. Electronic Engineering NUIG

Challenges

30

Understanding the structure of the Driver

Handler/Task Functions LibraryLAYER 3

Feature Functions LibraryLAYER 2

Register Access Function LibraryLAYER 1

Application

GPIO, I2C driver

LAYER 0

LAYER 4

Page 31: Supervisor: Fearghal Morgan Analog Devices: Ray Carter Dept. Electronic Engineering NUIG 23 April 2008 Software Driver for ADV7800 Video Decoder Nóirín

Software Driver for ADV7800 Video Decoder

Nóirín Duggan

Dept. Electronic Engineering NUIG

Summary of Achievements

Page 32: Supervisor: Fearghal Morgan Analog Devices: Ray Carter Dept. Electronic Engineering NUIG 23 April 2008 Software Driver for ADV7800 Video Decoder Nóirín

Software Driver for ADV7800 Video Decoder

Nóirín Duggan

Dept. Electronic Engineering NUIG

Summary of Achievements

31

Summary of Achievements

• Completed the spec

Page 33: Supervisor: Fearghal Morgan Analog Devices: Ray Carter Dept. Electronic Engineering NUIG 23 April 2008 Software Driver for ADV7800 Video Decoder Nóirín

Software Driver for ADV7800 Video Decoder

Nóirín Duggan

Dept. Electronic Engineering NUIG

Summary of Achievements

32

Summary of Achievements

• Completed the spec

• Learned how to use Xilinx tools to create a microblaze soft core processor

Page 34: Supervisor: Fearghal Morgan Analog Devices: Ray Carter Dept. Electronic Engineering NUIG 23 April 2008 Software Driver for ADV7800 Video Decoder Nóirín

Software Driver for ADV7800 Video Decoder

Nóirín Duggan

Dept. Electronic Engineering NUIG

Summary of Achievements

33

Summary of Achievements

• Completed the spec

• Learned how to use Xilinx tools to create a microblaze soft core processor

• Combined this with software element to create a viable embedded system for a real world application

Page 35: Supervisor: Fearghal Morgan Analog Devices: Ray Carter Dept. Electronic Engineering NUIG 23 April 2008 Software Driver for ADV7800 Video Decoder Nóirín

Software Driver for ADV7800 Video Decoder

Nóirín Duggan

Dept. Electronic Engineering NUIG

Summary of Achievements

34

Summary of Achievements

• Completed the spec

• Learned how to use Xilinx tools to create a microblaze soft core processor

• Combined this with software element to create a viable embedded system

• Learned about software development i.e. creating reusable, portable projects

Page 36: Supervisor: Fearghal Morgan Analog Devices: Ray Carter Dept. Electronic Engineering NUIG 23 April 2008 Software Driver for ADV7800 Video Decoder Nóirín

Software Driver for ADV7800 Video Decoder

Nóirín Duggan

Dept. Electronic Engineering NUIG

Conclusion