??? 09/06/06 12:17 Read: times |
#123746 - Not necessarily Responding to: ???'s previous message |
Wira Kasem said:
I think interface to hardware we should select low level language (assembly). Not necessarily. A decent 'C' compiler that has been specifically designed for the 8051 will allow you to access hardware perfectly adequately in most cases. The problem in this particular case is that the OP is trying to mimic assembler instructions in 'C', rather than thinking about what is actually required. As Jan has pointed out, the task of receiving bits (from I2C in this case) into a byte requires shifting, not rotating - and the standard 'C' language provides a perfectly good shift operator to do this! http://www.8052.com/forum/read.phtml?id=123729 |
Topic | Author | Date |
RL & RLC inst in C | 01/01/70 00:00 | |
yes, they are | 01/01/70 00:00 | |
yes, they are | 01/01/70 00:00 | |
mistype | 01/01/70 00:00 | |
Choose the best tool for the job. | 01/01/70 00:00 | |
another option (without if) | 01/01/70 00:00 | |
C style | 01/01/70 00:00 | |
May Be This Way | 01/01/70 00:00 | |
No, that won't work! | 01/01/70 00:00 | |
ways to skin the cat | 01/01/70 00:00 | |
Compiler dependant | 01/01/70 00:00 | |
compiler independent, but still very ugly version | 01/01/70 00:00 | |
Thank You | 01/01/70 00:00 | |
A very important point! | 01/01/70 00:00 | |
It is nice C | 01/01/70 00:00 | |
Not necessarily | 01/01/70 00:00 | |
Problem solved | 01/01/70 00:00 | |
Keil-specific | 01/01/70 00:00 | |
Thank you![]() | 01/01/70 00:00 |