Event 8bit counter counts external events on pin PTD4. When 6 events are detected counter is reseted.