Transcript Slide 1

Software Driver for ADV7800 Video Decoder
Nóirín Duggan
Supervisor: Fearghal Morgan
Analog Devices: Ray Carter
Dept. Electronic Engineering NUIG
23 April 2008
Format of Presentation
-> Project Outline
-> The software driver system
-> Implementation
-> Challenges
-> Outcome
Software Driver for ADV7800 Video Decoder
Project Outline
Nóirín Duggan
Dept. Electronic Engineering NUIG
3
Project Outline
Software Driver for ADV7800 Video Decoder
Nóirín Duggan
Dept. Electronic Engineering NUIG
Project Outline
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.
Software Driver for ADV7800 Video Decoder
Project Outline
Nóirín Duggan
Dept. Electronic Engineering NUIG
3
The Software Driver
System
Software Driver for ADV7800 Video Decoder
Nóirín Duggan
Dept. Electronic Engineering NUIG
The hardware elements of the System
Analog Standard
Definition interfaces:
S-Video/CVBS interface
transmitting PAL/NTSC/
SECAM
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
Spartan 3 board
UART, SRAM, Timer,
Pushbuttons
Spartan 3 board
ADV7800 Evaluation Board
RCA jack/Din
Connector
R
VC
D
/DV
uB
I2C communication lines
ADV7800
Push
Buttons
Encoder/
HDMI
GUI
TV
Software Driver for ADV7800 Video Decoder
Microblaze processor
32-bit Harvard
Reduced Instruction
Set Computer
architecture;
Only as much
processor as you
need!
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
The Software Driver System
Nóirín Duggan
Dept. Electronic Engineering NUIG
6
Software Driver System
Application
LAYER 4
Handler/Task Functions Library
LAYER 3
LAYER 2
Feature Functions Library
Register Access Function Library
LAYER 1
GPIO, I2C driver
LAYER 0
Software Driver for ADV7800 Video Decoder
The Software Driver System
Nóirín Duggan
Dept. Electronic Engineering NUIG
7
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
The Software Driver System
Nóirín Duggan
Dept. Electronic Engineering NUIG
8
Main Loop of System
Start
Initialise HW
System
InitMB()
Initialise SW
System
Init_sys()
Is Driver
Enabled?
Yes
Get Driver Mode
Get_sys_mode()
Is
mode==HRX
Yes
HRX_main()
No
ACP_Main()
Yes
Is mode
ACP?
No
Is Mode
SDP?
Yes
SDP_main()
UartCommandHandler()
PushButtonHandler()
Software Driver for ADV7800 Video Decoder
The Software Driver System
Nóirín Duggan
Dept. Electronic Engineering NUIG
9
Application System Controller -> Layer 0
Start
Get system
interface()
Graphics?
Set mode = SDP
Set interface = Svideo
Initialise SDP application
Component?
Svideo?
Set mode =ACP
Set interface =Graphics
Initialise ACP
application
Set mode = ACP
Set interface =
component
Initialise ACP application
Set mode = SDP
Set interface = CVBS
Initialise SDP
application
CVBS?
End
Software Driver for ADV7800 Video Decoder
The Software Driver System
Nóirín Duggan
Dept. Electronic Engineering NUIG
10
Application Initialiser
Start
Reset microblaze
Configure Interrupts
Connect Callback function
Initialise Decoder
Set up input interface
End
Software Driver for ADV7800 Video Decoder
The Software Driver System
Nóirín Duggan
Dept. Electronic Engineering NUIG
11
Flow of Control
Start
Initialise HW
System
InitMB()
Initialise SW
System
Init_sys()
Is Driver
Enabled?
Yes
Get Driver Mode
Get_sys_mode()
Is
mode==HRX
Yes
HRX_main()
Control is returned to
main loop, where the
user selected
application runs
No
ACP_Main()
Yes
Is mode
ACP?
No
Is Mode
SDP?
Yes
SDP_main()
UartCommandHandler()
PushButtonHandler()
Software Driver for ADV7800 Video Decoder
The Software Driver System
Nóirín Duggan
Dept. Electronic Engineering NUIG
12
Application Main
Start
Check if Interrupt
has occurred
Run SDP driver
interrupt handler
Has 10ms Timer
expired
Run SDP driver
video handler
Reset Timer
End
Software Driver for ADV7800 Video Decoder
The Software Driver System
Nóirín Duggan
Dept. Electronic Engineering NUIG
13
Software Driver Handler Functions
Application
LAYER 4
Handler/Task Functions Library
LAYER 3
LAYER 2
Feature Functions Library
Register Access Function Library
LAYER 1
GPIO, I2C driver
Software Driver Interrupt handler
LAYER 0
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
The Software Driver System
Nóirín Duggan
Dept. Electronic Engineering NUIG
14
Application Video Handler
Start
Configure ADV7800
Configure Evaluation board
devices
End
Software Driver for ADV7800 Video Decoder
The Software Driver System
Nóirín Duggan
Dept. Electronic Engineering NUIG
15
Graphical User Interface
Software Driver for ADV7800 Video Decoder
The Software Driver System
Nóirín Duggan
Dept. Electronic Engineering NUIG
16
Implementation
Methodology
Software Driver for ADV7800 Video Decoder
Nóirín Duggan
Dept. Electronic Engineering NUIG
General Strategy for implementation
•
Disassemble the project into its constituent subsystems
•
Solve individually
•
Glue together
Software Driver for ADV7800 Video Decoder
Implementation Methodology
Nóirín Duggan
Dept. Electronic Engineering NUIG
18
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
Implementation Methodology
Nóirín Duggan
Dept. Electronic Engineering NUIG
19
The blocks of the System
Application
Handler/Task Functions Library
Feature Functions Library
The Driver
Register Access Function Library
GPIO, I2C driver
Software Driver for ADV7800 Video Decoder
Implementation Methodology
Nóirín Duggan
Dept. Electronic Engineering NUIG
20
Mini Driver 1.0
Application
Handler/Task Functions Library
Feature Functions Library
The Driver
Mini driver1.0
Register Access Function Library
GPIO, I2C driver
Software Driver for ADV7800 Video Decoder
Implementation Methodology
Nóirín Duggan
Dept. Electronic Engineering NUIG
21
Mini Driver 2.0
Application
Handler/Task Functions Library
Feature Functions Library
The Driver
Mini driver1.0
Register Access Function Library
GPIO, I2C driver
Mini driver2.0
Lower level Application: microblaze
functions, push button handler etc
Software Driver for ADV7800 Video Decoder
Implementation Methodology
Nóirín Duggan
Dept. Electronic Engineering NUIG
22
SD driver 1.0
Application
Top Level Application: config Video
receiver etc
Handler/Task Functions Library
Feature Functions Library
The Driver
Mini driver1.0
Register Access Function Library
GPIO, I2C driver
SD driver1.0
Mini driver2.0
Lower level Application: microblaze
functions, push button handler etc
Software Driver for ADV7800 Video Decoder
Implementation Methodology
Nóirín Duggan
Dept. Electronic Engineering NUIG
23
SD driver 2.0
Application
Top Level Application: config Video
receiver etc
Handler/Task Functions Library
Feature Functions Library
The Driver
Mini driver1.0
Register Access Function Library
GPIO, I2C driver
SD driver1.0
SD_driver2.0
Mini driver2.0
Lower level Application: microblaze
functions, push button handler etc
Software Driver for ADV7800 Video Decoder
Implementation Methodology
Nóirín Duggan
Dept. Electronic Engineering NUIG
24
Implementation Methodology
Successful Strategy?
Software Driver for ADV7800 Video Decoder
Implementation Methodology
Nóirín Duggan
Dept. Electronic Engineering NUIG
25
Challenges
Software Driver for ADV7800 Video Decoder
Nóirín Duggan
Dept. Electronic Engineering NUIG
Challenges
•
No previous experience of either embedded system design/EDK tools or
microblaze
Software Driver for ADV7800 Video Decoder
Challenges
Nóirín Duggan
Dept. Electronic Engineering NUIG
27
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
Challenges
Nóirín Duggan
Dept. Electronic Engineering NUIG
28
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
Challenges
Nóirín Duggan
Dept. Electronic Engineering NUIG
29
Understanding the structure of the Driver
Application
LAYER 4
Handler/Task Functions Library
LAYER 3
LAYER 2
Feature Functions Library
Register Access Function Library
LAYER 1
GPIO, I2C driver
LAYER 0
Software Driver for ADV7800 Video Decoder
Challenges
Nóirín Duggan
Dept. Electronic Engineering NUIG
30
Summary of
Achievements
Software Driver for ADV7800 Video Decoder
Nóirín Duggan
Dept. Electronic Engineering NUIG
Summary of Achievements
•
Completed the spec
Software Driver for ADV7800 Video Decoder
Summary of Achievements
Nóirín Duggan
Dept. Electronic Engineering NUIG
31
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
Summary of Achievements
Nóirín Duggan
Dept. Electronic Engineering NUIG
32
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
Summary of Achievements
Nóirín Duggan
Dept. Electronic Engineering NUIG
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
•
Learned about software development i.e. creating reusable, portable
projects
Software Driver for ADV7800 Video Decoder
Summary of Achievements
Nóirín Duggan
Dept. Electronic Engineering NUIG
34
Conclusion
Software Driver for ADV7800 Video Decoder
Nóirín Duggan
Dept. Electronic Engineering NUIG