HWA
Bare metal programming with style
ATmega48A/PA/88A/PA/168A/PA/328/P

Detailed Description

Content of the device:

Modules

 ATmega168(P)
 
 ATmega328(P)
 
 ATmega48(P)
 
 ATmega88(P)
 

Target device description

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

#define HW_DEVICE_ATMEGAX8
 
#define HW_DEVICE_RAM_START   0x0100
 

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
 
#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_BOOTSECTION_SIZE   4096
 
#define HW_DEVICE_CLK_SRC   rc_8MHz
 
#define HW_DEVICE_CLK_SRC_HZ   8000000
 
#define HW_DEVICE_STARTUP_DELAYS
 
#define HW_DEVICE_CLOCK_OUTPUT   disabled
 
#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_THROUGH_CHIP_ERASE   no
 
#define HW_DEVICE_BROWNOUT_DETECTION   off
 
#define HW_DEVICE_BOOT   application
 

Macro Definition Documentation

◆ HW_DEVICE_ATMEGAX8

#define HW_DEVICE_ATMEGAX8

Device family

◆ HW_DEVICE_BOOT

#define HW_DEVICE_BOOT   application

Whether the device starts the bootloader (in the boot Flash) or the application.

◆ HW_DEVICE_BOOTSECTION_SIZE

#define HW_DEVICE_BOOTSECTION_SIZE   4096

Size of the boot section in bytes: 512, 1024, 2048, or 4096

◆ HW_DEVICE_BROWNOUT_DETECTION

#define HW_DEVICE_BROWNOUT_DETECTION   off

Brown-out detection level

off
1700_2000mV
2500_2900mV
4100_4500mV

◆ HW_DEVICE_CLK_SRC

#define HW_DEVICE_CLK_SRC   rc_8MHz

How the device is clocked.

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

◆ HW_DEVICE_CLK_SRC_HZ

#define HW_DEVICE_CLK_SRC_HZ   8000000

◆ 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
Value:
/* 0xF8 | */ \
HW_DEVICE_FUSE_BODLEVEL

Computed value of the fuse extended byte. Default: 0xFF.

◆ HW_DEVICE_FUSE_HB

#define HW_DEVICE_FUSE_HB
Value:
HW_DEVICE_FUSE_RSTDISBL<<7 | \
HW_DEVICE_FUSE_DWEN<<6 | \
HW_DEVICE_FUSE_SPIEN<<5 | \
HW_DEVICE_FUSE_WDTON<<4 | \
HW_DEVICE_FUSE_EESAVE<<3 | \
HW_DEVICE_FUSE_BOOTSZ<<1 | \
HW_DEVICE_FUSE_BOOTRST

Computed value of the fuse high byte. Default: 0xD9.

◆ HW_DEVICE_FUSE_LB

#define HW_DEVICE_FUSE_LB
Value:
HW_DEVICE_FUSE_CKDIV8<<7 | \
HW_DEVICE_FUSE_CKOUT<<6 | \
HW_DEVICE_FUSE_SUT10<<4 | \
HW_DEVICE_FUSE_CKSEL31<<1 | \
HW_DEVICE_FUSE_CKSEL0

Computed value of the fuse low byte. Default: 0x62.

◆ HW_DEVICE_PRESERVE_EEPROM_THROUGH_CHIP_ERASE

#define HW_DEVICE_PRESERVE_EEPROM_THROUGH_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   0x0100

Address of first RAM byte

◆ 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.

4CK
4CK_4ms
4CK_64ms
6CK_14CK
6CK_14CK_4ms
6CK_14CK_64ms
258CK_14CK_4ms
258CK_14CK_64ms
1KCK_4ms
1KCK_64ms
1KCK_14CK
1KCK_14CK_4ms
1KCK_14CK_64ms
16KCK_14CK
16KCK_14CK_4ms
16KCK_14CK_64ms
32KCK_64ms

◆ HW_DEVICE_WATCHDOG_ALWAYS_ON

#define HW_DEVICE_WATCHDOG_ALWAYS_ON   no

Whether the watchdog is always running

enabled
disabled