PIC 18F1330 HPWM problem - Page 4


+ Reply to Thread
Page 4 of 4 FirstFirst ... 234
Results 46 to 48 of 48

Thread: PIC 18F1330 HPWM problem52 days old

  1. #46
    Junior Member david's Avatar
    Join Date
    Jan 2019
    Posts
    46
    Thumbs Up
    Received: 3
    Given: 1
    Total Downloaded
    173.19 MB

    0 Not allowed!

    Default Re: Proton PC PWM library for devices 18F1230, 18F1330, 18F2331, 18F2431, 18F4331, 18

    Hi Archie,
    This is probably an overkill for your application but I have used the 16F1783 for precision PWM applications as it contains 2x 16 bit programmable switchmode controllers. (along with 12 bit ADC, 8 bit DAC, op-amps, comparators). Once set up the PSMCs are just the same as the familiar PWMs but use 16 bit registers for both duty cycle and period. The duty cycle can be pre-calculated then you just send PSMC2CON.6=1 'update duty cycle.
    The PWM can be clocked via its own internal PWM clock at up to 64MHz so even when using full 16 bit resolution the carrier rate is just under 1kHz so still makes for easy low pass filtering.

    Cheers,
    David

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.

  • #47
    Junior Member capitainehaddock's Avatar
    Join Date
    Oct 2019
    Posts
    26
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    87.74 MB

    0 Not allowed!

    Default Re: Proton PC PWM library for devices 18F1230, 18F1330, 18F2331, 18F2431, 18F4331, 18

    Hi David
    Thanks
    But my only target was less ambitious..
    i wanted only have a ~5 mV resolution instead of ~20 mV
    with a PWM output to an analog voltmeter 0-5 Volts.
    As it seemed too complicated for me, after ~1 month of searching around,
    I now decide to abandon idea of 10 bit PWM, and stay with my working 8 bit system.

    I received some help here, thanks to all, but, as not expert enough, i was not able to
    write a working code with what i received.

    Best regards

    Archi

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

  • #48
    Prolific Poster joesaliba's Avatar
    Join Date
    Sep 2004
    Posts
    2,468
    Thumbs Up
    Received: 71
    Given: 29
    Total Downloaded
    6.17 GB

    0 Not allowed!

    Default Re: PIC 18F1330 HPWM problem

    Quote Originally Posted by capitainehaddock View Post
    thanks for care Joseph
    but
    on your last code, i dont see how to exit value to PWM....
    i am an old beginner...
    best regards
    Archi
    This will alter your PWM: -

    Code:
    CCPR2L = Temp_PWR
    As I understand it PER_Lin is your PWM value.
    So here you have to change your value PER_Lin: -

    Code:
    '\ 
    ' \
    '  \   ALTER YOUR PER_Lin HERE !!
    '  /
    ' /
    '/
    Regards

    Joseph

  • 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. PIC with upto 8 (alt.) HPWM channels extra
      By Henk57 in forum The Lounge
      Replies: 9
      Last Post: 6th December 2015, 11:28
    2. 18F2420 -> 18F1330 UART problem
      By xldaedalus in forum Proton Plus Compiler v3
      Replies: 0
      Last Post: 28th May 2009, 23:23
    3. [SOLVED !] problem with hpwm
      By Dphil7532 in forum Proton Plus Compiler v3
      Replies: 10
      Last Post: 1st March 2007, 22:51
    4. HPWM problem
      By joesaliba in forum Proton Plus Compiler v3
      Replies: 7
      Last Post: 26th November 2006, 05:07
    5. Smalist PIC with HPWM
      By PAKirk in forum The Lounge
      Replies: 6
      Last Post: 15th August 2005, 16:31

    Members who have read this thread : 44

    Actions :  (Set 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