
Timur Tabi timur@freescale.com wrote on 10/09/2009 15:29:35:
Joakim Tjernlund wrote:
A while back, someone posted a version of this code that computed the values of fdr/dfsr. I nack'd that patch because I thought the algorithm was too
Not so sure about that, but I haven't tried to calc it generally.
A quick way to check this is to figure out which dfsr/fdr values the i2c code uses, and then modify that entry in the table with a different pair. You'd have to manually calculate the correct value of fdr for the given dfsr.
The code was using 1, most entries has 1 as DFSR so that is no surprise. I have calculated DFSR and max is 6 for my 8321, CSB=133.332 MHz, board. Using this value works for me.
Yes, and a way to #define wanted DFSR. From there one can select one of the 4 tables listed in AN2919. The sum of tabels will be rather big though so I suspect it will less code to calculate the FDR/DFSR.
In this case, you're right. But so far, you're the only person who's complained to me that the current code doesn't work, and you already admitted that your board is broken, so I don't really see the need to change the code.
Come on, just because my board is somewhat broken, it doesn't mean the driver is correct. If I define my speed to 100KHz I get a DFSR of 22, way over what is allowed for my board.
It "works" because nobody has noticed the occasional error and/or doesn't operate in a noisy env.
Jocke