9 years, 1 month ago.

How to enable internal Pull UP resistor of I2C(SCL,SDA) in FRDM - KL25Z?

When I run the I2C program in the FRDM - KL25Z, am not getting 3.3v in SDA, SCL pins with respective to the ground. How to enable the internal pull up resistor.? I have checked with the Raspberry Pi with IO chip, and its working fine.

Otherwise can i use the external pull up resistor. I have attached my program pls check that too.

/media/uploads/krishna10061990/i2c1_tca9535.cpp

2 Answers

9 years, 1 month ago.

I tried running your code and I didn't get any kind of output. But changing the pins from PTC9 and PTC8 to I2C_SDA and I2C_SCL (these are different physical pins) seemed to do the trick. Also, the bus was idling high at 3.3v without any kind of internal or external pull up. Is it possible to use these pins instead?

As far as using internal pullups you can try changing

include the mbed library with this snippet

I2C master(PTC9, PTC8);

to this

include the mbed library with this snippet

DigitalIn sdaDummy(PTC9, PullUp);
DigitalIn sclDummy(PTC8, PullUp);
I2C master(PTC9, PTC8);

I don't think using internal pullups is usually recommended though because they usually have too high of a resistance. You can try adding external 2.2k resistors or another similar resistor value if you run into trouble.