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.

Timer0 in PIC16F72

Status
Not open for further replies.
Hi,

The problem was i think it has internal RC oscillator i will connect crystal and tell what happen..
 
Can you point to the section describing the internal oscillator? I could not find it. Moreover, if there is an internal RC oscillator, you would need to include some statements to assign the frequency. You did not include those.

Why not follow the datasheet? It is the best option you have. Have you confirmed that you have a working oscillator? If not, why not?

Edit: There is simply no mention of an internal oscillator of any type. Please review this:

upload_2013-10-29_8-13-33.png


John
 

Attachments

  • upload_2013-10-29_8-11-53.png
    upload_2013-10-29_8-11-53.png
    19.3 KB · Views: 160
Last edited:
hi ritesh,
What are the R/C values of your RC Oscillator circuit.?
 
OK, I was stupid enough to read the first 1.5 pages. I have been punished. I will not read the next 20. (wait)

Please forgive me.

Mike.
 
Since Ritesh seems to be interested in Assembly, I suggest PicList as a great resource:


There are a few delay code generators there, but this is the one I use when I don't use Mike McLaren's (K8LH):


Finally, assuming Ritesh settles on 4 to 20 MHz, he might be able to use this code directly (0.5 second at 4 MHz)(from PicList):
Code:
; Delay = 0.5 seconds
; Clock frequency = 4 MHz

; Actual delay = 0.5 seconds = 500000 cycles
; Error = 0 %

cblock
d1
d2
d3
endc
Delay     ;499994 cycles
     movlw 0x03
     movwf d1
     movlw 0x18
     movwf d2
     movlw 0x02
     movwf d3
Delay_0
     decfsz d1, f
     goto $+2
     decfsz d2, f
     goto $+2
     decfsz d3, f
     goto Delay_0

;6 cycles
     goto $+1
     goto $+1
     Return

I usually leave out the fine tuning (i.e., the two goto $+1's at the end).
John
 
Last edited:
Ritesh if you have given up on C and now going with ASM then take a look at nigels page he has loads of tutorials for ASM, but can i ask why the move from C??
 
Ritesh if you have given up on C and now going with ASM then take a look at nigels page he has loads of tutorials for ASM, but can i ask why the move from C??

hi LG,
This what Ritesh said in his opening post.
I was reading data sheet and want to learn Timer0 in assembly
and why not.?
E
 
Status
Not open for further replies.

Latest threads

Back
Top