Hi Frank
PTAPAR is only needed if the port was previously configured as peripheral function.
Generally try to use the port macros (search for "
port macros" in
M5223x.h) since these will help keep code portable.
Also the port macros can be used as reference:
Eg. to set just bit 1 to input and read its vale you can use:
_CONFIG_PORT_INPUT(TA, 0x02);
unsigned char var = _READ_PORT_MASK(TA, 0x02);or for the complete port:
_CONFIG_PORT_INPUT(TA, 0xff);
unsigned char var = _READ_PORT(TA);When using the uTasker simulator there is a further advantage since the macros include a call to the port simulator which will ensure that any consequences of changes with be handled (eg. updating port display in the simulator through to triggering interrupts or ADC triggers etc...)
Regards
Mark
See also
http://www.utasker.com/forum/index.php?topic=539.0