9 Replies Latest reply on Dec 7, 2017 9:47 AM by user_342122993

    Up/Down accumulator for a type 2 phase detector (PLL)

    user_1409605

      Greetings all!

       

      I'm trying to make a type 2 phase detector for a PLL circuit (see attachment).  In this PLL, the VCO is external, and the PSOC will control it by a single control voltage through the VDAC (but it could also be a PWM).

       

      I'm looking for a kind of "accumulator", or up/down counter, that will control the VDAC's output voltage.  Normally, lines Qa and Qb are both low (this represents a locked phase condition, which is what we ultimately want).

       

      --> I want a condition, where:

           if there are pulses on the Qa line, then VDAC should increase its output.

           if there are pulses on the Qb line, then VDAC should decrease its output

           if there are no pulses, then VDAC should keep using its "last" value

       

      Is there such an accumulator/counter in PSOC?  I see counters, but I don't see an up/down counter.