Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
VHDL
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jack Driscoll
VHDL
Commits
b438526a
Commit
b438526a
authored
7 months ago
by
Jack Driscoll
Browse files
Options
Downloads
Patches
Plain Diff
can compile, fixed sensitivity list
parent
22371608
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
MSF/RTC/hdl/rtc.vhd
+15
-16
15 additions, 16 deletions
MSF/RTC/hdl/rtc.vhd
with
15 additions
and
16 deletions
MSF/RTC/hdl/rtc.vhd
+
15
−
16
View file @
b438526a
...
...
@@ -38,45 +38,44 @@ architecture behavioral of rtc is
begin
--Divide crystal oscillator down to 1Hz clock--
CLOCK_GEN
:
process
CLOCK_GEN
:
process
(
rst
,
time_ready
,
clk_crystal
)
begin
if
rst
=
'1'
then
--or start of pulse
crys_count
<=
0
;
crys_count
<=
(
others
=>
'0'
)
;
clk_second
<=
'1'
;
elsif
rising_edge
(
time_ready
)
then
--synchronise to msf
crys_count
<=
0
;
crys_count
<=
(
others
=>
'0'
)
;
clk_second
<=
'1'
;
elsif
rising_edge
(
clk_crystal
)
then
crys_count
<=
crys_count
+
1
;
if
crys_count
=
1
6383
then
if
crys_count
=
1
5
then
--16383 officially
clk_second
<=
not
(
clk_second
);
end
if
;
end
if
;
end
process
;
--Count seconds minutes and hours--
CLOCK_COUNT
:
process
CLOCK_COUNT
:
process
(
rst
,
time_ready
,
clk_second
)
begin
if
rst
=
'1'
then
second_int
<=
0
;
minute_int
<=
0
;
hour_int
<=
0
;
second_int
<=
(
others
=>
'0'
)
;
minute_int
<=
(
others
=>
'0'
)
;
hour_int
<=
(
others
=>
'0'
)
;
elsif
rising_edge
(
time_ready
)
then
--set time
second_int
<=
59
;
--assume data comes at 59 seconds
minute_int
<=
to_
unsigned
(
minute_in
);
hour_int
<=
to_
unsigned
(
hour_in
);
second_int
<=
"111011"
;
--assume data comes at 59 seconds
minute_int
<=
unsigned
(
minute_in
);
hour_int
<=
unsigned
(
hour_in
);
elsif
rising_edge
(
clk_second
)
then
if
second_int
=
59
then
second_int
<=
0
;
second_int
<=
(
others
=>
'0'
);
if
minute_int
=
59
then
minute_int
<=
0
;
minute_int
<=
(
others
=>
'0'
)
;
if
hour_int
=
23
then
hour_int
<=
0
;
hour_int
<=
(
others
=>
'0'
)
;
else
hour_int
<=
hour_int
+
1
;
end
if
;
...
...
@@ -87,7 +86,7 @@ architecture behavioral of rtc is
second_int
<=
second_int
+
1
;
end
if
;
end
if
;
end
process
end
process
;
--Concurrent assignments--
second_out
<=
std_logic_vector
(
second_int
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment