ATTINY48-MMHR Atmel, ATTINY48-MMHR Datasheet - Page 122

no-image

ATTINY48-MMHR

Manufacturer Part Number
ATTINY48-MMHR
Description
MCU AVR 4KB FLASH 12MHZ 28QFN
Manufacturer
Atmel
Series
AVR® ATtinyr
Datasheet

Specifications of ATTINY48-MMHR

Core Processor
AVR
Core Size
8-Bit
Speed
12MHz
Connectivity
I²C, SPI
Peripherals
Brown-out Detect/Reset, POR, WDT
Number Of I /o
24
Program Memory Size
4KB (2K x 16)
Program Memory Type
FLASH
Eeprom Size
64 x 8
Ram Size
256 x 8
Voltage - Supply (vcc/vdd)
1.8 V ~ 5.5 V
Data Converters
A/D 8x10b
Oscillator Type
Internal
Operating Temperature
-40°C ~ 85°C
Package / Case
*
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
122
ATtiny48/88
When the SPI is enabled, the data direction of the MOSI, MISO, SCK, and SS pins is overridden
according to
“Alternate Port Functions” on page
Table 14-1.
Note:
The following code examples show how to initialize the SPI as a Master and how to perform a
simple transmission. DDR_SPI in the examples must be replaced by the actual Data Direction
Register controlling the SPI pins. DD_MOSI, DD_MISO and DD_SCK must be replaced by the
actual data direction bits for these pins. E.g. if MOSI is placed on pin PB5, replace DD_MOSI
with DDB5 and DDR_SPI with DDRB.
Note:
Assembly Code Example
MOSI
MISO
SCK
SPI_MasterInit:
SPI_MasterTransmit:
Wait_Transmit:
Pin
SS
; Set MOSI and SCK output, all others input
ldi
out
; Enable SPI, Master, set clock rate fck/16
ldi
out
ret
; Start transmission of data (r16)
out
; Wait for transmission complete
sbis SPSR,SPIF
rjmp Wait_Transmit
ret
1. See
1.
direction of the user defined SPI pins.
See ”About Code Examples” on page 7.
Table 14-1 on page
r17,(1<<DD_MOSI)|(1<<DD_SCK)
DDR_SPI,r17
r17,(1<<SPE)|(1<<MSTR)|(1<<SPR0)
SPCR,r17
SPDR,r16
SPI Pin Overrides
“Alternate Functions of Port B” on page 69
Direction, Master SPI
User Defined
Input
User Defined
User Defined
(1)
(1)
122. For more details on automatic port overrides, refer to
65.
for a detailed description of how to define the
Direction, Slave SPI
Input
User Defined
Input
Input
8008G–AVR–04/11

Related parts for ATTINY48-MMHR