English 中文(简体)
I2C, pullup resistors (STM32 discovery)
原标题:

I am sending my data trought I2C (using DMA every 1s). I´ve added two pullup-resistors to SCK and SDATA. There are now slaves, so because no respond, master send only slave adress and thats all.

Its testboard so sometimes happend thats I loose these pullup resistors for a while. When this happend I get no data more and SCK ticks so fast as posible for this frequency. There is no way how to fix it, pullpups back didnt help, I have to reset my board.

I cant explain this behaviour and its totally kill the bus.

问题回答

As you have seen already by yourself, pullup resistors are vital for the i2c bus, both in the sda and scl lines. It is usually obvious that the sda line is bidirectional, what is not so obvious is that the scl is also somewhat bidirectional, since slaves can maintain the line low to throttle down the speed of the bus.

In many cases the bus can become locked because of a collision or other physical problem like loosing your pullups, in such a case, some slaves don t release the bus properly because they understand that they are still being addressed. This situation can be fixed by the master sending output SCL pulses and finally a stop condition when the lines are released. However if you say that there are no slaves, this probably is not your case.

I m afraid that your problem might have to do with the master s i2c peripheral not seeing the lines go high when expected because the pullups are disconnected temporarily. The best solution I can think in your case is that you should make sure that you don t loose those pull ups. The best way to achieve this is to connect two or three resistors in parallel in each line, this way all two/three would have to be disconnected to leave the bus "unpulled". Use two 10k resistors in parallel for SDA and another two for SCL.





相关问题
Parsing Twitter feeds in C

I m trying to figure out how to get the most recent latitude and longitude of a Twitter user (from the new Geo API data, ie the <geo:point> tag, you can see how they look like on my twitter user ...

Interfacing 45DB161 data flash with 89LP4052 controller

I am trying to interface the data flash with 89lp 4052 controller. Crysal used 11.0592 mhz. This controller has built in spi bus. I tried all combinations of CPHA AND CPOL. Tried mode 0 as well as ...

Circular buffer pointer irregularities

This is a follow up on this question: Display previously received UART values. After implementing a circular buffer on the microcontroller, it seems that there is a problem with the pointers. Sent ...

Steps to read data from ARM microcontroller port

I am having trouble reading serial data from ARM LPC2378 microcontroller. Will I have to use UART or any GPIO port can be used?? is ayone having c code for it??

Display previously received UART values

This should be easy to answer to anyone familiar with C. I want to display the previous values of a variable (receive register of a UART (RS-232) on a microcontroller) on an LCD. This is my current ...

clear code for counting from 0 to 255 using 8-bit datatype

I was wondering if there is a clean way of counting from 0 to 255 using an 8 bit datatype, something like: for(uint8_t i(0);i<=255;++i) { .... } This obviously will not work but it makes it ...

热门标签