Hello
i built my own design esc
its got two leds on PC2 and PC3 and runs on a 16mhz crystal, aswell as a dedicated n-fet gate drive ic.
after flashing tgy.asm (compiled obviously) with a slightly modified afro_nfet.inc it doesnt do anything.
no fet driving, no leds blinking. no output on uart TX pin.. nothing
i compile with avrasm2 -fI tgy.asm
and flash via avrdude -p m8 -c arduino -P COM35 -b 19200 -U flash:w:tgy.hex
(using arduino uno as ISP).
ive attached a RC receiver giving out a stable 1000-2000µS signal, still nothing. pin rcp_in on PB0 is receiving the signal.
the crystal is oscillating just fine (16mhz) but i also tried lowering F_CPU to 8M and set fuses to use the internal 8Mhz osc.. no success.
theres also no output on UART TX with DEBUG_TX and USE_UART enabled
i tried commented out mux_temperature and mux_voltage in case ive put wrong resistors in there and its going in overtemp or undervoltage protection, but nothing....
i tried changing from
RED_on RED_off to BLUE_on BLUE_off led's and swapped green aswell..
also tried turning off CHECK_HARDWARE, turning off the BOOT_LOADER and BOOT_JUMP.. nothing.
Then i tried using my own code to test the actual board if its even working
and yes, the board itself is working, i tested it with the same fuses (lfuse 0x3F hfuse=0xCA) aswell as the fuses for the internal 8mhz oscillator, with a bare minimum assembler code thats just toggling all used pins on and off.
leds work, fet drive pins work aswell and the driver is switching the fets (at 460khz ... just to see if it works)
i also tried the blueesc fork of sim-/tgy which didnt work either.
any ideas?
this is the test code:
.NOLIST
.INCLUDE "m8def.inc"
.LIST
sbi DDRC,DDC2 ; Port pins as outputs
sbi DDRC,DDC3
sbi DDRB,DDB1
sbi DDRB,DDB2
sbi DDRD,DDD2
sbi DDRD,DDD3
sbi DDRD,DDD4
sbi DDRD,DDD5
Loop:
sbi PORTC,PORTC2 ; led red on
sbi PORTC,PORTC3 ; led blue on
;test code to turn fets on/off as fast as possible no motor commutation intended just for testing pins & ports.
cbi PORTB,PORTB1 ; CH gate driver phase C high off
sbi PORTD,PORTD2 ; AH gate driver phase A High on
sbi PORTD,PORTD5 ; CL gate driver phase C low on..
cbi PORTD,PORTD4 ; BL
sbi PORTB,PORTB2 ; BH
cbi PORTD,PORTD2 ; AH
cbi PORTD,PORTD5 ; CL
sbi PORTD,PORTD3 ; AL
cbi PORTB,PORTB2 ; BH
sbi PORTB,PORTB1 ; CH
cbi PORTD,PORTD3 ; AL
sbi PORTD,PORTD4 ; BL
cbi PORTC,PORTC2 ; led red off
cbi PORTC,PORTC3 ; led blue off
rjmp Loop ; repeat
Hello i built my own design esc its got two leds on PC2 and PC3 and runs on a 16mhz crystal, aswell as a dedicated n-fet gate drive ic.
after flashing tgy.asm (compiled obviously) with a slightly modified afro_nfet.inc it doesnt do anything. no fet driving, no leds blinking. no output on uart TX pin.. nothing
i compile with
avrasm2 -fI tgy.asm
and flash viaavrdude -p m8 -c arduino -P COM35 -b 19200 -U flash:w:tgy.hex
(using arduino uno as ISP).ive attached a RC receiver giving out a stable 1000-2000µS signal, still nothing. pin rcp_in on PB0 is receiving the signal.
the crystal is oscillating just fine (16mhz) but i also tried lowering F_CPU to 8M and set fuses to use the internal 8Mhz osc.. no success. theres also no output on UART TX with DEBUG_TX and USE_UART enabled
i tried commented out mux_temperature and mux_voltage in case ive put wrong resistors in there and its going in overtemp or undervoltage protection, but nothing....
i tried changing from RED_on RED_off to BLUE_on BLUE_off led's and swapped green aswell.. also tried turning off CHECK_HARDWARE, turning off the BOOT_LOADER and BOOT_JUMP.. nothing.
Then i tried using my own code to test the actual board if its even working and yes, the board itself is working, i tested it with the same fuses (lfuse 0x3F hfuse=0xCA) aswell as the fuses for the internal 8mhz oscillator, with a bare minimum assembler code thats just toggling all used pins on and off. leds work, fet drive pins work aswell and the driver is switching the fets (at 460khz ... just to see if it works)
i also tried the blueesc fork of sim-/tgy which didnt work either.
any ideas?
this is the test code:
my afro_nfet.inc looks like this