Skip to content

Commit

Permalink
move 1st-stage i2c metastability synchronizer into 12 MHz domain
Browse files Browse the repository at this point in the history
this should greatly increase the amount of time allowed for
the signal to settle down and hopefully reduce chatter/bounce.
  • Loading branch information
bunnie committed Mar 22, 2023
1 parent 44a89ee commit cd7910c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion betrusted_soc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1566,7 +1566,7 @@ def __init__(self, platform, revision, sys_clk_freq=int(100e6), legacy_spi=False

# I2C interface ----------------------------------------------------------------------------
self.submodules.i2c = ClockDomainsRenamer({"sys":"sys_always_on"})(i2c.RTLI2C(platform, platform.request("i2c", 0)))
self.comb += self.i2c.filter_clk.eq(self.crg.cd_clk50_always_on.clk) # slower clock for de-metastabilizing the slow/jitter edges of I2C
self.comb += self.i2c.filter_clk.eq(self.crg.cd_usb_12.clk) # slower clock for de-metastabilizing the slow/jitter edges of I2C
self.add_csr("i2c", use_loc_if_exists=True)
self.add_interrupt("i2c", use_loc_if_exists=True)

Expand Down

0 comments on commit cd7910c

Please sign in to comment.