Electronic Components Datasheet Search
  English  ▼
ALLDATASHEET.NET

X  

PIC16LC771 Datasheet(PDF) 71 Page - Microchip Technology

Part # PIC16LC771
Description  18/20-Pin, 8-Bit CMOS Microcontrollers with 10/12-Bit A/D
PDF  224 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  MICROCHIP [Microchip Technology]
Direct Link  http://www.microchip.com
Logo MICROCHIP - Microchip Technology

PIC16LC771 Datasheet(HTML) 71 Page - Microchip Technology

Back Button PIC16LC771 Datasheet HTML 67Page - Microchip Technology PIC16LC771 Datasheet HTML 68Page - Microchip Technology PIC16LC771 Datasheet HTML 69Page - Microchip Technology PIC16LC771 Datasheet HTML 70Page - Microchip Technology PIC16LC771 Datasheet HTML 71Page - Microchip Technology PIC16LC771 Datasheet HTML 72Page - Microchip Technology PIC16LC771 Datasheet HTML 73Page - Microchip Technology PIC16LC771 Datasheet HTML 74Page - Microchip Technology PIC16LC771 Datasheet HTML 75Page - Microchip Technology Next Button
Zoom Inzoom in Zoom Outzoom out
 71 / 224 page
background image
 1999-2013 Microchip Technology Inc.
Advance Information
DS41120C-page 71
PIC16C717/770/771
When the application software is expecting to receive
valid data, the SSPBUF should be read before the next
byte of data to transfer is written to the SSPBUF. Buffer
full bit, BF (SSPSTAT<0>), indicates when the SSP-
BUF has been loaded with the received data (transmis-
sion is complete). When the SSPBUF is read, bit BF is
cleared. This data may be irrelevant if the SPI is only a
transmitter. Generally the MSSP Interrupt is used to
determine when the transmission/reception has com-
pleted. The SSPBUF must be read and/or written. If the
interrupt method is not going to be used, then software
polling can be done to ensure that a write collision does
not occur. Example 9-1 shows the loading of the SSP-
BUF (SSPSR) for data transmission.
EXAMPLE 9-1:
Loading the SSPBUF
(SSPSR) Register
The SSPSR is not directly readable or writable, and
can only be accessed by addressing the SSPBUF reg-
ister.
Additionally,
the
MSSP
STATUS
register
(SSPSTAT) indicates the various status conditions.
9.1.2
ENABLING SPI I/O
To enable the serial port, MSSP Enable bit, SSPEN
(SSPCON<5>) must be set. To reset or reconfigure SPI
mode, clear bit SSPEN, re-initialize the SSPCON reg-
isters, and then set bit SSPEN. This configures the
SDI, SDO, SCK and SS pins as serial port pins. For the
pins to behave as the serial port function, some must
have their data direction bits (in the TRIS register)
appropriately programmed. That is:
• SDI is automatically controlled by the SPI module
• SDO must have TRISB<5> cleared
• SCK (Master mode) must have TRISB<2>
cleared
• SCK (Slave mode) must have TRISB<2> set
•SS must have TRISB<1> set, and ANSEL<5>
cleared
Any serial port function that is not desired may be over-
ridden by programming the corresponding data direc-
tion (TRIS) register to the opposite value.
9.1.3
TYPICAL CONNECTION
Figure 9-2 shows a typical connection between two
microcontrollers. The master controller (Processor 1)
initiates the data transfer by sending the SCK signal.
Data is shifted out of both shift registers on their pro-
grammed clock edge, and latched on the opposite
edge of the clock. Both processors should be pro-
grammed to same Clock Polarity (SSPCON<4>), then
both controllers would send and receive data at the
same time. Whether the data is meaningful (or dummy
data) depends on the application software. This leads
to three scenarios for data transmission:
• Master sends data
—Slave sends dummy data
• Master sends data
—Slave sends data
• Master sends dummy data
—Slave sends data
FIGURE 9-2:
SPI MASTER/SLAVE CONNECTION
BSF
STATUS, RP0
;Specify Bank 1
LOOP BTFSS SSPSTAT, BF
;Has data been
;received
;(xmit complete)?
GOTO
LOOP
;No
BCF
STATUS, RP0
;Specify Bank 0
MOVF
SSPBUF, W
;Save SSPBUF...
MOVWF RXDATA
;...in user RAM
MOVF
TXDATA, W
;Get next TXDATA
MOVWF SSPBUF
;New data to xmit
Serial Input Buffer
(SSPBUF)
Shift Register
(SSPSR)
MSb
LSb
SDO
SDI
PROCESSOR 1
SCK
SPI Master SSPM<3:0> = 00xxb
Serial Input Buffer
(SSPBUF)
Shift Register
(SSPSR)
LSb
MSb
SDI
SDO
PROCESSOR 2
SCK
SPI Slave SSPM<3:0> = 010xb
Serial Clock



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


Datasheet Download

Go To PDF Page


Link URL



Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Contact us   |   Privacy Policy   |   Link to Datasheet    |   Link Exchange   |   Manufacturer List
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