Maximum frequency output from a PIC


Closed Thread
Results 1 to 40 of 69

Hybrid View

  1. #1
    Join Date
    Oct 2012
    Posts
    83


    Did you find this post helpful? Yes | No

    Default Re: Maximum frequency output from a PIC

    Hi Henrik,

    I only asked to confirm my theory about how it will look at the other edge which is exactly your explanation.
    It does not make any difference to me for this application and as I stated before I could live with it even if it was longer. It is important though to know it so I can compensate for it.
    Happy Programmer’s day!

    Regards,

    Nick

  2. #2
    Join Date
    Oct 2012
    Posts
    83


    Did you find this post helpful? Yes | No

    Default Re: Maximum frequency output from a PIC

    As much as I hate to say it I managed to release a portion of the built in smoke from one of my PICs just before the load and test of the new codes.
    I did not have the smoke pump to push some back in nor did I have a replacement PIC handy so it will have to wait until tomorrow.

    Regards,

    Nick

  3. #3
    Join Date
    Oct 2012
    Posts
    83


    Did you find this post helpful? Yes | No

    Default Re: Maximum frequency output from a PIC

    After fixing the missing smoke problem and modifying the code for PIC12F683 (see my prior posts for configs) the code works without any glitches. I only added on the Tx side one other pin toggle so it made it easier on my scope to compare the Tx and Rx sync. I could see the small amount of jitter at each edge and by changing the time base of the scope I could read (as predicted) delays from about 6 uS to 12 uS. Sorry but I cannot post screen shots from my old analog scope but they are like Henrik’s samples.

    I cannot explain what happened the first time and why it did not work. It might have been my scope that was confused by the complex signals (at that time I did not have the extra pin toggling) and did not latch properly on the trigger.

    BTW Henrik what are you using as your scope? It looks pretty handy. I’m still using at least 10 years old technology and even though I’m getting close to retirement I’m planning on upgrading all my tools once again because this is going to be my favorite way of spending my free time. Hopefully good wife servicing this weekend will provide the necessary budget (LOL).

    I can’t thank enough to Henrik for his help and patience. I learned at least two new things that I was afraid to play with before: PWM side of the CCP1 module and the using TMR0 as fast counter. I always need to start with a simple working sample code to get me started and this exercise gave me the opportunity to build a good foundation for future projects. I envision at least 25 PICs working 24/7 in my house for the next 5 years driving various gadgets. I know some might say that you can buy one gadget that will do the work of all little once but nothing gives me more satisfaction when I see things that I built long ago still working with no failures. And on top of that “I got the hammer” (LOL again).

    Next step: interrupts.

    Regards,

    Nick

  4. #4
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,626


    Did you find this post helpful? Yes | No

    Default Re: Maximum frequency output from a PIC

    Hi Nick,
    No worries, I'm glad I could help and I'm glad you got it working.

    My scope is a RIGOL DS4014, it's a 4-channel 100MHz bandwidth scope.
    I've had it for a bit over a year now and I really do enjoy it. There's been a lot of development on the scope market in the last couple of years and there are manufacturers in the far east now churning out some pretty impressive machines (and some quite horrible ones as usual) at prices well below similar specs units from the name brands.

    /Henrik.

  5. #5
    Join Date
    Oct 2012
    Posts
    83


    Did you find this post helpful? Yes | No

    Default Re: Maximum frequency output from a PIC

    Thank you Henrik for everything.

    Regards,

    Nick

  6. #6
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: Maximum frequency output from a PIC

    Couldn't you use the external clock divided by 4 and no program at all?

    or if you need a perfect square wave, come up with a 2MHz signal and drive a Flip-Flop with it?

  7. #7
    Join Date
    Oct 2012
    Posts
    83


    Did you find this post helpful? Yes | No

    Default Re: Maximum frequency output from a PIC

    Hi Art,

    Thank you for your input.
    Please do not take my reply the wrong way and try to understand my points that follow.

    The exercise was to keep the design to a minimum component count, explore unknown features of the PIC processors (unknown to me at the time), be able to modulate a high frequency carrier with the same PIC 10F or 12F family and finally have the most flexibility over the output frequency and duty cycle output. You can not bit the accuracy of the internal clock of the newer PICs if you are trying to use any RC timing circuits and employing any kind of external crystal oscillator defeats the purpose of the exercise.

    As Henrik pointed it to me I love having the opportunity to use “the hammer” when it comes to replacing older ways of doing things. I grew up with doing things the hard way and I am convinced now that employing different caliber PICs the job is much easier.
    Just to give you a stupid example: try designing an oscillator with a flexible frequency and duty cycle in a wide range using discrete components and you will find yourself in a deep trouble especially when one of the parameters changes.

    Use the results of this thread exercise and you will find that all it takes to change one parameter is one or two lines of code. You can use the same hardware over and over for one or multiple projects and all it takes is code changes.

    I’m old. My eyes are failing me and even though I can still replace a 100 pin SMD chip with 0.5 mm pitch (that means remove the old chip and install the new one) in less than 3 minutes with 100% success (my personal record about 15 years ago was 87 seconds) I do want to keep using this skill to a minimum.

    So to answer your question:

    The external clock divided by 4 gives only 50 / 50 duty cycle and only one output frequency for any given main clock. Second part of your question goes in the territory that I’m trying to escape from and gives very little flexibility when changing any parameter because it has to be done in the hardware.

    I’m not being lazy I’m just trying to be more efficient when it comes to using my time especially when the clock is ticking for me on the down side.

    Thanks for your suggestions and keep up the good work. I’ve been following your posts in this forum and I commend you for your great contributions.

    Regards,

    Nick

Similar Threads

  1. internal TMR for frequency output
    By Samoele in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 15th January 2009, 10:38
  2. How to calculate PIC sampling frequency
    By minmin in forum General
    Replies: 1
    Last Post: - 26th September 2006, 19:02
  3. Replies: 2
    Last Post: - 20th January 2006, 22:09
  4. Maximum frequency count on 16F628/4MHz
    By solara in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 23rd May 2005, 11:38
  5. Low frequency output
    By barkerben in forum General
    Replies: 5
    Last Post: - 16th November 2004, 16:25

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