Synchronising HWPM to an external source
Hello all,
This is my very first post on any forum, ever! Be gentle. :)
This is a Microcode Studio pbp question, not even sure if i'm on the right forum, but you seem a helpful lot!
I have a darlington pair hooked up to a recitifed (but not smoothed) 12v supply.
this gives me a beautiful pulse every 10ms or 100Hz (UK mains). i have this coming in via an adcin port.
I also have a PIC16F870configured with an RC network of 22KOhm and 45pF giving roughly a 1MHz clock - this is to get the HWPM down to 100Hz, i know it's not ideal and i have a 1Mhz crystal on order.
My question is, how do i synchronise the two? I'd like the HWPM to start the moment the darlington pair fire and then keep in sync with the pulses.
I'm using a 100k pot on an adcin to get 0 to 255 which is fed into the duty cycle of the hpwm command.
Any help appreciated.
Sorry, i meant hpwm not hwpm?
It was quite late when i posted, my eyelids were drooping! :o