ATA5771-DK1 Atmel, ATA5771-DK1 Datasheet - Page 129

no-image

ATA5771-DK1

Manufacturer Part Number
ATA5771-DK1
Description
BOARD XMITTER FOR ATA5771 868MHZ
Manufacturer
Atmel
Type
Transmitterr
Datasheets

Specifications of ATA5771-DK1

Frequency
868MHz
Maximum Frequency
868 MHz
Supply Voltage (max)
4 V
Supply Voltage (min)
2 V
Supply Current
8.5 mA
Product
RF Development Tools
For Use With/related Products
ATA5771
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
4.18.3.3
9137E–RKE–12/10
SPI Slave Operation Example
The following code demonstrates how to use the USI module as a SPI Slave:
The code is size optimized using only eight instructions (+ ret). The code example assumes
that the DO is configured as output and USCK pin is configured as input in the DDR Register.
The value stored in register r16 prior to the function is called is transferred to the master
device, and when the transfer is completed the data received from the Master is stored back
into the r16 Register.
Note that the first two instructions is for initialization only and needs only to be executed
once.These instructions sets Three-wire mode and positive edge Shift Register clock. The
loop is repeated until the USI Counter Overflow Flag is set.
ret
init:
...
SlaveSPITransfer:
SlaveSPITransfer_loop:
in
ldi
out
out
ldi
out
in
sbrs
rjmp
in
ret
r16,USIDR
r16,(1<<USIWM0)|(1<<USICS1)
USICR,r16
USIDR,r16
r16,(1<<USIOIF)
USISR,r16
r16, USISR
r16, USIOIF
SlaveSPITransfer_loop
r16,USIDR
Atmel ATA5771/73/74
129

Related parts for ATA5771-DK1