Hi there,
I meet a problem about the i2c waveform. As you can see in attached figure, it is quite strange that the voltage level stay in the middle of waveform, about 1.2 volt. Presently the final result of read/write is correct, but the waveform is really not the one we expected. Do you have any idea how to modify it? (I'm using K60, and I have ever tried the "High drive select" bit in Reigster I2C0_C2 of K60, but the result wave form is same)
Current Platform: IAR
MCU: MK60DX256ZVMC10
I2C Frq: 150KHz
Jeff
已解决! 转到解答。
Hello Jeff:
That is probably because Open-Drain is not enabled for the I2C pins you are using. This is configured with PORTx_PCRn[ODE] bit, depending on the port (A/B/C/D/E) and pin number (0-31).
Regards!,
Jorge Gonzalez
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hello Jeff:
That is probably because Open-Drain is not enabled for the I2C pins you are using. This is configured with PORTx_PCRn[ODE] bit, depending on the port (A/B/C/D/E) and pin number (0-31).
Regards!,
Jorge Gonzalez
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Jorge,
You exactly helped me solved the problem. After enabling port open-drain, the waveform level seems correct. See following figures, however, there is a curve when the pin is pull high, I'm sure there is no Capacities on both SCL and SDA. Do you know if I can improve it?
Jeff,
Good to know it helped :smileyhappy:
Regarding the curve:
1) K60 Internal pull resistors should be disabled (PORTx_PCRn[PE] = 0)
2) Check your external pull-up resistors or try with different values (~ 3.3K to 10K)
3) Finally confirm you are connecting ground of your scope.
Regards!
Jorge Gonzalez