Because of Layout I had connected P1.0 to LCD.7, P1.1 to LCD.6 ... P1.7 to LCD.0! Now I have to convert the sending and incoming data. MSB has to become LSB. Is their a esay way to do this? Thanks a lot
The bfastest, simplest, most elegant way is a lookup table unsigned char code{}={0, 0x08, 0x40.... Erik
I found a other simple way (17 Byte & 17 Cycle)
MOV C, ACC.1 ;1 76543210 RLC A ;7 65432101 MOV ACC.2, C ;7 65432701 MOV C, ACC.3 ;2 65432701 RLC A ;6 54327012 MOV ACC.4, C ;6 54367012 MOV C, ACC.5 ;3 54367012 RLC A ;5 43670123 MOV ACC.6, C ;5 45670123 SWAP A ;5 01234567
"I found a other simple way" Hey, no fair! You didn't say we could use assembly ;-)
Nobody said you couldn't...
Toolset = C51 Criterion = "esay" (easy, and the only criterion stated) Given all the posts asking about the SRC directive, assembly modules callable from C, C modules callable from assembly, etc., who would have though that: easy = assembly How silly of me!
Hmm... I suppose "easy" is somewhat subjective, really? l;-) "It takes a lot of effort to make something appear effortless"