Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spi cpol0 cpha0 #85

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open

Spi cpol0 cpha0 #85

wants to merge 18 commits into from

Conversation

olajep
Copy link
Contributor

@olajep olajep commented May 27, 2016

Makes master/slave MODE=0 (CPOL=0 CPHA=0)
(The master transmitted in CPHA=0 but sampled in CPHA=1, similarly the slave sampled in CPHA=0 but transmitted in CPHA=1)

Works around XILINX issue w/ oh_fifo_sync (see #84)

  • other less important issues.

// Ola

olajep added 15 commits May 28, 2016 00:21
Solves issue with master STATUS[0] always high.

Signed-off-by: Ola Jeppsson <[email protected]>
Make sure neither synthesis or simulation can go through with an empty
block.

Signed-off-by: Ola Jeppsson <[email protected]>
Stabilizes output in simulation.

Signed-off-by: Ola Jeppsson <[email protected]>
Fixes iverilog warning.

Signed-off-by: Ola Jeppsson <[email protected]>
In CPOL=0 CPHA=0 (MODE=0) the master
outputs M0SI on the falling edge of SCLK, and
samples MISO on the rising  edge of SCLK.

Signed-off-by: Ola Jeppsson <[email protected]>
CPOL=0 CPHA=0 mode:
RX data is sampled on rising edge.
TX data is outputted on falling edge.

Between the first byte is received and the second byte should start
transmitting, we have a half clock cycle so we need to bypass the
deserializer for the last MOSI bit and grab it directly from the pin.

Signed-off-by: Ola Jeppsson <[email protected]>
Use oh_fifo_cdc for XILINX target.

oh_fifo_sync does work in simulation but it does not work when
synthesizing in Vivado (see aolofsson#84).

This also includes a hack that forces the FIFO depth/width to 32/104
when TARGET is set to "XILINX" (only available FIFO IP atm.).

Signed-off-by: Ola Jeppsson <[email protected]>
Should output
0x00fedcba98765432
to master receive FIFO register.

Signed-off-by: Ola Jeppsson <[email protected]>
Fixes iverilog warning.

Signed-off-by: Ola Jeppsson <[email protected]>
Allow setting SLEW rate in single-ended mode.

Signed-off-by: Ola Jeppsson <[email protected]>
@olajep olajep force-pushed the spi-cpol0-cpha0 branch 2 times, most recently from d9b3d85 to ac65c14 Compare May 29, 2016 20:31
Estimated values, seems close to HW limits though.
TX just barely misses 100 MHz timing.

Signed-off-by: Ola Jeppsson <[email protected]>
Ensure that SS=1 for at least one SCLK clock cycle between transfers.
Fixes race condition where the slave misses the end of transfer signal.

Signed-off-by: Ola Jeppsson <[email protected]>
@olajep olajep force-pushed the spi-cpol0-cpha0 branch 2 times, most recently from afdc3ec to 838c149 Compare May 29, 2016 22:46
aolofsson added a commit that referenced this pull request Aug 24, 2016
- Manually merging work from @olajep in PR #85 (too far out of sync)
- Fixing issue with lsbfirst logic
- Adding logic for manual control of slave select
- Fixing status register for polling reads
- Still a timing/glitch issue on mosi, fix it later...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant