Hello
I'm working on a project with the MCU KL27Z.
I have a problem with the 9th bit on the I2C bus. The SDA line doesn't go all the way down (as ASK), it only goes half way down. I found that the solution should be making the SDA pin open drain, but i there´s no option to do that.
I´d like to know if there's a solution to this problem and how to do it.
Thanks
José Ricaurte
Hi José
You need to set the pins to open-drain in the pin's PORTx_PCRy register.
For I2C on the KL27 see:
http://www.utasker.com/docs/uTasker/uTasker_I2C.pdf
and its appendix A for details of the double-buffered I2C controller in the KL27 and workarounds for its erratas.
Regards
Mark
Complete KL27 solutions, training and support: http://www.utasker.com/kinetis.html
Kinetis K27:
- http://www.utasker.com/kinetis/FRDM-KL27Z.html
- http://www.utasker.com/kinetis/Capuccino-KL27.html
Hi Mark
Thanks for your answer.
In my MCU(KL27Z156) according to the datasheet, there's no PORTx_PCRy register.
Can you tell me another way to do this?
My MCU is KL27Z256
For I2C line on PTC3 (for example) the register PORTx_PCRy is PORTC_PCR3 (address 0x4004b00c).
To save time just use the uTasker KL27 project since it does all for you and has I2C EEPROM support built into it, including simulation of the KL27, its I2C and the EEPROM. See also http://www.utasker.com/docs/uTasker/uTasker_I2C.pdf for I2C details and the workaround for the KL27 double-buffered I2C complications.