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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
12/11/04 10:29
Read: times


 
#82936 - It's CKCON setting error
Responding to: ???'s previous message
a) "BAUDRATE = 9600" falls here, and the bug is "CKCON |= 0x09;"

} else if (SYSCLK/BAUDRATE/2/256 < 4) {
TH1 = -(SYSCLK/BAUDRATE/2/4);
CKCON &= ~0x0B; // T1M = 0; SCA1:0 = 01
CKCON |= 0x09; // <--- 0x01

b) "CKCON &= ~0x0B;" is common in all cases. You can move it before the "if-else if" clause and delete all others.

c) Consider to convert the long "if-else if" clause to #if-#else-#endif, because these "if" clauses compare constant.

Tsuneo

List of 6 messages in thread
TopicAuthorDate
C8051f320 UART problem            01/01/70 00:00      
   Additional information            01/01/70 00:00      
      The onboard oscillator.            01/01/70 00:00      
         Thankyou. Its working            01/01/70 00:00      
   It's CKCON setting error            01/01/70 00:00      
   How to post code            01/01/70 00:00      

Back to Subject List