| поискавой системы для электроныых деталей |
|
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 |
| Вашему бизинису помогли Аллдатащит? [ DONATE ] |
Что такое Аллдатащит | реклама | контакт | Конфиденциальность | Ссылка на техническое описание | обмен ссыками | поиск по производителю 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 |