HWA
Bare metal programming with style
ATtiny24/44/84

Detailed Description

Content of the device:

Modules

 ATtiny24
 
 ATtiny44
 
 ATtiny84
 

Target device description

These definitions are computed by HWA from the target device name.

#define HW_DEVICE_ATTINYX4
 
#define HW_DEVICE_RAM_START   0x0060
 
#define HW_DEVICE_APP_START   0x0022
 

Fuse bytes

These definitions are computed by HWA from the target device name and the definitions provided by the user.

#define HW_DEVICE_FUSE_EB   (0xFE | HW_DEVICE_SELFPRGEN)
 
#define HW_DEVICE_FUSE_HB
 
#define HW_DEVICE_FUSE_LB
 

User-defineable symbols

Before including the device-specific header, the user can define these symbols to describe the configuration of the target device. HWA defines undefined symbols with factory values.

#define HW_DEVICE_CLK_SRC   rc_8MHz
 
#define HW_DEVICE_CLK_PSC   8
 
#define HW_DEVICE_STARTUP_DELAYS
 
#define HW_DEVICE_CLOCK_OUTPUT   disabled
 
#define HW_DEVICE_SELF_PROGRAMMING   enabled
 
#define HW_DEVICE_EXTERNAL_RESET   enabled
 
#define HW_DEVICE_DEBUG_WIRE   disabled
 
#define HW_DEVICE_SERIAL_PROGRAMMING   enabled
 
#define HW_DEVICE_WATCHDOG_ALWAYS_ON   no
 
#define HW_DEVICE_PRESERVE_EEPROM_FROM_CHIP_ERASE   no
 
#define HW_DEVICE_BROWNOUT_DETECTION   off
 

Macro Definition Documentation

◆ HW_DEVICE_APP_START

#define HW_DEVICE_APP_START   0x0022

Address of first application byte (after IRQ vector table)

◆ HW_DEVICE_ATTINYX4

#define HW_DEVICE_ATTINYX4

Device family

◆ HW_DEVICE_BROWNOUT_DETECTION

#define HW_DEVICE_BROWNOUT_DETECTION   off

Brown-out detection level

off
1700_2000mV
2500_2900mV
4100_4500mV

◆ HW_DEVICE_CLK_PSC

#define HW_DEVICE_CLK_PSC   8

Clock prescaler

1
Clock not prescaled
8
Clock divided by 8

◆ HW_DEVICE_CLK_SRC

#define HW_DEVICE_CLK_SRC   rc_8MHz

How the device is clocked.

external
External source on pin CLKI
rc_8MHz
Internal RC oscillator
rc_128kHz
Internal RC oscillator (watchdog)
low_freq_xosc
Crystal/resonator oscillator between pins XTAL1 and XTAL2
xosc
Crystal/resonator oscillator between pins XTAL1 and XTAL2

◆ HW_DEVICE_CLOCK_OUTPUT

#define HW_DEVICE_CLOCK_OUTPUT   disabled

Whether the device outputs its clock

enabled
disabled

◆ HW_DEVICE_DEBUG_WIRE

#define HW_DEVICE_DEBUG_WIRE   disabled

Whether the Debug Wire is operationnal

enabled
disabled

◆ HW_DEVICE_EXTERNAL_RESET

#define HW_DEVICE_EXTERNAL_RESET   enabled

Whether the device can be reset via its RESET pin

enabled
disabled

◆ HW_DEVICE_FUSE_EB

#define HW_DEVICE_FUSE_EB   (0xFE | HW_DEVICE_SELFPRGEN)

Computed value of the fuse extended byte.

◆ HW_DEVICE_FUSE_HB

#define HW_DEVICE_FUSE_HB
Value:
HW_DEVICE_RSTDISBL<<7 | \
HW_DEVICE_DWEN<<6 | \
HW_DEVICE_SPIEN<<5 | \
HW_DEVICE_WDTON<<4 | \
HW_DEVICE_EESAVE<<3 | \
HW_DEVICE_BODLEVEL

Computed value of the fuse high byte.

◆ HW_DEVICE_FUSE_LB

#define HW_DEVICE_FUSE_LB
Value:
HW_DEVICE_CKDIV8<<7 | \
HW_DEVICE_CKOUT<<6 | \
HW_DEVICE_SUT10<<4 | \
HW_DEVICE_CKSEL31<<1 | \
HW_DEVICE_CKSEL0

Computed value of the fuse low byte.

◆ HW_DEVICE_PRESERVE_EEPROM_FROM_CHIP_ERASE

#define HW_DEVICE_PRESERVE_EEPROM_FROM_CHIP_ERASE   no

Whether the EEPROM memory is erased when a chip erase occurs

enabled
disabled

◆ HW_DEVICE_RAM_START

#define HW_DEVICE_RAM_START   0x0060

Address of first RAM byte

◆ HW_DEVICE_SELF_PROGRAMMING

#define HW_DEVICE_SELF_PROGRAMMING   enabled

Whether the device can write into its Flash program memory

enabled
disabled

◆ HW_DEVICE_SERIAL_PROGRAMMING

#define HW_DEVICE_SERIAL_PROGRAMMING   enabled

Whether the device can be programmed via the SPI

enabled
disabled

◆ HW_DEVICE_STARTUP_DELAYS

#define HW_DEVICE_STARTUP_DELAYS

Startup delays

Valid values depend on the clocking configuration.

6CK_14CK
6CK_14CK_4ms
6CK_14CK_64ms
1KCK_4ms
1KCK_64ms
32KCK_64ms
258CK_14CK_4ms
258CK_14CK_64ms
1KCK_14CK
1KCK_14CK_4ms
1KCK_14CK_64ms
16KCK_14CK
16KCK_14CK_4ms
16KCK_14CK_64ms

◆ HW_DEVICE_WATCHDOG_ALWAYS_ON

#define HW_DEVICE_WATCHDOG_ALWAYS_ON   no

Whether the watchdog is always running

enabled
disabled