I am trying to use an AVR ATiny85 to control some high power LEDs (13W worth) using a International Rectifier's HEXFET Power MOSFET (datasheet attached). I assembled a test circuit and am trying to control the LEDs throught the MOSFET by using the Tiny's fast PWM to adjust the brightness of the LEDs.
When I connect the circuit after programming the Tiny, the LEDs do not turn on unless I come into contact with the gate pin, in which case they flicker (at first I thought the flickering was the system working so I adjusted the PWM frequency to get rid of the flicker but it remained at the same frequency indicating it is not).
I have the output pin from the Tiny hooked up directly to the gate pin on the MOSFET. Is this the configuration it should be in? do I need a pull up/ pull down resistor? is there some configuration I am missing in the Tiny? (code at the bottom)
From the datasheet of the transistor I thought it would work but I am no expert in these matters.
Please help
******************************************
Code
******************************************
.def Temp = R16
.def Temp2 = R23
.def Level = R17
.CSEG
.ORG $0000
rjmp RESET
reti
reti
reti
rjmp increment
reti
reti
reti
reti
reti
reti
reti
reti
reti
reti
RESET:
ldi Temp,(1<<DDB0)|(0<<DDB1)|(0<<DDB2)|(0<<DDB3)|(0<<DDB4)|(0<<DDB5)
out DDRB,Temp
ldi Temp, (1<<PORTB4)|(1<<PORTB0)
out PORTB, Temp
SEI
ldi temp, HIGH(RAMEND) ; Init MSB stack
out SPH,temp
ldi temp, LOW(RAMEND) ; Init LSB stack
out SPL,temp
ldi Temp, (1<<TSM)|(1<<PSR0)
out GTCCR, Temp
ldi Temp, (0<<CS02)|(1<<CS01)|(1<<CS00)
out TCCR0B, Temp
ldi Temp, 0x00
out GTCCR, Temp
ldi Temp, (1<<WGM00)|(1<<WGM01)|(1<<COM0A1)
out TCCR0A, Temp
ldi Level, 0
out OCR0A, Level
ldi Temp, (1<<CS13)|(1<<CS12)|(1<<CS11)|(1<<CS10)
out TCCR1, Temp
ldi Temp, (1<<TOIE1)
out TIMSK, Temp
MAIN:
nop
rjmp MAIN
increment:
inc Level
out OCR0A, Level
reti