This might work: ;-----bko----------------------------------------------------------------- evaluate_i2c: cbr flags1, (1<<EVAL_I2C) lds temp1, i2c_pwm ldi temp2, 200 ; or 100 for 8MHz boards cli mul temp1, temp2 ; clobbers r0 and r1 (i_sreg) subi r0, 1 ; add 255 (round up) sbci r1, -1 mov ZH, r1 sei ret