I2C, what happens when unproper pull up resistor value used

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

I2C, what happens when unproper pull up resistor value used

9,924 次查看
RChapman
Contributor I
This message contains an entire topic ported from a separate forum. The original message and all replies are in this single message. We have seeded this new forum with selected information that we expect will be of value to you as you search for answers to your questions.
 
Posted: Sun Jul 10, 2005 8:24 pm    
 
Hi eveybody,

i am using a MC68HC908 I2C module, when interfaced with SRF08 ultrasonic sensor, i use 30kohms pull up resistors, the module does not send, i cannot see anything on the scope, i could send once, i think there is some unstability due to a wrong interfacing (resistor values???).
if anybody could help me with some code example or advices coming from some former troubles encountred dueto wrong resistor values, please don't hesistate to post a message.
thanks
Posted: Thu Jul 14, 2005 1:25 am    
 
Hi,
A standard value of pullup for I2C buses is 4k7, if your bus lines are very long you will need to drive them harder but even so you should see something on your scope (even if it looks ugly). What device are you using? If you post your code it would help. If your timimg is not correct the 9s08gb60 I2C module tends to to simply stop working, for example I have had to put a small delay between writes to the I2C data register. Data or clock lines not returning high is a good sign of timing problems as above.
Cheers.
 
Posted: Fri Jul 15, 2005 8:41 am 
 
Hello, thanks for the reply, well here is the code, i can write so far but i cannot read anything i am trying to communicate with an ultrasonic sensor, the SRF08

PTD = 0x00;
PTD = MMSR; // Configures port D[7..0] as output

/////////////////// configuration///////////////////

MMCR1 = 0x8C;
MMCR2 |= 0x10;
MMCR2 &= 0xF7;

MMFDR = 0x06; //corresponds to a 6,25Khz for a 8Mhz bus frequency.
PTD = MMSR;



MMADR = 0xE0;


asm("SWI");
MMSR &= 0xBF;
MMDTR = 0x00;
PTD = MMSR;




MMSR &= 0xBF;
MMDTR = 0x51;
PTD = MMSR;

MMCR2 |=0x08;//////////////////////////////////////
MMCR2 &=0xEF;
MMCR2 |=0x10;//////////////////////////////////////
MMCR1 |=0x04;
MMADR = 0x07;
PTD = MMSR;
MMDTR = 0xFF;

PTD = MMSR;
PTD = MMSR;

MMSR &= 0xBF;
MMDTR = 0x07;
PTD = MMSR;



i am using resistors of 18Kohms.
i noticed something when i run the program at the begging with the scope probe on the SDA pin the program does not work properly, but if it is connected to the SCL pin it is ok.
should i take higher resistor values???
the timing is not a problem cause i am running on debug mode and i give time to the target device.
thanks for the help.
Best regards


PS: the PTD port in the code is used to display the I2C status register, it allow me watch the thing

the register are accordign to the definition for the MC68HC908AP64 freescale microcontroller
 
Posted: Wed Jul 20, 2005 1:57 am    
 
Hi,
Your scope probe should not affect the bus, the srf08 data sheet suggests 1k8 resistors not 18k. The srf08 won't respond to reads while it is ranging. Are you checking that the device is acknowledging when you are writing to it. Have you got any other i2c chips you could start communicating with
(pcf8574 i/o expander is a easy device to start with). Scope both the data and clock lines at the same time or you will not know what is going on (start, stop's etc). Sorry don't have the time to go through your code.
 
Posted: Tue Jul 26, 2005 11:27 am    
 
Hi, do you have any code for this device, i would appreciate to have something to start with for my MC68HC908AP.
cheers
Posted: Thu Jul 28, 2005 10:38 pm 
 
Check out the data sheet for the device. It is very simple to use and you can confirm your writes to it by looking at the i/o.   
标签 (1)
0 项奖励
0 回复数