PIC24FJ128GA MICROCHIP [Microchip Technology], PIC24FJ128GA Datasheet - Page 117
PIC24FJ128GA
Manufacturer Part Number
PIC24FJ128GA
Description
General Purpose, 16-Bit Flash Microcontrollers
Manufacturer
MICROCHIP [Microchip Technology]
Datasheet
1.PIC24FJ128GA.pdf
(232 pages)
Available stocks
Company
Part Number
Manufacturer
Quantity
Price
Company:
Part Number:
PIC24FJ128GA006-I/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
PIC24FJ128GA006-I/PT
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Company:
Part Number:
PIC24FJ128GA006T-I/PT
Manufacturer:
FSC
Quantity:
13 520
Company:
Part Number:
PIC24FJ128GA006T-I/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
Company:
Part Number:
PIC24FJ128GA008-I/PT
Manufacturer:
ISSI
Quantity:
38
Company:
Part Number:
PIC24FJ128GA008-I/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
PIC24FJ128GA008-I/PT
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Company:
Part Number:
PIC24FJ128GA008T-I/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
Company:
Part Number:
PIC24FJ128GA010-I/PF
Manufacturer:
MICROCHIP
Quantity:
225
Company:
Part Number:
PIC24FJ128GA010-I/PF
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
PIC24FJ128GA010-I/PF
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Company:
Part Number:
PIC24FJ128GA010-I/PT
Manufacturer:
Microchi
Quantity:
627
Company:
Part Number:
PIC24FJ128GA010-I/PT
Manufacturer:
MICROCHIP
Quantity:
212
14.0
The Serial Peripheral Interface (SPI) module is a syn-
chronous serial interface useful for communicating with
other peripheral or microcontroller devices. These
peripheral devices may be serial EEPROMs, shift reg-
isters, display drivers, A/D converters, etc. The SPI
module is compatible with Motorola’s SPI and SIOP
interfaces.
The module supports operation in two buffer modes. In
Standard mode, data is shifted through a single serial
buffer. In Enhanced Buffer mode, data is shifted
through an 8-level FIFO buffer.
The module also supports a basic framed SPI protocol
while operating in either Master or Slave modes. A total
of four framed SPI configurations are supported.
The SPI serial interface consists of four pins:
• SDIx: Serial Data Input
• SDOx: Serial Data Output
• SCKx: Shift Clock Input or Output
• SSx: Active-Low Slave Select or Frame
The SPI module can be configured to operate using 2,
3 or 4 pins. In the 3-pin mode, SSx is not used. In the
2-pin mode, both SDOx and SSx are not used.
A block diagram of the module is shown in Figure 14-1.
Depending on the pin count, devices of the
PIC24FJ128GA family offer one or two SPI modules on
a single device.
© 2006 Microchip Technology Inc.
Note:
Note:
Synchronization I/O Pulse
Note:
SERIAL PERIPHERAL
INTERFACE (SPI)
This data sheet summarizes the features
of this group of PIC24FJ devices. It is not
intended to be a comprehensive reference
source.
Do not perform read-modify-write opera-
tions (such as bit-oriented instructions) on
the SPIxBUF register, in either Standard or
Enhanced Buffer mode.
In this section, the SPI modules are
referred to together as SPIx or separately
as SPI1 and SPI2. Special Function Reg-
isters will follow a similar notation. For
example, SPIxCON refers to the control
register for the SPI1 or SPI2 module.
Preliminary
PIC24FJ128GA FAMILY
To set up the SPI module for the Standard Master mode
of operation:
1.
2.
3.
4.
5.
To set up the SPI module for the Standard Slave mode
of operation:
1.
2.
3.
4.
5.
6.
7.
If using interrupts:
a)
b)
c)
Write the desired settings to the SPIxCON
register with MSTEN (SPIxCON1<5>) = 1.
Clear the SPIROV bit (SPIxSTAT<6>).
Enable SPI operation by setting the SPIEN bit
(SPIxSTAT<15>).
Write the data to be transmitted to the SPIxBUF
register. Transmission (and reception) will start
as soon as data is written to the SPIxBUF
register.
Clear the SPIxBUF register.
If using interrupts:
a)
b)
c)
Write the desired settings to the SPIxCON1 and
SPIxCON2
(SPIxCON1<5>) = 0.
Clear the SMP bit.
If the CKE bit is set, then the SSEN bit
(SPIxCON1<7>) must be set to enable the SSx
pin.
Clear the SPIROV bit (SPIxSTAT<6>).
Enable SPI operation by setting the SPIEN bit
(SPIxSTAT<15>).
Clear the SPIxIF bit in the respective IFSn
register.
Set the SPIxIE bit in the respective IECn
register.
Write the SPIxIP bits in the respective IPCn
register to set the interrupt priority.
Clear the SPIxIF bit in the respective IFSn
register.
Set the SPIxIE bit in the respective IECn
register.
Write the SPIxIP bits in the respective IPCn
register to set the interrupt priority.
registers
with
DS39747C-page 115
MSTEN