;**** **** **** **** ****
;
; BLHeli program for controlling brushless motors in helicopters and multirotors
;
; 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 .
;
;**** **** **** **** ****
;
; SuperSimple 40A hardware definition file
;
; Notes: None
;
;**** **** **** **** ****
;*********************
; Device Atmega8L
;*********************
.INCLUDE "m8def.inc"
;**** **** **** **** ****
; Fuses must be set to external oscillator = 16Mhz
;**** **** **** **** ****
;**** **** **** **** ****
; Constant definitions
;**** **** **** **** ****
.ESEG ; EEprom segment
.ORG 0x40
Eep_ESC_Layout: .DB "#SuperS_40A# " ; ESC layout tag
.ORG 0x50
Eep_ESC_MCU: .DB "#BLHELI#Am8L# " ; Project and MCU tag (16 Bytes)
.EQU CLK_8M = 0 ; Set to 0 for 16MHz clock, and 1 if 8MHz clock
.EQU HIGH_BEC_VOLTAGE = 0 ; Set to 1 or more if high BEC voltage is supported
.EQU DAMPED_MODE_ENABLE = 1 ; Set to 1 if fully damped mode is supported
.EQU NFETON_DELAY = 5 ; Wait delay from pfets off to nfets on
.EQU PFETON_DELAY = 5 ; Wait delay from nfets off to pfets on
.EQU COMP_PWM_HIGH_ON_DELAY = 10 ; Wait delay from pwm on until comparator can be read (for high pwm frequency)
.EQU COMP_PWM_HIGH_OFF_DELAY = 20 ; Wait delay from pwm off until comparator can be read (for high pwm frequency)
.EQU COMP_PWM_LOW_ON_DELAY = 10 ; Wait delay from pwm on until comparator can be read (for low pwm frequency)
.EQU COMP_PWM_LOW_OFF_DELAY = 20 ; Wait delay from pwm off until comparator can be read (for low pwm frequency)
.EQU HIGH_DRIVER_PRECHG_TIME = 0 ; Time between commutations used to precharge the high side driver (for all nfet ESCs)
.EQU ADC_LIMIT_L = 101 ; 4.3k/47k divider. Power supply measurement ADC value for which motor power is limited (low byte)
.EQU ADC_LIMIT_H = 0 ; 4.3k/47k divider. Power supply measurement ADC value for which motor power is limited (2 MSBs)
.EQU TEMP_LIMIT = 0 ; No sensor. Temperature measurement ADC value for which main motor power is limited
.EQU TEMP_LIMIT_STEP = 0 ; No sensor. Temperature measurement ADC value increment for which main motor power is further limited
;**** **** **** **** ****
; ESC specific defaults
;**** **** **** **** ****
.EQU DEFAULT_PGM_MAIN_SPOOLUP_TIME = 10 ; Main motor spoolup time
.EQU DEFAULT_PGM_MAIN_STARTUP_PWR = 9 ; 1=0.031 2=0.047 3=0.063 4=0.094 5=0.125 6=0.188 7=0.25 8=0.38 9=0.50 10=0.75 11=1.00 12=1.25 13=1.50
.EQU DEFAULT_PGM_TAIL_STARTUP_PWR = 9 ; 1=0.031 2=0.047 3=0.063 4=0.094 5=0.125 6=0.188 7=0.25 8=0.38 9=0.50 10=0.75 11=1.00 12=1.25 13=1.50
.EQU DEFAULT_PGM_MULTI_STARTUP_PWR = 9 ; 1=0.031 2=0.047 3=0.063 4=0.094 5=0.125 6=0.188 7=0.25 8=0.38 9=0.50 10=0.75 11=1.00 12=1.25 13=1.50
;*********************
; PORT D definitions *
;*********************
.EQU CnFET = 7 ;o
;.EQU = 6 ;i
.EQU CpFET = 5 ;o
.EQU BpFET = 4 ;o
.EQU BnFET = 3 ;o
.EQU Rcp_In = 2 ;i
.EQU AnFET = 1 ;o
.EQU ApFET = 0 ;o
.equ INIT_PD = 0x00
.equ DIR_PD = (1<