Skip to content

Commit

Permalink
Merge pull request #33 from gsomlo/gls-fix-at-50MHz
Browse files Browse the repository at this point in the history
RFC: phy: restore operation at lower (50MHz) sys-clk-freq
  • Loading branch information
enjoy-digital authored May 28, 2024
2 parents 73f1f34 + c050ce9 commit a053251
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions litesdcard/phy.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ def __init__(self):
# SDCard CE Generation.
clk_d = Signal()
self.sync += clk_d.eq(clk)
self.sync += self.ce.eq(clk & ~clk_d)
self.comb += self.ce.eq(clk & ~clk_d)

# Ensure we don't get short pulses on the SDCard Clk.
ce_delayed = Signal()
ce_latched = Signal()
self.sync += If(clk_d, ce_delayed.eq(self.clk_en))
self.comb += If(clk_d, ce_latched.eq(self.clk_en)).Else(ce_latched.eq(ce_delayed))
self.sync += self.clk.eq(~clk & ce_latched)
self.comb += self.clk.eq(~clk & ce_latched)

# SDCard PHY Read ----------------------------------------------------------------------------------

Expand Down

0 comments on commit a053251

Please sign in to comment.