Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add HW30A inc file #149

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ SHELL = /bin/bash

.SUFFIXES: .inc .hex

ALL_TARGETS = afro.hex afro2.hex afro_hv.hex afro_nfet.hex arctictiger.hex birdie70a.hex bs_nfet.hex bs.hex bs40a.hex dlu40a.hex dlux.hex dys_nfet.hex hk200a.hex hm135a.hex hxt200a.hex kda.hex kda_8khz.hex kda_nfet.hex kda_nfet_ni.hex mkblctrl1.hex rb50a.hex rb70a.hex rb70a2.hex rct50a.hex tbs.hex tbs_hv.hex tp.hex tp_8khz.hex tp_i2c.hex tp_nfet.hex tp70a.hex tgy6a.hex tgy_8mhz.hex tgy.hex
ALL_TARGETS = afro.hex afro2.hex afro_hv.hex afro_nfet.hex arctictiger.hex birdie70a.hex bs_nfet.hex bs.hex bs40a.hex dlu40a.hex dlux.hex dys_nfet.hex hk200a.hex hm135a.hex hw30a.hex hxt200a.hex kda.hex kda_8khz.hex kda_nfet.hex kda_nfet_ni.hex mkblctrl1.hex rb50a.hex rb70a.hex rb70a2.hex rct50a.hex tbs.hex tbs_hv.hex tp.hex tp_8khz.hex tp_i2c.hex tp_nfet.hex tp70a.hex tgy6a.hex tgy_8mhz.hex tgy.hex
AUX_TARGETS = afro_pr0.hex afro_pr1.hex diy0.hex

all: $(ALL_TARGETS)
Expand Down
70 changes: 70 additions & 0 deletions hw30a.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
;***********************************************************
;* XXD HW30A 30A Brushless Motor ESC *
;* with all nFETs *
;* December.2018 *
;* https://www.banggood.com/Wholesale-XXD-HW30A-30A-Brushless-Motor-ESC-For-Airplane-Quadcopter-p-50621.html *
;* https://github.com/NicksonYap/XXD-HW30A-ESC-Schematic *
;***********************************************************

.set F_CPU = 8000000
.equ USE_INT0 = 1
.equ USE_I2C = 0
.equ USE_UART = 0
.equ USE_ICP = 0

.equ DEAD_LOW_NS = 4000
.equ DEAD_HIGH_NS = 8000

;*********************
; PORT D definitions *
;*********************
.equ mux_c = 7 ;i <plus> comparator input (AIN0)
.equ c_comp = 6 ;i common comparator input (AIN0)
.equ CpFET = 5 ;o
.equ BpFET = 4 ;o
.equ ApFET = 3 ;o
.equ rcp_in = 2 ;i r/c pulse input

.equ INIT_PD = 0
.equ DIR_PD = (1<<ApFET)+(1<<BpFET)+(1<<CpFET)

.equ ApFET_port = PORTD
.equ BpFET_port = PORTD
.equ CpFET_port = PORTD

;*********************
; PORT C definitions *
;*********************
;.equ = 7 ; ADC7
;.equ = 6 ; ADC6
.equ mux_a = 5 ; ADC5 phase input
.equ mux_b = 4 ; ADC4 phase input
;.equ = 3 ; ADC3
;.equ = 2 ; ADC2 (plush has something on here)
;.equ mux_temperature = 1 ; ADC1 temperature input
.equ mux_voltage = 0 ; ADC0 voltage input (10k from Vbat, 1k to gnd, 10.10V -> .918V at ADC0)

.equ O_POWER = 10
.equ O_GROUND = 1

.equ INIT_PC = 0
.equ DIR_PC = 0

;*********************
; PORT B definitions *
;*********************
;.equ = 7
;.equ = 6
;.equ = 5 (sck stk200 interface)
;.equ = 4 (miso stk200 interface)
;.equ = 3 (mosi stk200 interface)
.equ CnFET = 2
.equ BnFET = 1
.equ AnFET = 0

.equ INIT_PB = 0
.equ DIR_PB = (1<<AnFET)+(1<<BnFET)+(1<<CnFET)

.equ AnFET_port = PORTB
.equ BnFET_port = PORTB
.equ CnFET_port = PORTB