Dear all, My board will have several inputs connected to P0-P3. The PC will instruct the microcontroller using RS232, to monitor some of the inputs. The communication between the PC and the 8051 will be somewhat like below:
PC->8051: count the state changes on P0.3 count the state changes on P0.6 : : inform me on any change of the state of P1.5 inform me on any change of the state of P3.4 : :
I'm not familiar with the 8051 instruction set since I'm working with C166. But assuming that there is no difference between them in this regard it's impossible to define an array of bits or a pointer to a bit (simply because there are no CPU instructions to support this). If I tryed to implement the same thing with C166 and was concerned about speed, I would build port-scanning code somewhere in RAM (on the fly, during program execution) and pass control there. Thus I would be able to do whatever testing I wanted at maximum speed.