[SOLVED !] HPWM on channel 3 of PIC16F737


Closed Thread
Results 1 to 8 of 8

Thread: HPWM on channel 3 of PIC16F7373176 days old

  1. #1
    Daniel
    Guest Daniel's Avatar

    0 Not allowed!

    Default HPWM on channel 3 of PIC16F737

    Hello,

    I know that there is no HPWM command for channel 3, so I have set the 3 channels up as follows:-

    TRISC.2 = 0
    TRISC.1 = 0
    TRISB.5 = 0
    CCP1CON = %00001100
    CCP2CON = %00001100
    CCP3CON = %00001100

    I then use the command as follows to send the value to them:-

    HPWM 1, channel_3, 5000
    HPWM 2, channel_1, 5000
    CCPR3L = channel_2

    Channels 1 and 2 work as expected when the level from 0 to 255 is sent to them, but with channel 3 the PWM output only works from 0 to 128 (0 = off , 128 = all on) and no change beyond 128.

    If I change all the command lines to:-

    CCPR1L = channel_3
    CCPR2L = channel_1
    CCPR3L = channel_2

    They all act like channel 3.

    Can anyone shed some light on this?

    Thank you.

    Daniel.

  2. 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. #2
    wastrix
    Guest wastrix's Avatar

    0 Not allowed!

    Default Re: HPWM on channel 3 of PIC16F737

    What have you set for the speed of TMR2? (e.g. PR2)

    If TMR2 is only counting to 128, then your duty cycle (CCPRxL) can only go up to 128. See the period/duty cycle diagram in the relevant datasheet. PR2 should be = 255 and the speed of the PWM can then be controlled by the TMR2 prescaler only in order to get 0-255 resolution for duty cycle.

  4. 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. #3
    Daniel
    Guest Daniel's Avatar

    0 Not allowed!

    Default Re: HPWM on channel 3 of PIC16F737

    The duty cycle is going from 0 to 255 on the pin output, but it is doing that with a value of 0 to 128 being sent to it. Any value after 128 does nothing.

    Thanks. I will check the timer settings, and let you know how I get on.

    Daniel.

  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.

  7. #4
    Prolific Poster pic-ignorant's Avatar
    Join Date
    Oct 2007
    Posts
    2,942
    Thumbs Up
    Received: 26
    Given: 31
    Total Downloaded
    926.61 MB

    0 Not allowed!

    Default Re: HPWM on channel 3 of PIC16F737

    Hi Daniel,

    This is how I set CCP3, 4 or 5

    'SET CCP3 TRIS TO OUTPUT
    Dim DUTY As Byte
    T2CON = %00000100
    PR2 = 100 '
    CCP3CON = %00001100
    CCPR3L = DUTY


    Regards
    John

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

  9. #5
    Prolific Poster pic-ignorant's Avatar
    Join Date
    Oct 2007
    Posts
    2,942
    Thumbs Up
    Received: 26
    Given: 31
    Total Downloaded
    926.61 MB

    0 Not allowed!

    Default Re: HPWM on channel 3 of PIC16F737

    I posted for a 18F46K22, sorry I couldnt edit

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

  11. #6
    Daniel
    Guest Daniel's Avatar

    0 Not allowed!

    Default Re: HPWM on channel 3 of PIC16F737

    This works fine:-

    'set up pwm

    PR2 = 255

    CCPR1L = 0
    CCPR2L = 0
    CCPR3L = 0

    CCP1CON = %00001100
    CCP2CON = %00001100
    CCP3CON = %00001100

    T2CON = %00000101



    'send channel levels

    CCPR1L = channel_1
    CCPR2L = channel_2
    CCPR3L = channel_3



    Daniel.

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

  13. #7
    Prolific Poster pic-ignorant's Avatar
    Join Date
    Oct 2007
    Posts
    2,942
    Thumbs Up
    Received: 26
    Given: 31
    Total Downloaded
    926.61 MB

    0 Not allowed!

    Default Re: HPWM on channel 3 of PIC16F737

    What was the problem Daniel? PR2 < 255?

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

  15. #8
    Daniel
    Guest Daniel's Avatar

    0 Not allowed!

    Default Re: HPWM on channel 3 of PIC16F737

    Thank you very much for your help.

    Daniel.

  16. 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. Which P channel mosfet?
    By basparky in forum The Lounge
    Replies: 8
    Last Post: 10th April 2012, 21:56
  2. [SOLVED !] 6 Channel dimmer with PIC16f72
    By Roshan in forum Proton Plus Compiler v3
    Replies: 14
    Last Post: 7th April 2011, 07:15
  3. [SOLVED !] Pic16f737 bootloader
    By Daniel in forum The Lounge
    Replies: 16
    Last Post: 8th July 2010, 02:41
  4. HPWM channel 1 on 18f4525?
    By dsmith in forum Proton Plus Compiler v3
    Replies: 5
    Last Post: 23rd January 2007, 06:25
  5. [SOLVED !] HPWM ON channel 3
    By AnthonyHarris in forum Proton Plus Compiler v3
    Replies: 0
    Last Post: 10th August 2006, 16:30

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