using the pwm's in pic18f2431-2331-4331-4431


Closed Thread
Results 1 to 28 of 28

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Hi Johan,

    Which port/ports are you using for the LCD?
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  2. #2
    Join Date
    Jun 2007
    Posts
    56


    Did you find this post helpful? Yes | No

    Default

    I am using RD2,RD3,RD4,RD5,RD6,RD7 ( cannot change these , as these are hardwired on my easypic4 )

    The problem starts even before PWM channels are active

  3. #3
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    You'll need to disable PWM for PORTD pins you're using to control your LCD. See if changing
    PWMCON0 = %01010100 to PWMCON0 = %01000100 helps. %01010100 turns them ALL on
    for the 18F4431.

    Also check your config settings. CONFIG3H has an option where you can force PWM4 output
    to be on RB5 or RD5. You'll obviously want this on RB5 since you're using RD5 for your LCD.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  4. #4
    Join Date
    Jun 2007
    Posts
    56


    Did you find this post helpful? Yes | No

    Default

    Hi Bruce,

    I have tested it, the problem is the PWM7. How to disable it?

    I want PWM 1,3,5 only , but the PWMCON0 does not have option , the best option is %01111111 ( all odd pins enabled , independent )

    Is there any other way to disable PWM 7?

    Johan
    Last edited by Johan; - 26th October 2007 at 19:22.

  5. #5
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    I don't have an 18F4431 to test, but I don't see any options for only 1,3,5 as PWM outputs.
    It appears from looking at PWMCON0 that a value of %01000100 would disable PWM outputs
    6 & 7, but I can't comfirm since I don't have one to test.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  6. #6
    Join Date
    Jun 2007
    Posts
    56


    Did you find this post helpful? Yes | No

    Default

    Yes, this is the problem, if I switchoff PWM6,7 with %01000100 , I will loose the I/O ports that occupied by PWM0,2,4

    I think I have to change the LCD wiring ,
    or alternatively, can I combine 2 CCP PWM ( HPWM ) + 1 PCPWM ?

    Thanks,

    Johan

Members who have read this thread : 1

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