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..
 
Yes!! It can be confusing.. However the newer chips actually have oscillator modules that allow speeds of up to 8Mhz.
 
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:



John
 

Attachments

  • upload_2013-10-29_8-11-53.png
    19.3 KB · Views: 160
Last edited:
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.
 
For those of you who are pondering... Ritesh assumed that the chip has an internal RC block, it however, does not so I think he'll apply an extenal crystal..
 
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
 
Ritesh!! I've posted a simple interrupt article.... Any comments would be well received..

Just click "Articles" on the menu banner..
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…