Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Polling T0IF Doubt

Status
Not open for further replies.

Suraj143

Active Member
When polling TMR0 we waiting until T0IF sets.My question is if T0IF sets will it halts the TMR0 increment?Or will it increment normally from 00h?

Will the same thing happens when use interrupts?
Means when T0IF sets it will goto ISR & if we not clear the T0IF bit will TMR0 increment?
 
When polling TMR0 we waiting until T0IF sets.My question is if T0IF sets will it halts the TMR0 increment?Or will it increment normally from 00h?

Will the same thing happens when use interrupts?
Means when T0IF sets it will goto ISR & if we not clear the T0IF bit will TMR0 increment?
The timer continues counting constantly unless you write code to stop it.
 
The interrupt will happen again immediately before returning from the ISR? I thought if the flag bit isn't cleared, the next interrupt will never happen again?

Suraj143,
The timer will still continue running until you stop it. The main reason of the bit flag is set with interrupt is because there can be more than one interrupt, so this flag bit is to indicate which interrupt has occurred.
 
The interrupt will happen again immediately before returning from the ISR? I thought if the flag bit isn't cleared, the next interrupt will never happen again?

It's a level triggered interrupt, as long as the interrupt flag is set, an interrupt will be generated.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top