2003-03-25 11:36 PM
Methods for reading & writing to a port
2003-03-24 07:49 PM
Page 44 of the ST72324J states that BSET & BRES should not be used to read and write to ports.
What is the best method to set an output or read the state of an input pin. I can find an application note for ST6 port reading/writing but nothing on the ST7.2003-03-25 11:36 PM
This refers specifically to mixed ports, ie Input and Output on the same port. If the port is all output then you can use the Bit Set and Reset commands with no problems. If however you have mixed ports, the suggested method is to use a shadow register, do the bit manipulation on that then write it to the port data register. Don't worry about overwriting any data on any port bits set to input as the port settings will cause these to be ignored in the data register.