Synchronising HWPM to an external source


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2009
    Posts
    7

    Default 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.

  2. #2
    Join Date
    Dec 2009
    Posts
    7


    Did you find this post helpful? Yes | No

    Default Sorry, i meant hpwm not hwpm?

    It was quite late when i posted, my eyelids were drooping!

  3. #3
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Default

    Hi,

    Why not have a look to the CCP COMPARE section of your Datasheet ??? just reset TMR1 @ zero crossing and load Compare value as the delay for delaying your SCR firing ...

    What about ???

    Also have a look to MELABS site examples page , Steve Monfette has provided a good example ... for dimmer.

    http://www.melabs.com/resources/samp...ted/dimmer.zip

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  4. #4
    Join Date
    Dec 2009
    Posts
    7


    Did you find this post helpful? Yes | No

    Default

    Hi,

    Thanks for responding with these suggestions Alain. I have tried resetting timer 2 - pic16f870 uses this for hardware pwm - t2con.2 = 0.
    This did not seem to work, the output pwm drifts slowly away.

    I will look through Steve Monfette's code to see if i can get some pointers.


    The circuit is - as you correctly surmised - for firing four SCR's at Zero crossing ~ 8kw power load so i want to get the timing bang on, the SCR's are expensive!

    I have been looking at the CCP Compare section of the datasheet and i'm still a little stumped?? How can i use this to synchronise the HPWM with an incoming zero crossing signal? I've been knee deep in datasheets and tutorials trying to get my head around this for days.

    Many Thanks again for your time.

    Gordon

Similar Threads

  1. Replies: 1
    Last Post: - 28th January 2010, 22:15
  2. Can't ID interrupt source with this IntHandler??
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 3rd June 2009, 02:35
  3. Filling pdu array with gps data!
    By camolas in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 4th October 2008, 00:54
  4. Replies: 0
    Last Post: - 15th December 2006, 19:16
  5. How to set external clock source in PBP
    By TurboLS in forum mel PIC BASIC Pro
    Replies: 28
    Last Post: - 19th February 2005, 15:56

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts