View previous topic :: View next topic |
Author |
Message |
psypersky
Joined: 06 Jul 2008 Posts: 13
|
One wire Search Rom problem can't read the code |
Posted: Mon Aug 04, 2008 4:21 pm |
|
|
Hi, I'm trying to make work a DS18S20. I'm using the onewire.c and ds1820.c libraries, but I have a problem with the Search ROM command, the program send it, and when reads the first two bits, only read "1" and "1" ... :S Which means that there aren't a sensor connected, or no response.
I have my 4.7K pull up resitor, and is in normal mode.
The functions reset() and search_supply() works fine,
Does anyone have an idea why this happens?
Code: | flag = ow_reset(); // igual a 1 si no hay dispositivos .. =1 if no devices
if (flag||doneFlag) // If no parts return false y no estamos en first()...
{
lastDiscrep = 0; // Reset the search
return FALSE;
}
write_byte(0xF0); // Send SearchROM command
do
{
x = 0;
if (read_bit() == 1) x = 2;
delay_us(120);
if (read_bit() == 1) x |= 1; // And it's complement
printf(lcd_putc,"\fFOUND %u",x);
//delay_ms(5000);
if (x == 3) // There are no devices on the one wire bus |
|
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Mon Aug 04, 2008 4:40 pm |
|
|
Don't start a new thread with the same question.
A few days ago you asked exactly the same question in http://www.ccsinfo.com/forum/viewtopic.php?p=102076.
Two people gave you suggestions. You didn't respond. Were these suggestions not helpful?
Please post all responses in the original thread. |
|
|
psypersky
Joined: 06 Jul 2008 Posts: 13
|
|
Posted: Mon Aug 04, 2008 10:13 pm |
|
|
ckielstra wrote: | Don't start a new thread with the same question.
A few days ago you asked exactly the same question in http://www.ccsinfo.com/forum/viewtopic.php?p=102076.
Two people gave you suggestions. You didn't respond. Were these suggestions not helpful?
Please post all responses in the original thread. |
It wasn't helpful cause I did a too large post and too much code, and nobody wanted to read the entire post, so I make a short post of my question. |
|
|
|