supervisor: fearghal morgan analog devices: ray carter dept. electronic engineering nuig 23 april...
TRANSCRIPT
Supervisor: Fearghal Morgan
Analog Devices: Ray Carter
Dept. Electronic Engineering NUIG
23 April 2008
Software Driver for ADV7800 Video Decoder
Nóirín Duggan
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
Software Driver for ADV7800 Video Decoder
Nóirín Duggan
Dept. Electronic Engineering NUIG
Project Outline
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
Software Driver for ADV7800 Video Decoder
Nóirín Duggan
Dept. Electronic Engineering NUIG
The Software Driver System
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
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
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
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()
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
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
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
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
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
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
Software Driver for ADV7800 Video Decoder
Nóirín Duggan
Dept. Electronic Engineering NUIG
The Software Driver System
16
Graphical User Interface
Software Driver for ADV7800 Video Decoder
Nóirín Duggan
Dept. Electronic Engineering NUIG
Implementation Methodology
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
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?
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
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
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
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
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
Software Driver for ADV7800 Video Decoder
Nóirín Duggan
Dept. Electronic Engineering NUIG
Implementation Methodology
25
Implementation Methodology
Successful Strategy?
Software Driver for ADV7800 Video Decoder
Nóirín Duggan
Dept. Electronic Engineering NUIG
Challenges
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
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
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
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
Software Driver for ADV7800 Video Decoder
Nóirín Duggan
Dept. Electronic Engineering NUIG
Summary of Achievements
Software Driver for ADV7800 Video Decoder
Nóirín Duggan
Dept. Electronic Engineering NUIG
Summary of Achievements
31
Summary of Achievements
• Completed the spec
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
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
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
Software Driver for ADV7800 Video Decoder
Nóirín Duggan
Dept. Electronic Engineering NUIG
Conclusion