EM78815
8-Bit Microcontroller
7.2.13.3 Page 2 Counter 2 Data Buffer
Bit 7
Bit 6
CN26
R/W-0
Bit 5
CN25
R/W-0
Bit 4
CN24
R/W-0
Bit 3
CN23
R/W-0
Bit 2
CN22
R/W-0
Bit 1
CN21
R/W-0
Bit 0
CN20
R/W-0
CN27
R/W-0
Bit 0~Bit 7(CN20~CN27) : Counter 2's data buffer
User can read and write into this buffer. Counter 2 is an 8-bit up-counter with 8-bit
prescaler that user can use R7 page2 to preset and read the counter (write = preset).
After an interrupt, it will reload the preset value.
Example: write: MOV 0x07 , A ; write the data at accumulator to counter1 (preset)
Example: read: MOV A , 0x07 ; read R7 data and write to accumulator
7.2.13.4 Page 3 SPI Control Register
Bit 7
RBF
Bit 6
SPIE
Bit 5
SRO
Bit 4
SE
Bit 3
SCES
R/W-0
Bit 2
SBR2
R/W-0
Bit 1
SBR1
R/W-0
Bit 0
SBR0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
Fig.12 shows how SPI to communicate with other device by SPI module. If SPI is a
master controller, it sends clock through the SCK pin. An 8-bit data is transmitted
and received at the same time. If SPI, however, is defined as a slave, its SCK pin
could be programmed as an input pin. Data will continue to be shifted basing on the
clock rate and the selected edge.
SDO
SDI
Master Device
Slave Device
R5 Page 1
SPIR register
SPIW register
SDO
SCK
SDI
SPI module
SPIS Reg
Bit 0
Bit 7
SCK
Fig 12: Single SPI Master / Salve Communication
24 •
Product Specification (V2.4) 02.17.2006
(This specification is subject to change without further notice)