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.

need clarification - using timer0 for delays

Status
Not open for further replies.

Fletcher

New Member
This is for PIC16F628

If i set the prescaler of timer0 to 1:256, it would take 256*256us to set the T0IF bit of INTCON.

so if i had some code like this:
Code:
DELAY1
BCF INTCON,T0IF :set t0if bit
MOVLW 0X00 ;Set timer0
MOVWF TMR0
BACK BTFSS INTCON,T0IF ;is t0if set yet
GOTO BACK
RETURN

would this allow for a 65ms delay? Im so confused because ive got it written down that setting timer0 to 0xFF would give me 65ms.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top