mcu_cfg.inc
#ifndef _MCU_CFG_INC_
#define _MCU_CFG_INC_
;------------------------------------------------------------------
; MCU CONFIG
;------------------------------------------------------------------
.EQU DRV_PIN = PINB0
.EQU START_PIN = PINB1
.EQU LED_PIN = PINB2
.EQU STOP_PIN = PINB3
.EQU PORTB_DIR_CFG = (1<<LED_PIN)|(1<<DRV_PIN)|(0<<START_PIN)|(0<<STOP_PIN)
.EQU PORTB_DAT_CFG = (1<<LED_PIN)|(1<<DRV_PIN)|(1<<START_PIN)|(1<<STOP_PIN)
;------------------------------------------------------------------
#endif
useful_macro_tn12.asm
#ifndef _USEFUL_MACROS_ASM_
#define _USEFUL_MACROS_ASM_
.macro outi
; Writes a 8-bit immediate value to an 8-bit i/o SFR.
; Usage: outi IOREG8,value.
; Uses/trashes a tmp register for operation.
ldi tmp,@1
out @0,tmp
.endm
#endif
main.asm
;=====================================================================
.DEVICE ATtiny12
;---------------------------------------------------------------------
.INCLUDE "tn12def.inc"
.INCLUDE "mcu_cfg.inc"
.INCLUDE "useful_macro_tn12.asm"
outi DDRB,PORTB_DIR_CFG
outi PORTB,PORTB_DAT_CFG