欢迎访问ic37.com |
会员登录 免费注册
发布采购

AT90PWM3B-16SU 参数 Datasheet PDF下载

AT90PWM3B-16SU图片预览
型号: AT90PWM3B-16SU
PDF下载: 下载PDF文件 查看货源
内容描述: 8位微控制器具有8K字节的系统内可编程闪存 [8-bit Microcontroller with 8K Bytes In-System Programmable Flash]
分类和应用: 闪存微控制器
文件页数/大小: 361 页 / 6022 K
品牌: ATMEL [ ATMEL ]
 浏览型号AT90PWM3B-16SU的Datasheet PDF文件第173页浏览型号AT90PWM3B-16SU的Datasheet PDF文件第174页浏览型号AT90PWM3B-16SU的Datasheet PDF文件第175页浏览型号AT90PWM3B-16SU的Datasheet PDF文件第176页浏览型号AT90PWM3B-16SU的Datasheet PDF文件第178页浏览型号AT90PWM3B-16SU的Datasheet PDF文件第179页浏览型号AT90PWM3B-16SU的Datasheet PDF文件第180页浏览型号AT90PWM3B-16SU的Datasheet PDF文件第181页  
AT90PWM2/3/2B/3B  
TABLE 2.  
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;  
}
Note:  
1. The example code assumes that the part specific header file is included.  
17.2 SS Pin Functionality  
17.2.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  
177  
4317J–AVR–08/10  
 复制成功!