Skip to content

Commit

Permalink
hdmi_in/edid: fix sda sampling: need to be similar to scl otherwise o…
Browse files Browse the repository at this point in the history
…n sources with fast scl we were detecting false starts
  • Loading branch information
enjoy-digital committed Sep 9, 2015
1 parent 6b5f66c commit 9bb88b8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions hdl/hdmi_in/edid.py
Expand Up @@ -36,14 +36,15 @@ def __init__(self, pads, default=_default_edid):
# EDID
scl_raw = Signal()
sda_i = Signal()
sda_raw = Signal()
sda_drv = Signal()
_sda_drv_reg = Signal()
_sda_i_async = Signal()
self.sync += _sda_drv_reg.eq(sda_drv)
self.specials += [
MultiReg(pads.scl, scl_raw),
Tristate(pads.sda, 0, _sda_drv_reg, _sda_i_async),
MultiReg(_sda_i_async, sda_i)
MultiReg(_sda_i_async, sda_raw)
]

# for debug
Expand All @@ -58,7 +59,10 @@ def __init__(self, pads, default=_default_edid):
samp_carry = Signal()
self.sync += [
Cat(samp_count, samp_carry).eq(samp_count + 1),
If(samp_carry, scl_i.eq(scl_raw))
If(samp_carry,
scl_i.eq(scl_raw),
sda_i.eq(sda_raw)
)
]

scl_r = Signal()
Expand Down

0 comments on commit 9bb88b8

Please sign in to comment.