Motore di ricerca datesheet componenti elettronici
  Italian  ▼
ALLDATASHEETIT.COM

X  

DOC7707 Scheda tecnica(PDF) 141 Page - List of Unclassifed Manufacturers

Il numero della parte DOC7707
Spiegazioni elettronici  Microcontroller with 8/16K Bytes of ISP Flash and USB Controller
PDF  307 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Produttore elettronici  ETC1 [List of Unclassifed Manufacturers]
Homepage  
Logo ETC1 - List of Unclassifed Manufacturers

DOC7707 Scheda tecnica(HTML) 141 Page - List of Unclassifed Manufacturers

Back Button DOC7707 Datasheet HTML 137Page - List of Unclassifed Manufacturers DOC7707 Datasheet HTML 138Page - List of Unclassifed Manufacturers DOC7707 Datasheet HTML 139Page - List of Unclassifed Manufacturers DOC7707 Datasheet HTML 140Page - List of Unclassifed Manufacturers DOC7707 Datasheet HTML 141Page - List of Unclassifed Manufacturers DOC7707 Datasheet HTML 142Page - List of Unclassifed Manufacturers DOC7707 Datasheet HTML 143Page - List of Unclassifed Manufacturers DOC7707 Datasheet HTML 144Page - List of Unclassifed Manufacturers DOC7707 Datasheet HTML 145Page - List of Unclassifed Manufacturers Next Button
Zoom Inzoom in Zoom Outzoom out
 141 / 307 page
background image
141
7707F–AVR–11/10
AT90USB82/162
The following code examples show how to initialize the SPI as a Slave and how to perform a
simple reception.
Note:
1. See “About Code Examples” on page 7.
16.1
SS Pin Functionality
16.1.1
Slave Mode
When the SPI is configured as a Slave, the Slave Select (SS) pin is always input. When SS is
held low, the SPI is activated, and MISO becomes an output if configured so by the user. All
other pins are inputs. When SS is driven high, all pins are inputs, and the SPI is passive, which
Assembly Code Example
(1)
SPI_SlaveInit:
; Set MISO output, all others input
ldi
r17,(1<<DD_MISO)
out
DDR_SPI,r17
; Enable SPI
ldi
r17,(1<<SPE)
out
SPCR,r17
ret
SPI_SlaveReceive:
; Wait for reception complete
sbis
SPSR,SPIF
rjmp
SPI_SlaveReceive
; Read received data and return
in
r16,SPDR
ret
C Code Example
(1)
void
SPI_SlaveInit(void)
{
/* Set MISO output, all others input */
DDR_SPI = (1<<DD_MISO);
/* Enable SPI */
SPCR = (1<<SPE);
}
char
SPI_SlaveReceive(void)
{
/* Wait for reception complete */
while
(!(SPSR & (1<<SPIF)))
;
/* Return Data Register */
return
SPDR;
}



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