Altera_Forum
Honored Contributor
9 years agocustom i2c
Just after a quick/general comment as I am a bit new to HDL.
I was struggling to get much over 30kHz on my i2c connection because my code on my Nios II processor was not handling the interrupts quick enough (1 interrupt per byte). I was holding the clock line down while it waiting for the ISR to be serviced, but the slave did not like this. So, knowing the read and write always consists of 1 byte address and 2 bytes read or write, I modified the i2c HDL to do it all and just have an interrupt on the final stop. It seems to work fine at 900kHz now but the signals look like shark fins. I do sample rather than edge detect to read the data. Is this how I should address the issue? Does anyone do this in practice? regards, Graham