请问所有口是默认为功能口吗?似乎默认是输入口吧。如果是打算用功能口则进行功能设置,否则都要先进行ANSELX设置吗?没有ANSELX设置有时也是能IO读写的。在哪些datasheet会说明呢?我看到的datasheet里没这样说的详细。另外,下面的说法读LAT也是可以啊。( Writes to the latch, write the latch.)
All port pins have three registers directly associated
with their operation as digital I/O. The Data Direction
register (TRISx) determines whether the pin is an input
or an output. If the Data Direction register bit is a ‘1’,
then the pin is an input. All port pins are defined as
inputs after a Reset. Reads from the Data Latch register
(LATx), read the latch. Writes to the latch, write the
latch. Reads from the port (PORTx), read the port pins;
writes to the port pins, write the latch.
|