Hi, the connection between caffeine and the frequency limit of flicker detection of the retina fascinates me (I believe it and I think I had experienced it). Can you give me some reference? Thanks in advance, Imre On Thu, 25 Jun 1998, James Cameron wrote: > G'day, > > Amateur wants to learn. > > My MOSFETs are getting hot and I'm wondering why. Is my PWM frequency > too high? Am I simply pushing them too hard? > > I'm driving a pair of 21W 12V (1.75A) lamps using a MTP3055E MOSFET each > from port A bits zero and one using a pulse width modulation (PWM) > routine. At an ambient temperature of 120C they reach 44.40C, with no > heatsink or fan. > > Circuit is port to gate, source to ground, drain to lamp, then lamp to > the 13.6V 2A unregulated supply. I have a GIF of the schematic I can > mail to anyone who asks. It's a project for Technical Aid to the > Disabled ... a light box communication device for very young children. > > The supply voltage stabilises under load to be about 14.4V, and a DVM > across the lamp shows about 10.5V at my chosen duty cycle of 200/256, or > 71%. > > The PWM routine "light" is called as frequently as possible; usually > with only two instruction cycles between each call. The PWM is simple > and is derived from the Scott Edwards source book; repetitive addition > in an accumulator and taking the carry output as the PWM signal. > > The code follows. I calculate 15 cycles at 4MHz between each setting of > the output bits. With a 71% bit pattern of 011101111011101111 that's > roughly 67 cycles between pulses, so a frequency of 15kHz. I hope. > > a_left equ 0x12 ; duty cycle accumulators > a_right equ 0x13 > > d_left equ 0x14 ; duty cycle settings (set to 200) > d_right equ 0x15 > > port equ PORTA > > b_left equ 0x00 ; gate of mosfet for left lamp > b_right equ 0x01 ; gate of mosfet for right lamp > > [...] > > light ; update lights using duty cycles > movf d_left,w > addwf a_left,f > btfsc STATUS,C > goto light_1 > bcf port,b_left > goto light_2 > light_1 > bsf port,b_left > light_2 > movf d_right,w > addwf a_right,f > btfsc STATUS,C > goto light_3 > bcf port,b_right > goto light_4 > light_3 > bsf port,b_right > light_4 > return > > [...] > > -- > James Cameron (james.cameron@digital.com) > Digital Equipment Corporation (Australia) Pty. Ltd. A.C.N. 000 446 800 > >