;**** **** **** **** **** ; ; 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 Atmega8 ;********************* .include "m8def.inc" ;**** **** **** **** **** ; Fuses must be set to internal calibrated oscillator = 8Mhz ;**** **** **** **** **** ;**** **** **** **** **** ; Constant definitions ;**** **** **** **** **** .equ ADC_LIMIT_L = 45 ; 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 BpFET = 7 ;o .equ Comp_Com = 6 ;i Comparator common input (AIN0) .equ CpFET = 5 ;o .equ ApFET = 4 ;o .equ AnFET = 3 ;o .equ Rcp_In = 2 ;i RC pulse input .equ BnFET = 1 ;o .equ CnFET = 0 ;o .equ INIT_PD = 0 .equ DIR_PD = (1<