PWM Timer Source


+ Reply to Thread
Results 1 to 5 of 5

Thread: PWM Timer Source54 days old

  1. #1
    Junior Member HelpMe!'s Avatar
    Join Date
    Sep 2019
    Posts
    5
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    76.53 MB

    0 Not allowed!

    Default PWM Timer Source

    Concerning the PIC16(L)F15313/23 - I just wanted to confirm that this excerpt from the datasheet is a flagrant lie:

    29.1.1 PWM CLOCK SELECTION The PIC16(L)F15313/23 allows each individual CCP and PWM module to select the timer source that controls the module. Each module has an independent selection.

    That text is posted in the "CCP Module" section on page 303, as well as the standalone "PWM Module" section on page 313. I made the mistake of purchasing this PIC, thinking it was capable of at least TWO of the supposed 6 PWM outputs, but now it seems as though it's only capable of ONE pwm output. I don't see any way to use any timer source other than the exact same pre/post-scaled Timer2 base for all 6 PWM outputs. Or am I missing something?


    Link to datasheet (pdf): http://ww1.microchip.com/downloads/e.../40001897A.pdf

Attention

This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

The advertisements we display are relevant to this web site and your browsing history

Please consider supporting us by disabling your ad blocker.


Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

If you can, please report issues in the forum area WebSite / Forum Issues


Thank you for your attention.

  • #2
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,399
    Thumbs Up
    Received: 290
    Given: 141
    Total Downloaded
    1.68 GB

    0 Not allowed!

    Default Re: PWM Timer Source

    I've just downloaded the PIC16F15313 datasheet, and it does state that it can use different timers for PWM or CCP, however it cannot! So the datasheet is wrong, which does not surprise me with Microchip anymore because they are simply buyers of other peoples creations and they are now very, very amateurish, and seem to have technicians that are not wuite up to scratch as they used to be. But this seems to be the way of the world now. :-( Money, money money, but NOT quality with it. :-(

    The device only has 3 timers: 0, 1, and 2, and PWM and CCP both use Timer2. What they have done is add extra nonesense to Timer2 so it has pre and post scalers etc and other triggers, so it is a lot more comlex for little reason, but the timer for PWM and CCP cannot be changed. Unfortunately, I cannot see a workaround for this, so you are fixed to a single frequency for all PWMs and CCPs. The CCP Capture and Compare can use Timer1, so maybe this is what the idiot writing the datasheet copied and pasted from another device's datasheet, and didn't quite understand what they were copying.

    To test further, I ran up code configurator for both the PIC16F15313 and PIC16F15323 devices, and sure enough, the option is only Timer2 for PWM and CCP acting as PWM. Other devices I have written for can use Timer2 or Timer4 or more if it has them for PWM or CCP, but not Timers below Timer2.
    Last edited by top204; 25th September 2019 at 16:29.

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #3
    Junior Member HelpMe!'s Avatar
    Join Date
    Sep 2019
    Posts
    5
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    76.53 MB

    0 Not allowed!

    Default Re: PWM Timer Source

    Welp... you've shared my thoughts exactly! I was hoping you'd say otherwise. I've learned to get a bit of a "feel" for when those bumbling idiots at Microchip copy/paste lumps of code from other datasheets without properly editing them, and my "Spidey senses" were definitely tingling. Still, I was hoping against hope that I had simply misread it.

    You've also shared my exact thoughts as far as the timers; why they felt the need to make both Timer1 and Timer2 so convoluted is beyond me. Overall, I think Microchip is moving in the right direction, as far as the new PPS functionality. The goal should always be to buy exactly as many pins as you need, as opposed to being forced to buy 28 pins when you only need 12, because nothing else has the hardware peripherals you need. This new chip solved that problem, and seemed to be exactly what I always wanted. I should've known; if they let you allocate the hardware peripherals to any pin, of COURSE they wouldn't let you allocate the timer resources as well. It's all part of their proud tradition of giving us everything we've asked for, minus one thing. If it has all the hardware peripherals, it doesn't have enough timers... If the ADC does automatic acquisition, it doesn't do automatic conversion... If the ADC does automatic conversion, it doesn't do simultaneous sampling... It never ends.

    Unrelated, but I was just bit in the ass a few weeks ago on ANOTHER project, using an 18F23k22, because the datasheet says you can use the internal FVR as the ADC Vref+. "Great!" I thought, "I can set it to 1.024V!" If you scroll to the END of the datasheet, however, on page 451, you'll see that Vref+ MUST be greater than 2.5V, which means the only viable FVR value is 4.096V. And lets face it, a Vref of 4.1V isn't much better than 5V when you're trying to measure a 250mV Rsense input.

    I used to think the Microchip employees were just idiots, but now I believe they're actually sadists.
    Last edited by HelpMe!; 26th September 2019 at 09:48.

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #4
    Junior Member HelpMe!'s Avatar
    Join Date
    Sep 2019
    Posts
    5
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    76.53 MB

    0 Not allowed!

    Default Re: PWM Timer Source

    Hmm...

    Click image for larger version

Name:	microchip_fry.jpg
Views:	20
Size:	48.5 KB
ID:	3771

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #5
    Senior Member Stephen Moss's Avatar
    Join Date
    Jan 2006
    Posts
    504
    Thumbs Up
    Received: 30
    Given: 7
    Total Downloaded
    3.72 GB

    0 Not allowed!

    Default Re: PWM Timer Source

    I have not looked at the data sheet but it sounds like they have been using some AVR nonsence. When I had to use an Arduino to generate PWM for a 3 phase motor I spent days trying to understand the PWN section of horrendous device datasheet.
    It did not help that there were three methods of setting it up, IIRC count up to a value, down to a value or up to a value and down again two of which were not suitable for motor drives. The three PWM outputs were all driven from the same timer and the values you wrote to the corresponding registers set the modulation depth for each output so they could be different.

    It would make sense both for that device and this that all three are the same frequency as they are running off the same same timer, for motor drive you want them the same frequency, for other things does it really matter that they are the same frequency? Isn't the modulation depth the key factor?
    IIRC there was a way to change the PWM frequency on the AVR device by writing a value to a register, I cannot be certain if that was a global change or if they could all be changed individually as it had something to do with altering the top value of something.

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

    Thread Information

    Users Browsing this Thread

    There are currently 1 users browsing this thread. (0 members and 1 guests)

       

    Similar Threads

    1. Replies: 3
      Last Post: 29th April 2016, 09:19
    2. PWM to Analog Out using CCP PWM Mode
      By fgcity in forum Proton Plus Compiler v3
      Replies: 1
      Last Post: 2nd September 2015, 13:32
    3. Replies: 8
      Last Post: 2nd August 2013, 12:57
    4. UK source of RF pair
      By Richard in forum The Lounge
      Replies: 6
      Last Post: 30th July 2008, 22:36
    5. How to turn 8-bit timer into 16-bit timer?
      By HelpMe! in forum Proton Plus Compiler v3
      Replies: 6
      Last Post: 29th October 2007, 21:08

    Members who have read this thread since 29th October 2019, 09:50 : 0

    Actions :  (Set Date)  (Clear Date)

    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