Timer 3 config for HPWM using remappable pins


Closed Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2009
    Location
    South Wales (UK)
    Posts
    62

    Default Timer 3 config for HPWM using remappable pins

    Hi all,

    Hope everyone has their Xmas wishlist prepared for Santa :P

    Quick question... trying to use Timer3 on an 18F26J53 together with HPWM command to make an LED go dim/bright/dim/bright etc...

    Code snippet:
    Code:
    EECON2 = $55
    EECON2 = $AA
    PPSCON.0 = 0
    RPOR4 = 19
    EECON2 = $55
    EECON2 = $AA
    PPSCON.0 = 1
    CCP2CON = %00001100
    PSTR2CON = %00000010
    CCPTMRS0 = %00001000
    t3con = %01001101
    loop1:
    SEROUT2 Serial_out,84,[$a,$d,dec RPOR4," ",bin8 CCPTMRS0]
    hpwm 2,127,1000
    pause 500
    hpwm 2,255,1000
    pause 500
    goto loop1
    Is there anything obviously wrong? I'm setting the remappable pin B1 for ECCP2, channel 2, etc, just can't get the LED to light using PWM.

    Many thanks in advance

    Jimbo

  2. #2
    Join Date
    Sep 2009
    Location
    South Wales (UK)
    Posts
    62


    Did you find this post helpful? Yes | No

    Default Re: Timer 3 config for HPWM using remappable pins

    ... perhaps I'm misunderstanding the use of the HPWM command?
    Is 'channel 2' on HPWM the same as using ECCP2?

    - Jimbo -

Similar Threads

  1. Timer based PWM with HPWM
    By jmgelba in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 23rd November 2011, 05:16
  2. 18F25J11 RTCC & remappable pin options
    By jonas2 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 27th February 2011, 10:20
  3. 18F25J11 RTCC & remappable pin options
    By Bruce in forum Code Examples
    Replies: 13
    Last Post: - 26th February 2011, 10:51
  4. HPWM and timer 1 on pic16f77
    By n qwerty in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 17th April 2008, 13:30
  5. Setting up 5 HPWM pins on 18F4680
    By tcbcats in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 2nd August 2006, 06:54

Members who have read this thread : 1

You do not have permission to view the list of names.

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