Multiplying with 11 using PIC


Closed Thread
Results 1 to 28 of 28

Hybrid View

  1. #1
    Join Date
    Aug 2011
    Posts
    453


    Did you find this post helpful? Yes | No

    Default Re: Multiplying with 11 using PIC

    ...and sent to output the present frequency multiplied by 11.
    What do you mean by this?

    Do you want the pic to generate a square wave output from 11Hz to 11MHz on an output pin?

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: Multiplying with 11 using PIC

    What sort of resolution are we talking about and how much jitter can you tolerate (ie how "clean" must the output signal be)?

    I would think that your best bet is to use a PIC that has a 20bit NCO-peripheral. 18F25K42 is one such device. If you don't know how DDS frequency generation works make sure to read up on that in order to determine if it'll fit your application.

    If DDS works but the NCO won't live up to requirements you might be able to use an external DDS-chip with a higher base frequency and/or higher resolution and use the PIC to control that chip.

    /Henrik.

  3. #3
    Join Date
    Apr 2014
    Location
    OK
    Posts
    557


    Did you find this post helpful? Yes | No

    Default Re: Multiplying with 11 using PIC

    Please feel free to correct any faulty assumptions.

    First realize that to multiply a frequency by 11, you are dividing a time frame by 11.

    What does your frequency input look like? Is it a perfect square wave (50% duty cycle), an irregular square wave (!=50% DC), a sine wave?

    Assuming a square wave input, try using CCP1 in Capture Mode to measure the time frame of one Gate (low-high starts Capture, high-low stops it). Use CCP2 with the same source clock and divide that time frame and plug it into PWM at 50% DC.

    If your input is sine wave, you might need to use a Comparator to mark low-high and high-low transitions, then feed that into your CCP1.

    If you have an irregular square wave input, you need to measure low-high to low-high period.

    If your input frequency is extremely long (like 1 Hz), you may need a Signal Measurement Timer with 24 bits to measure the input period time. Keeping the clocks the same for measuring input and for your output means you just run the math (input period / 11 = output period).

    I hope this gives you ideas.

Similar Threads

  1. pass pic basic pro pic from pic 16f877a to pic 16f887
    By joseluisatmega8 in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 12th February 2020, 16:17
  2. High Speed Serial Comm PC - PIC and PIC - PIC
    By manumenzella in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 16th January 2007, 21:55
  3. Multiplying large numbers
    By jhonea1 in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 14th April 2006, 17:41

Members who have read this thread : 2

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