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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/28/07 03:30
Read: times


 
#141312 - just a slip
Responding to: ???'s previous message
Hi,

By pretending to read the pin the code may be forcing the compiler to configure the pin in input mode. This shall be done by writing "1" to port. One way to check could be to compile and check the assembler output.

Not sure how that'll work with optimizations on,though. May be the local variable input_var ought to be declared volatile to be safe.If we don't declare the variable as volatile,probably only pin configuration and bit-read shall take place without transfer of value to the variable.

Disclaimer: I am not/was not a Keil user and have been away from 51/52 for a long time(3 years or so).

Regards
Pranav

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