SlideShare ist ein Scribd-Unternehmen logo
1 von 22
Downloaden Sie, um offline zu lesen
CENG3430 Rapid Prototyping of Digital Systems
Lecture 06:
Use of Clock Sources and
Peripheral Modules on ZedBoard
Ming-Chang YANG
mcyang@cse.cuhk.edu.hk
Outline
• Clock Sources of ZedBoard
• Digilent Pmod™ Peripheral Modules
– Example: Seven Segment Display (Pmod SSD)
CENG3430 Lec06: Use of Clock Sources and Pmod on ZedBoard 2
Recall: What we have done in Lab04
• Serial-in-parallel-out Shift Register
CENG3430 Lec06: Use of Clock Sources and Pmod on ZedBoard 3
SW0: din
BTNC: clk
BTNR: rst
LD0~LD7: dout
How to use “real” clock resource(s) on ZedBoard?
Clock Sources on ZedBoard (1/2)
• Processing System
– PS subsystem uses a dedicated
33.3333 MHz clock source with
series termination.
• IC18, Fox 767-33.333333-12
– PS subsystem can generate up to
four phase-locked loop (PLL)
based clocks for the PL system.
• Programmable Logic
– An on-board 100 MHz oscillator
supplies the PL subsystem clock
input on bank 13, pin Y9.
• IC17, Fox 767-100-136
CENG3430 Lec06: Use of Clock Sources and Pmod on ZedBoard 4
http://zedboard.org/sites/default/files/documentations/ZedBoard_HW_UG_v2_2.pdf
https://www.electronics-tutorials.ws/oscillator/oscillators.html
Clock Sources on ZedBoard (2/2)
• To use the on-board 100 MHz clock input on bank 13,
pin Y9, you need to include the following in your XDC
constraint file:
set_property IOSTANDARD LVCMOS33 [get_ports clk]
set_property PACKAGE_PIN Y9 [get_ports clk]
create_clock -period 10 [get_ports clk]
Note:
• The constraint -period 10 is only used to inform the tool that clock
period is 10 ns (i.e., 100 MHz).
• The constraint -period 10 is NOT used specify or generate a
different clock period from a given clock source.
CENG3430 Lec06: Use of Clock Sources and Pmod on ZedBoard 5
http://zedboard.org/content/changing-frequency-clock-using-createclock
Clocks of Different Frequencies (1/2)
• In practice, we often need clocks of different rates.
• Example: How to create a 1 KHz clock from the on-
board 100 MHz oscillator (clk)?
CENG3430 Lec06: Use of Clock Sources and Pmod on ZedBoard 6
… … …
…
100 MHz
Clock
1 second
100 M x
100 M / 1 K = 100,000 x
1 ms
…
1 KHz
Clock
1 K x
Clocks of Different Frequencies (2/2)
• Trick: If we make a counter (count) that counts n
cycles, then we can generate a pulse (ms_pulse)
when the counter is at any particular value n.
CENG3430 Lec06: Use of Clock Sources and Pmod on ZedBoard 7
signal ms_pulse: STD_LOGIC:='0';
signal count: integer:=0;
process(clk)
begin
if rising_edge(clk) then
if (count = (50000-1)) then
ms_pulse <= not ms_pulse;
count <= 0; -- reset count
else
count <= count + 1;
end if;
end if;
end process;
…
100 MHz
Clock
1 ms
1 KHz
Clock
100 M / 1 K = 100,000 x
ms_pulse
Class Exercise 6.1
• Write the code to create a 50 Hz clock from the on-
board 100 MHz oscillator (clk).
CENG3430 Lec06: Use of Clock Sources and Pmod on ZedBoard 8
Student ID:
Name:
Date:
Clock Divider: Generate Your Clock!
-- generate 1ms and 1s clocks
process(clk)
begin
if rising_edge(clk) then
if (s_count = 49999999) then
s_pulse <= not s_pulse;
s_count <= 0;
else
s_count <= s_count + 1;
end if;
if (ms_count = 49999) then
ms_pulse <= not ms_pulse;
ms_count <= 0;
else
ms_count <= ms_count + 1;
end if;
end if;
end process;
CENG3430 Lec06: Use of Clock Sources and Pmod on ZedBoard 10
-- 1s synchronous process
process(s_pulse)
begin
if rising_edge(s_pulse) then
...
end if;
end process;
-- 1ms synchronous process
process(ms_pulse)
begin
if rising_edge(ms_pulse) then
...
end if;
end process;
Outline
• Clock Sources of ZedBoard
• Digilent Pmod™ Peripheral Modules
– Example: Seven Segment Display (Pmod SSD)
CENG3430 Lec06: Use of Clock Sources and Pmod on ZedBoard 11
Digilent Pmod™ Peripheral Modules
• Pmod™ devices are Digilent’s line of small I/O
interface boards.
– That offer an ideal way to extend the capabilities of
programmable logic and embedded control boards.
• Pmod modules communicate with system boards
using 6, 8, or 12-pin connectors.
CENG3430 Lec06: Use of Clock Sources and Pmod on ZedBoard 12
https://store.digilentinc.com/pmod-modules-connectors/
Pmod Ports on ZedBoard (1/3)
• ZedBoard has five Pmod™ compatible headers (2x6).
CENG3430 Lec06: Use of Clock Sources and Pmod on ZedBoard 13
JA1
JB1
JC1
JD1
JE1
Eight user I/O
Two 3.3V signals
Two ground signals
Pmod Ports on ZedBoard (2/3)
• Four Pmod connectors (JA1, JB1, JC1
and JD1) interface to the PL-side of
the Zynq-7000 AP SoC.
– JA1~JD1 connect to Bank 13 (3.3V).
– JA1~JD1 are placed in adjacent pairs on
the board edge.
• The clearance between JA1 and JB1 and
between JC1 and JD1 are both 10mm.
– JC1 and JD1 are aligned in a dual
configuration and routed differentially.
• To support LVDS running at 525Mbs.
• Pmod (JE1) connects to the PS-side
on MIO pins [0,9-15] in MIO Bank
0/500 (3.3V).
CENG3430 Lec06: Use of Clock Sources and Pmod on ZedBoard 14
JA1
JB1
JC1
JD1
JE1
10mm
10mm
Pmod Ports on ZedBoard (3/3)
CENG3430 Lec06: Use of Clock Sources and Pmod on ZedBoard 15
http://zedboard.org/sites/default/files/docu
mentations/ZedBoard_HW_UG_v2_2.pdf
Example: Pmod Seven Segment Display
• Product Description
– The Pmod SSD is a two-digit seven-segment display.
– Users can toggle through GPIO signals which digit is
currently on at a rate of 50 Hz or greater.
• To achieve persistence-of-vision to give the effect of both digits
being lit up simultaneously.
CENG3430 Lec06: Use of Clock Sources and Pmod on ZedBoard 16
https://store.digilentinc.com/pmod-ssd-seven-segment-display/
Pmod SSD: Connect to ZedBoard
CENG3430 Lec06: Use of Clock Sources and Pmod on ZedBoard 17
Pmod SSD: Time Multiplexing
• The two-digit displays share the same seven pins to
control the seven segments of each display
– One pin (e.g., sel) is to select which display to drive.
1: left digit
0: right digit
• To display both digits, we need to alternate between
the two digits faster than the eye can perceive.
– It look like both digits are displayed at the same time.
– For example, activate the 7-segment on the right then left at
a rate of 50 Hz and so on. (how to?)
CENG3430 Lec06: Use of Clock Sources and Pmod on ZedBoard 18
Pmod SSD: Pinout Description Table
CENG3430 Lec06: Use of Clock Sources and Pmod on ZedBoard 19
https://store.digilentinc.com/pmod-ssd-seven-segment-display/
ssd
ssd
sel
Pmod SSD: LED Mapping and Activation
• Each digit has seven LEDs, labeled A through G.
• To make the digits? Activating LED values as below:
CENG3430 Lec06: Use of Clock Sources and Pmod on ZedBoard 20
Digit Segments Value (ssd)
0 A B C D E F “1111110”
1 B C “0110000”
2 A B D E G “1101101”
3 A B C D G “1111001”
4 B C F G “0110011”
5 A C D F G “1011011”
6 A C D E F G “1011111”
7 A B C “1110000”
8 A B C D E F G “1111111”
9 A B C F G “1110011”
Pmod SSD: XDC Constraint File
• To drive the Pmod SSD, you also need the following:
set_property IOSTANDARD LVCMOS33 [get_ports ssd]
set_property PACKAGE_PIN Y11 [get_ports {ssd[6]}]
set_property PACKAGE_PIN AA11 [get_ports {ssd[5]}]
set_property PACKAGE_PIN Y10 [get_ports {ssd[4]}]
set_property PACKAGE_PIN AA9 [get_ports {ssd[3]}]
set_property PACKAGE_PIN W12 [get_ports {ssd[2]}]
set_property PACKAGE_PIN W11 [get_ports {ssd[1]}]
set_property PACKAGE_PIN V10 [get_ports {ssd[0]}]
set_property IOSTANDARD LVCMOS33 [get_ports sel]
set_property PACKAGE_PIN W8 [get_ports sel]
CENG3430 Lec06: Use of Clock Sources and Pmod on ZedBoard 21
Digit
Selection
(sel)
Seven
Segments
(ssd)
Class Exercise 6.2
• Show how to activate the
LED values (ssd) for
hexadecimal digits:
A, b, C, d, E, F.
CENG3430 Lec06: Use of Clock Sources and Pmod on ZedBoard 22
Student ID:
Name:
Date:
Digit Segments Value (ssd)
0 A B C D E F “1111110”
1 B C “0110000”
2 A B D E G “1101101”
3 A B C D G “1111001”
4 B C F G “0110011”
5 A C D F G “1011011”
6 A C D E F G “1011111”
7 A B C “1110000”
8 A B C D E F G “1111111”
9 A B C F G “1110011”
A
b
C
d
E
F
Summary
• Clock Sources of ZedBoard
• Digilent Pmod™ Peripheral Modules
– Example: Seven Segment Display (Pmod SSD)
CENG3430 Lec06: Use of Clock Sources and Pmod on ZedBoard 24

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

RT linux
RT linuxRT linux
RT linux
 
FPGA Configuration
FPGA ConfigurationFPGA Configuration
FPGA Configuration
 
Design challenges in physical design
Design challenges in physical designDesign challenges in physical design
Design challenges in physical design
 
MicroC/OS-II
MicroC/OS-IIMicroC/OS-II
MicroC/OS-II
 
VHDL-PRESENTATION.ppt
VHDL-PRESENTATION.pptVHDL-PRESENTATION.ppt
VHDL-PRESENTATION.ppt
 
STM32 MCU Family
STM32 MCU FamilySTM32 MCU Family
STM32 MCU Family
 
LDPC - Low Density Parity Check Matrix
LDPC - Low Density Parity Check MatrixLDPC - Low Density Parity Check Matrix
LDPC - Low Density Parity Check Matrix
 
Vlsi interview questions1
Vlsi  interview questions1Vlsi  interview questions1
Vlsi interview questions1
 
Power Gating
Power GatingPower Gating
Power Gating
 
Nmos design using synopsys TCAD tool
Nmos design using synopsys TCAD toolNmos design using synopsys TCAD tool
Nmos design using synopsys TCAD tool
 
9 semiconductor memory
9 semiconductor memory9 semiconductor memory
9 semiconductor memory
 
UNIT 3.docx
UNIT 3.docxUNIT 3.docx
UNIT 3.docx
 
Digital Design Flow
Digital Design FlowDigital Design Flow
Digital Design Flow
 
Vlsi physical design-notes
Vlsi physical design-notesVlsi physical design-notes
Vlsi physical design-notes
 
vedic mathematics based MAC unit
vedic mathematics based MAC unitvedic mathematics based MAC unit
vedic mathematics based MAC unit
 
Nand 4011 design
Nand 4011 designNand 4011 design
Nand 4011 design
 
Introduction to FPGAs
Introduction to FPGAsIntroduction to FPGAs
Introduction to FPGAs
 
VLSI lab manual
VLSI lab manualVLSI lab manual
VLSI lab manual
 
ASIC vs SOC vs FPGA
ASIC  vs SOC  vs FPGAASIC  vs SOC  vs FPGA
ASIC vs SOC vs FPGA
 
Design of IIR filters
Design of IIR filtersDesign of IIR filters
Design of IIR filters
 

Ähnlich wie Clock Sources on ZedBoard.pdf

Digital Alarm Clock 446 project report
Digital Alarm Clock 446 project reportDigital Alarm Clock 446 project report
Digital Alarm Clock 446 project reportAkash Mhankale
 
student_pres120202final
student_pres120202finalstudent_pres120202final
student_pres120202finalJohn Marquis
 
**Understanding_CTS_Log_Messages.pdf
**Understanding_CTS_Log_Messages.pdf**Understanding_CTS_Log_Messages.pdf
**Understanding_CTS_Log_Messages.pdfagnathavasi
 
Tft touch screen manufacturers
Tft touch screen manufacturersTft touch screen manufacturers
Tft touch screen manufacturersKeatonParker2
 
summer training report (2)
summer training report (2)summer training report (2)
summer training report (2)Kavya Gupta
 
Lalit Singh FPGA resume
Lalit Singh FPGA resumeLalit Singh FPGA resume
Lalit Singh FPGA resumeLalit singh
 
POLYTEDA PowerDRC/LVS overview
POLYTEDA PowerDRC/LVS overviewPOLYTEDA PowerDRC/LVS overview
POLYTEDA PowerDRC/LVS overviewAlexander Grudanov
 
PSC9131UG_C4_FD
PSC9131UG_C4_FDPSC9131UG_C4_FD
PSC9131UG_C4_FDHaim Amir
 
Real Time Clock Interfacing with FPGA
Real Time Clock Interfacing with FPGAReal Time Clock Interfacing with FPGA
Real Time Clock Interfacing with FPGAMafaz Ahmed
 
Embedded Recipes 2019 - Introduction to JTAG debugging
Embedded Recipes 2019 - Introduction to JTAG debuggingEmbedded Recipes 2019 - Introduction to JTAG debugging
Embedded Recipes 2019 - Introduction to JTAG debuggingAnne Nicolas
 
Snake Game on FPGA in Verilog
Snake Game on FPGA in VerilogSnake Game on FPGA in Verilog
Snake Game on FPGA in VerilogKrishnajith S S
 
Embedded Systems,Embedded Systems Project,Winter training,
Embedded Systems,Embedded Systems Project,Winter training,Embedded Systems,Embedded Systems Project,Winter training,
Embedded Systems,Embedded Systems Project,Winter training,Technogroovy
 

Ähnlich wie Clock Sources on ZedBoard.pdf (20)

Digital Alarm Clock 446 project report
Digital Alarm Clock 446 project reportDigital Alarm Clock 446 project report
Digital Alarm Clock 446 project report
 
chapter 4
chapter 4chapter 4
chapter 4
 
pandu-vivek (1)
pandu-vivek (1)pandu-vivek (1)
pandu-vivek (1)
 
report cs
report csreport cs
report cs
 
student_pres120202final
student_pres120202finalstudent_pres120202final
student_pres120202final
 
**Understanding_CTS_Log_Messages.pdf
**Understanding_CTS_Log_Messages.pdf**Understanding_CTS_Log_Messages.pdf
**Understanding_CTS_Log_Messages.pdf
 
Embedded system
Embedded systemEmbedded system
Embedded system
 
Tft touch screen manufacturers
Tft touch screen manufacturersTft touch screen manufacturers
Tft touch screen manufacturers
 
summer training report (2)
summer training report (2)summer training report (2)
summer training report (2)
 
Micro-controllers (PIC) based Application Development
Micro-controllers (PIC) based Application DevelopmentMicro-controllers (PIC) based Application Development
Micro-controllers (PIC) based Application Development
 
Lalit Singh FPGA resume
Lalit Singh FPGA resumeLalit Singh FPGA resume
Lalit Singh FPGA resume
 
POLYTEDA PowerDRC/LVS overview
POLYTEDA PowerDRC/LVS overviewPOLYTEDA PowerDRC/LVS overview
POLYTEDA PowerDRC/LVS overview
 
PSC9131UG_C4_FD
PSC9131UG_C4_FDPSC9131UG_C4_FD
PSC9131UG_C4_FD
 
Analog to Digital Converter
Analog to Digital ConverterAnalog to Digital Converter
Analog to Digital Converter
 
Bidirect visitor counter
Bidirect visitor counterBidirect visitor counter
Bidirect visitor counter
 
Real Time Clock Interfacing with FPGA
Real Time Clock Interfacing with FPGAReal Time Clock Interfacing with FPGA
Real Time Clock Interfacing with FPGA
 
Embedded Recipes 2019 - Introduction to JTAG debugging
Embedded Recipes 2019 - Introduction to JTAG debuggingEmbedded Recipes 2019 - Introduction to JTAG debugging
Embedded Recipes 2019 - Introduction to JTAG debugging
 
Snake Game on FPGA in Verilog
Snake Game on FPGA in VerilogSnake Game on FPGA in Verilog
Snake Game on FPGA in Verilog
 
Esd module2
Esd module2Esd module2
Esd module2
 
Embedded Systems,Embedded Systems Project,Winter training,
Embedded Systems,Embedded Systems Project,Winter training,Embedded Systems,Embedded Systems Project,Winter training,
Embedded Systems,Embedded Systems Project,Winter training,
 

Kürzlich hochgeladen

On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxPooja Bhuva
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...Amil baba
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 

Kürzlich hochgeladen (20)

On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 

Clock Sources on ZedBoard.pdf

  • 1. CENG3430 Rapid Prototyping of Digital Systems Lecture 06: Use of Clock Sources and Peripheral Modules on ZedBoard Ming-Chang YANG mcyang@cse.cuhk.edu.hk
  • 2. Outline • Clock Sources of ZedBoard • Digilent Pmod™ Peripheral Modules – Example: Seven Segment Display (Pmod SSD) CENG3430 Lec06: Use of Clock Sources and Pmod on ZedBoard 2
  • 3. Recall: What we have done in Lab04 • Serial-in-parallel-out Shift Register CENG3430 Lec06: Use of Clock Sources and Pmod on ZedBoard 3 SW0: din BTNC: clk BTNR: rst LD0~LD7: dout How to use “real” clock resource(s) on ZedBoard?
  • 4. Clock Sources on ZedBoard (1/2) • Processing System – PS subsystem uses a dedicated 33.3333 MHz clock source with series termination. • IC18, Fox 767-33.333333-12 – PS subsystem can generate up to four phase-locked loop (PLL) based clocks for the PL system. • Programmable Logic – An on-board 100 MHz oscillator supplies the PL subsystem clock input on bank 13, pin Y9. • IC17, Fox 767-100-136 CENG3430 Lec06: Use of Clock Sources and Pmod on ZedBoard 4 http://zedboard.org/sites/default/files/documentations/ZedBoard_HW_UG_v2_2.pdf https://www.electronics-tutorials.ws/oscillator/oscillators.html
  • 5. Clock Sources on ZedBoard (2/2) • To use the on-board 100 MHz clock input on bank 13, pin Y9, you need to include the following in your XDC constraint file: set_property IOSTANDARD LVCMOS33 [get_ports clk] set_property PACKAGE_PIN Y9 [get_ports clk] create_clock -period 10 [get_ports clk] Note: • The constraint -period 10 is only used to inform the tool that clock period is 10 ns (i.e., 100 MHz). • The constraint -period 10 is NOT used specify or generate a different clock period from a given clock source. CENG3430 Lec06: Use of Clock Sources and Pmod on ZedBoard 5 http://zedboard.org/content/changing-frequency-clock-using-createclock
  • 6. Clocks of Different Frequencies (1/2) • In practice, we often need clocks of different rates. • Example: How to create a 1 KHz clock from the on- board 100 MHz oscillator (clk)? CENG3430 Lec06: Use of Clock Sources and Pmod on ZedBoard 6 … … … … 100 MHz Clock 1 second 100 M x 100 M / 1 K = 100,000 x 1 ms … 1 KHz Clock 1 K x
  • 7. Clocks of Different Frequencies (2/2) • Trick: If we make a counter (count) that counts n cycles, then we can generate a pulse (ms_pulse) when the counter is at any particular value n. CENG3430 Lec06: Use of Clock Sources and Pmod on ZedBoard 7 signal ms_pulse: STD_LOGIC:='0'; signal count: integer:=0; process(clk) begin if rising_edge(clk) then if (count = (50000-1)) then ms_pulse <= not ms_pulse; count <= 0; -- reset count else count <= count + 1; end if; end if; end process; … 100 MHz Clock 1 ms 1 KHz Clock 100 M / 1 K = 100,000 x ms_pulse
  • 8. Class Exercise 6.1 • Write the code to create a 50 Hz clock from the on- board 100 MHz oscillator (clk). CENG3430 Lec06: Use of Clock Sources and Pmod on ZedBoard 8 Student ID: Name: Date:
  • 9. Clock Divider: Generate Your Clock! -- generate 1ms and 1s clocks process(clk) begin if rising_edge(clk) then if (s_count = 49999999) then s_pulse <= not s_pulse; s_count <= 0; else s_count <= s_count + 1; end if; if (ms_count = 49999) then ms_pulse <= not ms_pulse; ms_count <= 0; else ms_count <= ms_count + 1; end if; end if; end process; CENG3430 Lec06: Use of Clock Sources and Pmod on ZedBoard 10 -- 1s synchronous process process(s_pulse) begin if rising_edge(s_pulse) then ... end if; end process; -- 1ms synchronous process process(ms_pulse) begin if rising_edge(ms_pulse) then ... end if; end process;
  • 10. Outline • Clock Sources of ZedBoard • Digilent Pmod™ Peripheral Modules – Example: Seven Segment Display (Pmod SSD) CENG3430 Lec06: Use of Clock Sources and Pmod on ZedBoard 11
  • 11. Digilent Pmod™ Peripheral Modules • Pmod™ devices are Digilent’s line of small I/O interface boards. – That offer an ideal way to extend the capabilities of programmable logic and embedded control boards. • Pmod modules communicate with system boards using 6, 8, or 12-pin connectors. CENG3430 Lec06: Use of Clock Sources and Pmod on ZedBoard 12 https://store.digilentinc.com/pmod-modules-connectors/
  • 12. Pmod Ports on ZedBoard (1/3) • ZedBoard has five Pmod™ compatible headers (2x6). CENG3430 Lec06: Use of Clock Sources and Pmod on ZedBoard 13 JA1 JB1 JC1 JD1 JE1 Eight user I/O Two 3.3V signals Two ground signals
  • 13. Pmod Ports on ZedBoard (2/3) • Four Pmod connectors (JA1, JB1, JC1 and JD1) interface to the PL-side of the Zynq-7000 AP SoC. – JA1~JD1 connect to Bank 13 (3.3V). – JA1~JD1 are placed in adjacent pairs on the board edge. • The clearance between JA1 and JB1 and between JC1 and JD1 are both 10mm. – JC1 and JD1 are aligned in a dual configuration and routed differentially. • To support LVDS running at 525Mbs. • Pmod (JE1) connects to the PS-side on MIO pins [0,9-15] in MIO Bank 0/500 (3.3V). CENG3430 Lec06: Use of Clock Sources and Pmod on ZedBoard 14 JA1 JB1 JC1 JD1 JE1 10mm 10mm
  • 14. Pmod Ports on ZedBoard (3/3) CENG3430 Lec06: Use of Clock Sources and Pmod on ZedBoard 15 http://zedboard.org/sites/default/files/docu mentations/ZedBoard_HW_UG_v2_2.pdf
  • 15. Example: Pmod Seven Segment Display • Product Description – The Pmod SSD is a two-digit seven-segment display. – Users can toggle through GPIO signals which digit is currently on at a rate of 50 Hz or greater. • To achieve persistence-of-vision to give the effect of both digits being lit up simultaneously. CENG3430 Lec06: Use of Clock Sources and Pmod on ZedBoard 16 https://store.digilentinc.com/pmod-ssd-seven-segment-display/
  • 16. Pmod SSD: Connect to ZedBoard CENG3430 Lec06: Use of Clock Sources and Pmod on ZedBoard 17
  • 17. Pmod SSD: Time Multiplexing • The two-digit displays share the same seven pins to control the seven segments of each display – One pin (e.g., sel) is to select which display to drive. 1: left digit 0: right digit • To display both digits, we need to alternate between the two digits faster than the eye can perceive. – It look like both digits are displayed at the same time. – For example, activate the 7-segment on the right then left at a rate of 50 Hz and so on. (how to?) CENG3430 Lec06: Use of Clock Sources and Pmod on ZedBoard 18
  • 18. Pmod SSD: Pinout Description Table CENG3430 Lec06: Use of Clock Sources and Pmod on ZedBoard 19 https://store.digilentinc.com/pmod-ssd-seven-segment-display/ ssd ssd sel
  • 19. Pmod SSD: LED Mapping and Activation • Each digit has seven LEDs, labeled A through G. • To make the digits? Activating LED values as below: CENG3430 Lec06: Use of Clock Sources and Pmod on ZedBoard 20 Digit Segments Value (ssd) 0 A B C D E F “1111110” 1 B C “0110000” 2 A B D E G “1101101” 3 A B C D G “1111001” 4 B C F G “0110011” 5 A C D F G “1011011” 6 A C D E F G “1011111” 7 A B C “1110000” 8 A B C D E F G “1111111” 9 A B C F G “1110011”
  • 20. Pmod SSD: XDC Constraint File • To drive the Pmod SSD, you also need the following: set_property IOSTANDARD LVCMOS33 [get_ports ssd] set_property PACKAGE_PIN Y11 [get_ports {ssd[6]}] set_property PACKAGE_PIN AA11 [get_ports {ssd[5]}] set_property PACKAGE_PIN Y10 [get_ports {ssd[4]}] set_property PACKAGE_PIN AA9 [get_ports {ssd[3]}] set_property PACKAGE_PIN W12 [get_ports {ssd[2]}] set_property PACKAGE_PIN W11 [get_ports {ssd[1]}] set_property PACKAGE_PIN V10 [get_ports {ssd[0]}] set_property IOSTANDARD LVCMOS33 [get_ports sel] set_property PACKAGE_PIN W8 [get_ports sel] CENG3430 Lec06: Use of Clock Sources and Pmod on ZedBoard 21 Digit Selection (sel) Seven Segments (ssd)
  • 21. Class Exercise 6.2 • Show how to activate the LED values (ssd) for hexadecimal digits: A, b, C, d, E, F. CENG3430 Lec06: Use of Clock Sources and Pmod on ZedBoard 22 Student ID: Name: Date: Digit Segments Value (ssd) 0 A B C D E F “1111110” 1 B C “0110000” 2 A B D E G “1101101” 3 A B C D G “1111001” 4 B C F G “0110011” 5 A C D F G “1011011” 6 A C D E F G “1011111” 7 A B C “1110000” 8 A B C D E F G “1111111” 9 A B C F G “1110011” A b C d E F
  • 22. Summary • Clock Sources of ZedBoard • Digilent Pmod™ Peripheral Modules – Example: Seven Segment Display (Pmod SSD) CENG3430 Lec06: Use of Clock Sources and Pmod on ZedBoard 24