Motore di ricerca datesheet componenti elettronici
  Italian  ▼
ALLDATASHEETIT.COM

X  

PIC24H Scheda tecnica(PDF) 153 Page - Microchip Technology

Il numero della parte PIC24H
Spiegazioni elettronici  High-Performance, 16-bit Microcontrollers
PDF  290 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Produttore elettronici  MICROCHIP [Microchip Technology]
Homepage  http://www.microchip.com
Logo MICROCHIP - Microchip Technology

PIC24H Scheda tecnica(HTML) 153 Page - Microchip Technology

Back Button PIC24H Datasheet HTML 149Page - Microchip Technology PIC24H Datasheet HTML 150Page - Microchip Technology PIC24H Datasheet HTML 151Page - Microchip Technology PIC24H Datasheet HTML 152Page - Microchip Technology PIC24H Datasheet HTML 153Page - Microchip Technology PIC24H Datasheet HTML 154Page - Microchip Technology PIC24H Datasheet HTML 155Page - Microchip Technology PIC24H Datasheet HTML 156Page - Microchip Technology PIC24H Datasheet HTML 157Page - Microchip Technology Next Button
Zoom Inzoom in Zoom Outzoom out
 153 / 290 page
background image
© 2006 Microchip Technology Inc.
Preliminary
DS70175D-page 153
PIC24H
15.0
SERIAL PERIPHERAL
INTERFACE (SPI)
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 regis-
ters, display drivers, A/D converters, etc. The SPI module
is compatible with SPI and SIOP from Motorola®.
15.1
Operating Function Description
Each SPI module consists of a 16-bit shift register,
SPIxSR (where x = 1 or 2), used for shifting data in and
out, and a buffer register, SPIxBUF. A control register,
SPIxCON, configures the module. Additionally, a sta-
tus register, SPIxSTAT, indicates various status condi-
tions.
The serial interface consists of 4 pins: SDIx (serial data
input), SDOx (serial data output), SCKx (shift clock
input or output), and SSx (active low slave select).
In Master mode operation, SCK is a clock output but in
Slave mode, it is a clock input.
A series of eight (8) or sixteen (16) clock pulses shift
out bits from the SPIxSR to SDOx pin and simulta-
neously shift in data from SDIx pin. An interrupt is gen-
erated when the transfer is complete and the
corresponding interrupt flag bit (SPI1IF or SPI2IF) is
set. This interrupt can be disabled through an interrupt
enable bit (SPI1IE or SPI2IE).
The receive operation is double-buffered. When a com-
plete byte is received, it is transferred from SPIxSR to
SPIxBUF.
If the receive buffer is full when new data is being trans-
ferred from SPIxSR to SPIxBUF, the module will set the
SPIROV bit indicating an overflow condition. The trans-
fer of the data from SPIxSR to SPIxBUF will not be
completed and the new data will be lost. The module
will not respond to SCL transitions while SPIROV is ‘1’,
effectively disabling the module until SPIxBUF is read
by user software.
Transmit writes are also double-buffered. The user
writes to SPIxBUF. When the master or slave transfer
is completed, the contents of the shift register (SPIxSR)
are moved to the receive buffer. If any transmit data
has been written to the buffer register, the contents of
the transmit buffer are moved to SPIxSR. The received
data is thus placed in SPIxBUF and the transmit data in
SPIxSR is ready for the next transfer.
The module supports a basic framed SPI protocol while
operating in either Master or Slave mode. 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
Synchronization I/O Pulse
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 an SPI module is shown in
Figure 15-1. All PIC24H devices contain two SPI
modules on a single device.
The SPI module contains an 8-word deep FIFO buffer;
the top of the buffer is denoted as SPIxBUF. If DMA
transfers are enabled, the FIFO buffer must be
disabled by clearing the ENHBUF bit (SPIxCON2<0>).
To set up the SPI module for the Master mode of
operation:
1.
If using interrupts:
a)
Clear the SPIxIF bit in the respective IFSn
register.
b)
Set the SPIxIE bit in the respective IECn
register.
c)
Write the SPIxIP bits in the respective IPCn
register to set the interrupt priority.
2.
Write the desired settings to the SPIxCON
register with MSTEN (SPIxCON1<5>) = 1.
3.
Clear the SPIROV bit (SPIxSTAT<6>).
4.
Enable SPI operation by setting the SPIEN bit
(SPIxSTAT<15>).
5.
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.
Note:
This data sheet summarizes the features
of this group of PIC24H devices. It is not
intended to be a comprehensive reference
source. To complement the information in
this data sheet, refer to the “dsPIC30F
Family Reference Manual” (DS70046).
Note:
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.
Note:
Both the transmit buffer (SPIxTXB) and
the receive buffer (SPIxRXB) are mapped
to the same register address, SPIxBUF.
Note:
Do not perform read-modify-write opera-
tions (such as bit-oriented instructions) on
the SPIxBUF register.



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100  ...More


Scheda tecnica Scarica

Go To PDF Page


Link URL



Lei ha avuto il aiuto da alldatasheet?  [ DONATE ] 

Di alldatasheet   |   Richest di pubblicita   |   contatti   |   Privacy Policy   |   Collegamento alla scheda tecnica    |   scambio Link   |   Ricerca produttore
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com