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 support@ccsinfo.com

Desperately need help with 1-wire, or HDQ16

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



Joined: 11 May 2005
Posts: 57
Location: london

View user's profile Send private message

Desperately need help with 1-wire, or HDQ16
PostPosted: Thu Dec 15, 2005 5:52 am     Reply with quote

Hi all,

I am using 18f8722

There are 2 chips using 1-wire protocol in the system i am designing. One is DS2433 and the other is gas gauge BQ2060.

I have written a presence check code which works well with DS2433 but not on BQ2060.

The following one is my simple presence check code:
Code:


void IsGasGaugePresent(void)
{

   Bit_Clear(TrisE,5);    

   HDQ16 = 0;
   delay_us(100);
//   delay_ms(1);
   
   Bit_Set(TrisE,5);   

   delay_us(5);         
   if(!HDQ16)            
   {
      delay_us(500);
      printf("\nLine failed to be pulled high\n");
      while(1);
   }
   
   delay_us(60);    //was 110uS, but now aim to sample at 70uS post reset pulse
   present=(!HDQ16);   

   delay_us(300);   // Allow time for the PRESENCE PULSE to go

   if(present)    
   {
      printf("\nFound the device after %d tries\n", k);
      while(1);
   }

}



TI claims the 1-wire protocol on BQ2060 with a new name HDQ16. Since the same code works on one chip but not on another, my questions are:

1. is HDQ16 exactly following the timing of standard 1-wire protocol? If no, it could probably explain my case. However, it will be weird if the answer is no.

2. People may have realised I have a delay of 100us after HDQ16 = 0. It actually works and finds a logic-low pulse coming from HDQ16. However, it only found the gas gauge after being called 9 timers consecutively in a while(1) loop. Also the biggest point is, according to 1-wire protocol, the delay after 'HDQ16 = 0' is minimum 420us !

Can anybody help me with this strange timing??
ye



Joined: 11 May 2005
Posts: 57
Location: london

View user's profile Send private message

PostPosted: Thu Dec 15, 2005 7:56 am     Reply with quote

nobody has experience in this? Shocked
ye



Joined: 11 May 2005
Posts: 57
Location: london

View user's profile Send private message

PostPosted: Thu Dec 15, 2005 9:27 am     Reply with quote

The 1-wire protocol timing given by these 3 documents or work are so different !!

somebody's code:
http://www.ccsinfo.com/forum/viewtopic.php?t=19520

1-wire protocol given by Dallas
http://www.maxim-ic.com/appnotes.cfm/appnote_number/126

1-wire protocol given by TI named as HDQ16
http://focus.ti.com/lit/ds/symlink/bq2060.pdf
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