;**** **** **** **** ****
;
; BLHeli program for controlling brushless motors in helicopters
;
; Copyright 2011, 2012 Steffen Skaug
; This program is distributed under the terms of the GNU General Public License
;
; This file is part of BLHeli.
;
; BLHeli is free software: you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation, either version 3 of the License, or
; (at your option) any later version.
;
; BLHeli is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with BLHeli. If not, see .
;
;**** **** **** **** ****
;*********************
; Device Atmega48V
;*********************
.include "m48def.inc"
;**** **** **** **** ****
; Fuses must be set to internal calibrated oscillator = 8Mhz
;**** **** **** **** ****
;**** **** **** **** ****
; Constant definitions
;**** **** **** **** ****
.equ ADC_LIMIT_L = 254 ; Power supply measurement ADC value for which main motor power is limited (low byte)
.equ ADC_LIMIT_H = 0 ; Power supply measurement ADC value for which main motor power is limited (2 MSBs)
;*********************
; PORT D definitions *
;*********************
.equ Mux_A = 7 ;i Phase A input
.equ Comp_Com = 6 ;i Comparator common input (AIN0)
;.equ = 5
;.equ = 4
.equ ApFET = 3 ;o
.equ Rcp_In = 2 ;i RC pulse input
.equ BpFET = 1 ;o
.equ CpFET = 0 ;o
.equ INIT_PD = 0
.equ DIR_PD = (1<