PIC17C42 Microchip Technology, PIC17C42 Datasheet - Page 95

no-image

PIC17C42

Manufacturer Part Number
PIC17C42
Description
High-Performance 8-Bit CMOS EPROM/ROM Microcontroller
Manufacturer
Microchip Technology
Datasheets

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC17C42-16/JW
Manufacturer:
AD
Quantity:
12
Part Number:
PIC17C42A-16/L
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
PIC17C42A-16/PQ
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
PIC17C42A-16/PQ
Manufacturer:
MICROCH
Quantity:
20 000
Part Number:
PIC17C42A-16/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
PIC17C42A-16E/L
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
PIC17C42A-16E/PQ
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
PIC17C42A-25/P
Manufacturer:
MICROCLOCK
Quantity:
20 000
13.3.2
Once synchronous mode is selected, reception is
enabled by setting either the SREN (RCSTA<5>) bit or
the CREN (RCSTA<4>) bit. Data is sampled on the
RA4/RX/DT pin on the falling edge of the clock. If
SREN is set, then only a single word is received. If
CREN is set, the reception is continuous until CREN is
reset. If both bits are set, then CREN takes prece-
dence. After clocking the last bit, the received data in
the Receive Shift Register (RSR) is transferred to
RCREG (if it is empty). If the transfer is complete, the
interrupt bit RCIF (PIR<0>) is set. The actual interrupt
can be enabled/disabled by setting/clearing the
RCIE (PIE<0>) bit. RCIF is a read only bit which is
RESET by the hardware. In this case it is reset when
RCREG has been read and is empty. RCREG is a dou-
ble buffered register; i.e., it is a two deep FIFO. It is
possible for two bytes of data to be received and trans-
ferred to the RCREG FIFO and a third byte to begin
shifting into the RSR. On the clocking of the last bit of
the third byte, if RCREG is still full, then the overrun
error bit OERR (RCSTA<1>) is set. The word in the
RSR will be lost. RCREG can be read twice to retrieve
the two bytes in the FIFO. The OERR bit has to be
cleared in software. This is done by clearing the CREN
bit. If OERR bit is set, transfers from RSR to RCREG
are inhibited, so it is essential to clear OERR bit if it is
set. The 9th receive bit is buffered the same way as the
receive data. Reading the RCREG register will allow
the RX9D and FERR bits to be loaded with values for
the next received data; therefore, it is essential for the
user to read the RCSTA register before reading
RCREG in order not to lose the old FERR and RX9D
information.
FIGURE 13-11: SYNCHRONOUS RECEPTION (MASTER MODE, SREN)
(RA4/RX/DT pin)
(RA5/TX/CK pin)
1996 Microchip Technology Inc.
Write to the
SREN bit
SREN bit
CREN bit
RCIF bit
Read
RCREG
DT
CK
USART SYNCHRONOUS MASTER
RECEPTION
Q2
Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
'0'
Note: Timing diagram demonstrates SYNC master mode with SREN = 1.
bit0
Q1 Q2 Q3 Q4Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
bit1
bit2
bit3
Steps to follow when setting up a Synchronous Master
Reception:
1.
2.
3.
4.
5.
6.
7.
8.
9.
Note:
bit4
Initialize the SPBRG register for the appropriate
baud rate. See Section 13.1 for details.
Enable the synchronous master serial port by
setting bits SYNC, SPEN, and CSRC.
If interrupts are desired, then set the RCIE bit.
If 9-bit reception is desired, then set the RX9 bit.
If a single reception is required, set bit SREN.
For continuous reception set bit CREN.
The RCIF bit will be set when reception is com-
plete and an interrupt will be generated if the
RCIE bit was set.
Read RCSTA to get the ninth bit (if enabled) and
determine if any error occurred during reception.
Read the 8-bit received data by reading
RCREG.
If any error occurred, clear the error by clearing
CREN.
To terminate a reception, either clear the
SREN and CREN bits, or the SPEN bit.
This will reset the receive logic, so that it
will be in the proper state when receive is
re-enabled.
bit5
bit6
PIC17C4X
bit7
DS30412C-page 95
Q1 Q2 Q3 Q4
'0'

Related parts for PIC17C42