[time-nuts] A Simple PIC Divider

Hal Murray hmurray at suespammers.org
Mon Aug 7 06:25:30 UTC 2006


> If I wanted to divide a 10MHz clock down to 100KHz, I could do something
> like:

> #include <12F629.h>

> #use delay(clock=10000000)
> main()
> {
>	while(1){
>		delay_us(5);
>		output_toggle(PIN_A0);
>	}
>}

I don't think that will do what I want.  The problem is the clocks that it 
takes to do the toggle and loop overhead.

You can probably get it right by tweaking the delay after looking at the 
assembly listing or a scope.




-- 
The suespammers.org mail server is located in California.  So are all my
other mailboxes.  Please do not send unsolicited bulk e-mail or unsolicited
commercial e-mail to my suespammers.org address or any of my other addresses.
These are my opinions, not necessarily my employer's.  I hate spam.







More information about the Time-nuts_lists.febo.com mailing list