![NyQuest Innovation Labs NY6 Series Скачать руководство пользователя страница 37](http://html1.mh-extra.com/html/nyquest-innovation-labs/ny6-series/ny6-series_user-manuel_1722361037.webp)
NY6 User Manual
Ver 1.3 2019/03/28
37
3.13 SPIDx ($12/$13)
The SPIDx is 8-bit registers divided into two 4-bit registers, SPIDL($12) and SPIDH($13). This set of two
registers is to store SPI data for transferring or receiving to/from SPI flash. For transferring data, SPIDL
register has to be executed first, then SPIDH. Once SPIDH is written, the procedure starts to shift out
serially. For receiving data, there is no priority issue, once the shifting process is done and read both of
them.
3.14 I/O Ports Register ($14 ~ $1F)
As PA, PB, PC, PD, PE and PF are bi-directional I/O ports, System register PAIO, PBIO, PCIO, PDIO,
PEIO and PFIO are used to determine the direction of each I/O pin. Writing 1 to any bit of register PXIO
(X=A~F), the corresponding I/O pin is configured as input pin. Writing 0 to any bit of PXIO (X=A~F), the
corresponding I/O pin is configured as output pin. For I/O pin used as input pin, reading system register PX
(X=A~F) will obtain current state on I/O pin.
For I/O pin used as input pin, there is a mask option to define whether pull-high resistor of corresponding
I/O pin can be enabled or disabled during program execution. When this mask option is disabled, either
high-to-low or low-to-high level change on this pin can wake up NY6 from Halt mode or Slow mode.
Therefore, user has to read the I/O pin state before entering Halt mode or Slow mode and write back to
register PX[y] (X=A~F, y=0~3). When 1 is written to register PX[y], high-to-low level change on this pin will
wake up NY6. When 0 is written to register PX[y], low-to-high level change on this pin will wake up NY6.
However, user can enable or disable pull-high resistor during program execution when wake-up mask
option is enable. When this mask option is enabled, only high-to-low level change on this pin can wake up
NY6 from Halt mode or Slow mode. On the other hand, the pull-high resistor can be disabled or enabled
again during program execution by writing 1 or 0 to register PX[y]. When 1 is written to PX[y], the pull-high
resistor is enabled and when 0 is written to PX[y], the pull-high resistor is disabled.
For I/O pin used as output pin, writing value to register PX is to write this value to output register of this I/O
pin.
The register value of an output pin simply means the output data. If the pin is an IR output, it outputs the IR
carrier frequency when the register is 0 and the IR low/high carrier option is low; it outputs 1 when the
register is 1 and the IR low/high carrier option is low. An IR port output 0 when the register is 0 and the IR
low/high carrier option is high; it outputs the IR carrier frequency when the register is 1 and the IR low/high
carrier option is high.