| 전자부품 데이터시트 검색엔진 |
|
ATmega162 데이터시트(PDF) 161 Page - ATMEL Corporation |
|
|
|||||||||||||||||||||||||||||
ATmega162 데이터시트(HTML) 161 Page - ATMEL Corporation |
|
161 / 324 page ![]() 161 2513K–AVR–07/09 ATmega162/V The following code examples show how to initialize the SPI as a slave and how to perform a sim- ple reception. Note: 1. The example code assumes that the part specific header file is included. Assembly Code Example(1) SPI_SlaveInit: ; Set MISO output, all o?hers 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 com?lete 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 ?thers input */ DDR_SPI = (1<<DD_MISO); /* Enable SPI */ SPCR = (1<<SPE); } char SPI_SlaveReceive(void) { /* Wait for reception co?plete */ while (!(SPSR & (1<<?PIF))) ; /* Return data register ?/ return SPDR; } |
|
링크 URL |
| ALLDATASHEET 가 귀하에 도움이 되셨나요? [ DONATE ] |
Alldatasheet는? | 광고문의 | 운영자에게 연락하기 | 개인정보취급방침 | 링크 투 데이터시트 | 링크교환 | 제조사별 검색 All Rights Reserved©Alldatasheet.com |
| 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 |