Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
Platform-independent core collection
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
18
Issues
18
List
Board
Labels
Milestones
Merge Requests
5
Merge Requests
5
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Platform-independent core collection
Commits
434f1546
Commit
434f1546
authored
Jun 10, 2023
by
li hongming
Committed by
Maciej Lipinski
Nov 29, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add dac_sel for gc_serial_dac.vhd
parent
dcc7cc33
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
2 deletions
+20
-2
gc_serial_dac.vhd
modules/common/gc_serial_dac.vhd
+19
-2
gencores_pkg.vhd
modules/common/gencores_pkg.vhd
+1
-0
No files found.
modules/common/gc_serial_dac.vhd
View file @
434f1546
...
...
@@ -34,6 +34,7 @@
-- 2010-02-25 1.1 twlostow Modified for rev 1.1 switch
-- 2016-08-24 1.2 jpospisi removed synchronous reset from
-- sensitivity lists
-- 2023-11-29 1.3 lihm added select to support
-------------------------------------------------------------------------------
library
IEEE
;
...
...
@@ -76,6 +77,7 @@ entity gc_serial_dac is
dac_cs_n_o
:
out
std_logic_vector
(
g_num_cs_select
-1
downto
0
);
dac_sclk_o
:
out
std_logic
;
dac_sdata_o
:
out
std_logic
;
dac_sel_i
:
in
std_logic_vector
(
2
downto
0
)
:
=
"000"
;
-- when 1, the SPI interface is busy sending data to the DAC.
busy_o
:
out
std_logic
...
...
@@ -96,6 +98,8 @@ architecture syn of gc_serial_dac is
signal
divider_muxed
:
std_logic
;
signal
cs_sel_reg
:
std_logic_vector
(
g_num_cs_select
-1
downto
0
);
signal
dac_sel
:
std_logic_vector
(
2
downto
0
);
begin
...
...
@@ -167,6 +171,13 @@ begin
end
if
;
end
process
;
process
(
clk_i
)
begin
if
rising_edge
(
clk_i
)
then
dac_sel
<=
dac_sel_i
;
end
if
;
end
process
;
process
(
clk_i
)
begin
if
rising_edge
(
clk_i
)
then
...
...
@@ -175,8 +186,14 @@ begin
else
if
iValidValue
=
'1'
and
sendingData
=
'0'
then
cs_sel_reg
<=
cs_sel_i
;
dataSh
(
g_num_data_bits
-1
downto
0
)
<=
value_i
;
dataSh
(
dataSh
'left
downto
g_num_data_bits
)
<=
(
others
=>
'0'
);
if
(
dac_sel
=
b"001"
)
then
-- AD5683R
dataSh
(
dataSh
'left
downto
g_num_data_bits
+
4
)
<=
"0011"
;
dataSh
(
g_num_data_bits
+
4-1
downto
4
)
<=
value_i
;
dataSh
(
3
downto
0
)
<=
(
others
=>
'0'
);
else
-- AD5662
dataSh
(
g_num_data_bits
-1
downto
0
)
<=
value_i
;
dataSh
(
dataSh
'left
downto
g_num_data_bits
)
<=
(
others
=>
'0'
);
end
if
;
elsif
sendingData
=
'1'
and
divider_muxed
=
'1'
and
iDacClk
=
'0'
then
dataSh
(
0
)
<=
dataSh
(
dataSh
'left
);
dataSh
(
dataSh
'left
downto
1
)
<=
dataSh
(
dataSh
'left
-
1
downto
0
);
...
...
modules/common/gencores_pkg.vhd
View file @
434f1546
...
...
@@ -159,6 +159,7 @@ package gencores_pkg is
cs_sel_i
:
in
std_logic_vector
(
g_num_cs_select
-1
downto
0
);
load_i
:
in
std_logic
;
sclk_divsel_i
:
in
std_logic_vector
(
2
downto
0
);
dac_sel_i
:
in
std_logic_vector
(
2
downto
0
);
dac_cs_n_o
:
out
std_logic_vector
(
g_num_cs_select
-1
downto
0
);
dac_sclk_o
:
out
std_logic
;
dac_sdata_o
:
out
std_logic
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment