Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/27/07 07:45
Read: times


 
#141287 - You should know by now...
Responding to: ???'s previous message
...how to post properly-formatted code:
void i2c_stop (void)
{
   unsigned char input_var;

   SCLK      = LOW;    // Set clock line low
   SDATA     = LOW;    // Set data line low
   SCLK      = HIGH;   // Set clock line high
   SDATA     = HIGH;   // Set data line high (STOP SIGNAL)
   input_var = SDATA;  // Put port pin into HiZ
}

http://www.8052.com/faqs.phtml?FAQ=120199

Raghunathan said:
... provided by Keil ...

Have you asked Keil?

What exactly happens in the last statement?

Yes, it does look odd - especially as input_var is never subsequently used!
Is this for a specific chip, with some special port architecture that goes Hi-Z on a read?

On a standard 8051 quasi-bidirectional port, the pin is effectively Hi-Z after a '1' has been written to it...

Or is it a typo where RHS and LHS are swapped ??

Not sure how swapping RHS and LHS would help, as input_var is uninitialised...

Again: as Keil supplied it, why don't you ask them?

List of 7 messages in thread
TopicAuthorDate
A query on a C statement...            01/01/70 00:00      
   You should know by now...            01/01/70 00:00      
      Just a slip..            01/01/70 00:00      
         just a slip            01/01/70 00:00      
         Formatting            01/01/70 00:00      
   checking for I2C slave done            01/01/70 00:00      
      Ready made code            01/01/70 00:00      

Back to Subject List