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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/05/02 18:22
Read: times


 
#21467 - RE: Timing I2C bus with 8052
With NOP timing, I often insert a conditional e.g.
#define CLOCK_FREQUENCY_12M.

Then in the code, if the originl code is for 12 MHz:

#if CLOCK_FREQUENCY_12M
...
NOP
...
#else
You must code here for the clock frequency
#endif


This works if the #define is in an obvious place and will lead the poor sod who has to change the code to all places where change is required, then you hope that (s)he will make it:

#if CLOCK_FREQUENCY_12M
...
NOP
...
#else if CLOCK_FREQUENCY_18M
...
#else
You must code here for the clock frequency
#endif

Play it safe it is more fun,

Erik





List of 5 messages in thread
TopicAuthorDate
Timing I2C bus with 8052            01/01/70 00:00      
RE: Timing I2C bus with 8052            01/01/70 00:00      
RE: Timing I2C bus with 8052            01/01/70 00:00      
RE: Timing I2C bus with 8052            01/01/70 00:00      
RE: Timing I2C bus with 8052            01/01/70 00:00      

Back to Subject List