??? 02/07/07 23:32 Read: times |
#132277 - Point missed Responding to: ???'s previous message |
Mike, please refer to the code I posted here: http://www.8052.com/forum/read.phtml?id=130547 Unfortunately, I was a bit lazy when I wrote this so it could do with a little work to make it more generic. However, the concept is valid and can be proven. As such, the connections between the cpu and LCD are not 'random' as that would infer 'indeterminate'. If we can't determine the connections, it has no hope of working. However, I take your meaning as 'non-sequential' connections. This is not as much of a problem as you think it might be - it all comes down to 'abstraction'. The 8051 has lovely bit instructions that allow us to re-arrange bits quite efficiently. Sure, it takes a few more instructions and a couple more bytes of flash, but speed isn't an issue with LCDs - you're most likely having to wait 100's of microseconds for it to do its work anyway. Using the concept of 'abstraction' - the bit twiddling to accomodate the non-sequential connections is confined to one subroutine. It 'hides' the evil as it were. So take the 'Pepsi Challenge' - see if you can rewrite the code I posted so it is more generic and learn the power of abstraction. Even as a beginner, Asif Ali using a '2051 will probably find he will run out of port pins quickly once you start adding a few things to it. I've presented a method of being able to cope with a less than 'perfect' connection scheme. Whether or not one chooses to use it is not the point of discussion, but rather, at some point you may find yourself with a limited selection of port pins to choose from. |