CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

One wire Search Rom problem can't read the code

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
psypersky



Joined: 06 Jul 2008
Posts: 13

View user's profile Send private message

One wire Search Rom problem can't read the code
PostPosted: Mon Aug 04, 2008 4:21 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Aug 04, 2008 4:40 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Aug 04, 2008 10:13 pm     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group