Steve,

I've also tried the following, which seems to flash the LED rather than ramp down in brighness

Code:
for i = 254 to 1 step-1                                             
    Pwm GPIO.0,i,1
    if i=2 then 
        i=1
        GetOut=1
        endif
   next i

if Getout=1 then goto down
I can't for the life of me work out what's wrong...