Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC DEL 1ns 4cha
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
FMC DEL 1ns 4cha
Commits
c43e9ebc
Commit
c43e9ebc
authored
Nov 10, 2011
by
Tomasz Wlostowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
HDL: fd_spi_master: change MOSI status and sample MISO in between SCK edges
parent
5ba77508
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
8 deletions
+19
-8
fd_spi_master.vhd
hdl/rtl/fd_spi_master.vhd
+19
-8
No files found.
hdl/rtl/fd_spi_master.vhd
View file @
c43e9ebc
...
...
@@ -46,7 +46,7 @@ architecture behavioral of fd_spi_master is
signal
sreg
:
std_logic_vector
(
23
downto
0
);
signal
rx_sreg
:
std_logic_vector
(
23
downto
0
);
type
t_state
is
(
IDLE
,
TX_CS
,
TX_SCK1
,
TX_SCK2
,
TX_CS2
,
TX_GAP
);
type
t_state
is
(
IDLE
,
TX_CS
,
TX_
DAT1
,
TX_DAT2
,
TX_
SCK1
,
TX_SCK2
,
TX_CS2
,
TX_GAP
);
signal
state
:
t_state
;
signal
sclk
:
std_logic
;
...
...
@@ -88,7 +88,7 @@ begin -- rtl
else
case
state
is
when
IDLE
=>
sclk
<=
'
1
'
;
sclk
<=
'
0
'
;
counter
<=
(
others
=>
'0'
);
if
(
start_i
=
'1'
)
then
sreg
<=
data_i
;
...
...
@@ -101,26 +101,37 @@ begin -- rtl
when
TX_CS
=>
if
divider_muxed
=
'1'
then
state
<=
TX_
SCK
1
;
state
<=
TX_
DAT
1
;
end
if
;
when
TX_
SCK
1
=>
when
TX_
DAT
1
=>
if
(
divider_muxed
=
'1'
)
then
sclk
<=
not
sclk
;
spi_mosi_o
<=
sreg
(
sreg
'high
);
sreg
<=
sreg
(
sreg
'high
-1
downto
0
)
&
'0'
;
state
<=
TX_SCK1
;
end
if
;
when
TX_SCK1
=>
if
(
divider_muxed
=
'1'
)
then
sclk
<=
not
sclk
;
counter
<=
counter
+
1
;
state
<=
TX_
SCK
2
;
state
<=
TX_
DAT
2
;
end
if
;
when
TX_DAT2
=>
if
(
divider_muxed
=
'1'
)
then
rx_sreg
<=
rx_sreg
(
rx_sreg
'high
-1
downto
0
)
&
spi_miso_i
;
state
<=
TX_SCK2
;
end
if
;
when
TX_SCK2
=>
if
(
divider_muxed
=
'1'
)
then
sclk
<=
not
sclk
;
rx_sreg
<=
rx_sreg
(
rx_sreg
'high
-1
downto
0
)
&
spi_miso_i
;
if
(
counter
=
24
)
then
state
<=
TX_CS2
;
else
state
<=
TX_
SCK
1
;
state
<=
TX_
DAT
1
;
end
if
;
end
if
;
...
...
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