TMP91C824
91C824-145
2008-02-20
c. Transmission and receiving (Full duplex mode)
When the full duplex mode is used, set the level of Receive Interrupt to 0 and
set enable the interrupt level (1 to 6) to the transfer interrupt. In the transfer
interrupt program, The receiving operation should be done like the above
example before setting the next transfer data.
Example: Channel 0, SCLK output
Baud
rate
=
9600 bps
fc
=
14.7456 MHz
*
Clock state
System clock:
High frequency (fc)
Clock gear:
1 (fc)
Prescaler clock: f
FPH
Main routine
7
6
5
4
3
2
1
0
Set the INTTX0 level to 1.
INTES0
–
0
0
1
–
0
0
0
Set the INTRX0 level to 0.
PCCR
–
–
–
–
–
1
0
1
Set PC0, PC1 and PC2 to function as the TXD0,
RXD0 and SCLK0 pins respectively.
PCFC X
X
–
X
–
1
X
1
SC0MOD0 –
–
–
–
0
0
–
–
Select I/O interface mode.
SC0MOD1 1
1
X X
X
X
X
X
Select full duplex mode.
SC0CR
–
–
–
–
–
–
0
–
SCLK output, transmit on negative edge, receive on
positive edge
BR0CR
0 0 1 1
0
0
1
1
Baud rate
=
9600 bps
SC0MOD0
– – 1 –
–
–
–
–
Enable
receiving
SC0BUF
* * * * * *
* *
Set the transmit data and start.
INTTX0 interrupt routine
Acc
SC0BUF
Read
the
receiving
buffer.
SC0BUF
* * * *
*
*
*
*
Set the next transmit data.
X: Don’t care,
−
: No change