[SOLVED !] 5 (yes FIVE !) simultaneous PWM outputs - code included - 16F1939 - Page 2


Closed Thread
Page 2 of 2 FirstFirst 12
Results 16 to 23 of 23
  1. #16
    J. Mark Wolf
    Guest J. Mark Wolf's Avatar

    0 Not allowed!

    Default Re: 5 (yes FIVE !) simultaneous PWM outputs - code included - 16F1939

    Quote Originally Posted by xldaedalus View Post
    Also, Wolfman, don't think its a good idea to mix multiple frequencies of PWM if you are driving MOSFETs on the same PCB, especially if driving high loads. Its OK if they all come ON at the same time and OFF and different times, but if you have one come on after another one is already on, you can get some funny ground path problems. In fact, there is usually "Deadband" control in multiple PWM chips to insure all outputs are OFF before any TURN ON at the start of the next period.

    At least this is my understanding. Perhaps someone knows better....

    Probably....

    Lee
    Not driving FET's, just making sounds.

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.

  • #17
    Prolific Poster bill9399's Avatar
    Join Date
    Aug 2004
    Posts
    1,701
    Thumbs Up
    Received: 2
    Given: 0
    Total Downloaded
    1.06 GB

    0 Not allowed!

    Default Re: 5 (yes FIVE !) simultaneous PWM outputs - code included - 16F1939

    Quote Originally Posted by J. Mark Wolf View Post
    Not driving FET's, just making sounds.
    Have you looked at the 'simple SID chip emulator' posted as Sticky, by Les, in this section of the forum? Way to go if you want sounds.
    Last edited by bill9399; 22nd November 2011 at 20:26.
    A wise man may listen and say nothing. A fool may listen and have nothing to say. Which one are you???

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

  • #18
    Kapitan
    Guest Kapitan's Avatar

    0 Not allowed!

    Default Re: 5 (yes FIVE !) simultaneous PWM outputs - code included - 16F1939

    Quote Originally Posted by xldaedalus View Post

    Looking forward to trying 16F1939. I have one question, if you have time. Why would Microchip make such a valueable chip as a 16F or 14bit part instead of an 18F or 16bit part? Is there any disadvantage to using the 16f part or the 18F46k22.

    Also, check out the 10F320. 16mHz internal oscillator and a PWM module in 6 pins. I was thinking of using multiples of them to drive PWM controlled via SPI voltage divider using the ADC. But its a lot of extra work for ??? Also don't know if the new compiler ver. will handle it.

    Will soon find out. I hope...

    Thanks again for your help.

    Lee
    No worries Lee, glad to help where I can -
    We use the 16F1939 primaraly due to the custom lcd driver module built in - I cannot see an 18F part that has this - also the price in volume.
    The features are absolutey fantastic, but is does take a while to get your head around the datasheet (or it does for me lol) -
    there are other things we havent even explored yet such as a dac output - multiple vref internally - sr latch (555 timer emulator ! seriously)- cap touch -
    Up to 32 Mhz int osc ! - internal temp sensor etc etc -
    we use 5 pwms, custom lcd module, internal contrast control, 9 adcs,

    as for why Mchip do this - only they could answer that -
    yes - it is a tad slower than an 18F, users more code space than an 18F, but that is of no real issue in the use I am putting it to. - it has plently of ocde space, and plenty of speed if needed. All in all a really superb unit. I am a convert to it and the tqfp 44 pin unit is only about the size of your thumb nail..

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

  • #19
    Kapitan
    Guest Kapitan's Avatar

    0 Not allowed!

    Default Re: 5 (yes FIVE !) simultaneous PWM outputs - code included - 16F1939

    Quote Originally Posted by J. Mark Wolf View Post
    Not driving FET's, just making sounds.
    Hi Wolfman - just checked against the datasheet, yes, I believe you could use up to 3 pwm's with individual frequency (you can only use timers 2/4/6) but they are selectable as to which pwm uses what.

    what sort of sounds are you looking for - as there may be toher ways - even the sid as Bill9399 suggested + or just timers etc ?

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

  • #20
    J. Mark Wolf
    Guest J. Mark Wolf's Avatar

    0 Not allowed!

    Default Re: 5 (yes FIVE !) simultaneous PWM outputs - code included - 16F1939

    Quote Originally Posted by captainslarty View Post
    Hi Wolfman - just checked against the datasheet, yes, I believe you could use up to 3 pwm's with individual frequency (you can only use timers 2/4/6) but they are selectable as to which pwm uses what.

    what sort of sounds are you looking for - as there may be toher ways - even the sid as Bill9399 suggested + or just timers etc ?
    Oh, I agree, it should be possible. I was just unsuccessful. I couldn't get the config right if I remember correctly, until I tried the "other" popular compiler, which is where I left it.

    I keep hoping someone on this forum will come up with the config solution, so I can port the program back to "this" compiler. Maybe I'll revisit it as my one of my winter projects.

    My application was mixing two different tones from the HPWM's, then modulating this "mix" with a half sine wave generated from the DAC. Works good on the 16F1827, albeit on the "other" popular compiler.

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

  • #21
    Kapitan
    Guest Kapitan's Avatar

    0 Not allowed!

    Default Re: 5 (yes FIVE !) simultaneous PWM outputs - code included - 16F1939

    JM,
    the details are in the code I uploaded
    Look at the settings for ccptmrs0 and 1, also the tXCON reg setting and the PR

    also CCPTMRS0 and CCPTMRS1 registers in the data sheet, and in the code, also you will need to set up the PRX register and TXCON reg's where X = 2 4 or 6

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

  • #22
    Prolific Poster charliecoultas's Avatar
    Join Date
    Sep 2010
    Posts
    1,377
    Thumbs Up
    Received: 48
    Given: 39
    Total Downloaded
    3.45 GB

    0 Not allowed!

    Default Re: 5 (yes FIVE !) simultaneous PWM outputs - code included - 16F1939

    Joe,

    Is your design using constant current? If so, how are you doing it with PWM?

    Best regards
    Charlie

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

  • #23
    Kapitan
    Guest Kapitan's Avatar

    0 Not allowed!

    Default Re: 5 (yes FIVE !) simultaneous PWM outputs - code included - 16F1939

    Quote Originally Posted by charliecoultas View Post
    Joe,

    Is your design using constant current? If so, how are you doing it with PWM?

    Best regards
    Charlie
    Hi Charlie, constant V not Current - ! we are using it dim lcd colours via fets, (3) - also main led rail via Pfet - the 5th was used as an lcd contrast control but no longer needed - now spare...

  • 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. PIC24F(V)16KM series with multiple PWM outputs
      By nhadzid in forum Proton 24
      Replies: 0
      Last Post: 23rd June 2018, 10:51
    2. [SOLVED !] 16F1939 support
      By David795 in forum Pre-Sales and Upgrade Questions
      Replies: 6
      Last Post: 27th June 2012, 19:45
    3. [SOLVED !] Code how to REQ switching outputs non sequentially please!
      By canipus in forum Proton Plus Compiler v3
      Replies: 16
      Last Post: 9th July 2010, 02:51
    4. 4 PWM outputs
      By chuckieboy in forum Proton Plus Compiler v3
      Replies: 51
      Last Post: 15th March 2009, 00:34
    5. [SOLVED !] Replacement code for PWM
      By Termike in forum Proton Plus Compiler v3
      Replies: 23
      Last Post: 1st June 2007, 18:05

    Tags for this Thread

    Posting Permissions

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