rather than using internal delay func use timer0  generated 1ms delay