One thing i figure is to use the OSCLKO pin and connect to RB0 or else interrupt source. Once you'll be the in the interrupt routine, you'll be able to do everything. Generate all your delay and pin level. Will be a bit tricky to get the perfect timing but not impossible.
If you want to generate a 4MHZ clock, you'll need a 8MHZ crystal. Interrupt on rising or falling edge. Interrupt routine will generate your R, H1 and H2 frequency in one shot.
Depending your crystal speed, your instruction will be executed in few msec or less.
BUT for that kind of stuff where accuracy and precision is important, you'll probably need to do your delay and some test in assembler. Assembler instruction can be executed in 1 or 2 frequency cyle. Let's say at 8MHZ, 1 intruction every (1/(8Mhz/4)) = 0.5 uSec. Can be usefull to have a PIC who have an internal PLL to multiply your cystal speed.
If you have a 8MHZ crystal, execution time will be 4 times faster so from 0.5uSec to 0.125 uSec.
Last edited by mister_e; - 22nd February 2005 at 03:49.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks