I2C1 in Nucleo-F411RE does not work

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
Post Reply
shaoziyang
Posts: 252
Joined: Sun Apr 17, 2016 1:55 pm

I2C1 in Nucleo-F411RE does not work

Post by shaoziyang » Wed May 04, 2016 3:00 am

I try I2C1 in Nucelo F411RE board, with PB6/PB7 pin, but it is not work, return nothing. Same code is working fine in I2C2.

User avatar
dhylands
Posts: 3176
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: I2C1 in Nucleo-F411RE does not work

Post by dhylands » Wed May 04, 2016 7:28 am

I don't see anything that would explain why it shouldn't work.

Are you using the latest firmware?
Did you add pullup resistors?

After you've configured I2C1 could you tell me what the output of the following is:

Code: Select all

pyb.Pin('B6')
pyb.Pin('B7')

shaoziyang
Posts: 252
Joined: Sun Apr 17, 2016 1:55 pm

Re: I2C1 in Nucleo-F411RE does not work

Post by shaoziyang » Wed May 04, 2016 12:52 pm

dhylands wrote:I don't see anything that would explain why it shouldn't work.

Are you using the latest firmware?
Did you add pullup resistors?

After you've configured I2C1 could you tell me what the output of the following is:

Code: Select all

pyb.Pin('B6')
pyb.Pin('B7')
I connect NUCLEO-F411 board with a RTC module (DS3231) with external 3.3K pullup resistor. I write a simple test as below, when I use I2C1, it will return nothing, but when I change to I2C2, it works fine.

Code: Select all

from pyb import I2C 
 
i2c = I2C(2, I2C.MASTER, baudrate=100000)

def test(): 
    i2c.send(0, 104) 
    b = i2c.recv(1, 104)[0] 
    print(int(b/16),b%16) 
 
while True: 
    test() 
    pyb.delay(500) 
 
21 
22 
23 
24 
25 
26 
27 
28 
29 
30
1.jpg
1.jpg (36.72 KiB) Viewed 1275 times

Post Reply