ATA5771-DK1 Atmel, ATA5771-DK1 Datasheet - Page 128

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.2
128
Atmel ATA5771/73/74
SPI Master Operation Example
The following code demonstrates how to use the USI module as a SPI Master:
The code is size optimized using only eight instructions (+ ret). The code example assumes
that the DO and USCK pins are enabled as output in the DDRE Register. The value stored in
register r16 prior to the function is called is transferred to the Slave device, and when the
transfer is completed the data received from the Slave is stored back into the r16 Register.
The second and third instructions clears the USI Counter Overflow Flag and the USI counter
value. The fourth and fifth instruction set Three-wire mode, positive edge Shift Register clock,
count at USITC strobe, and toggle USCK. The loop is repeated 16 times.
The following code demonstrates how to use the USI module as a SPI Master with maximum
speed (f
SPITransfer:
SPITransfer_loop:
SPITransfer_Fast:
out
ldi
out
ldi
out
in
sbrs
rjmp
in
ret
out
ldi
ldi
out
out
out
out
out
out
out
out
out
out
out
out
out
out
out
out
sck
= f
ck
/4):
USIDR,r16
r16,(1<<USIOIF)
USISR,r16
r16,(1<<USIWM0)|(1<<USICS1)|(1<<USICLK)|(1<<USITC)
USICR,r16
r16, USISR
r16, USIOIF
SPITransfer_loop
r16,USIDR
USIDR,r16
r16,(1<<USIWM0)|(0<<USICS0)|(1<<USITC)
r17,(1<<USIWM0)|(0<<USICS0)|(1<<USITC)|(1<<USICLK)
USICR,r16 ; MSB
USICR,r17
USICR,r16
USICR,r17
USICR,r16
USICR,r17
USICR,r16
USICR,r17
USICR,r16
USICR,r17
USICR,r16
USICR,r17
USICR,r16
USICR,r17
USICR,r16 ; LSB
USICR,r17
9137E–RKE–12/10

Related parts for ATA5771-DK1