Include frequency=0 in illegal frequency check
Clear pending IRQ before "start()" re-enables IRQ

This change prevents the event handler from being called immediately if
there is a pending interrupt (because a period has elapsed) when calling
start.