manual hardware PWM setup on 16F1824


Results 1 to 24 of 24

Threaded View

  1. #4
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Here is the location for Steve's Multi-Calc. It is quite helpful.

    http://www.picbasic.co.uk/forum/cont....-PICMultiCalc

    If you wanted 8 bit PWM using the hardware, you could shift your 8 bits to change it to 10, matching the hardware.

    something like this:
    Code:
    DUTY1 var word
     
    DUTY1 = 255                    'put in some 8 bit value
    DUTY1 = DUTY1 <<2          'shift your 8 bits to 10 bits
    CCP1CON.5=DUTY1.1       ' load CCP1 duty value            
     CCP1CON.4=DUTY1.0       '      with Duty1 
    CCPR1L=DUTY1>>2
    Last edited by ScaleRobotics; - 29th January 2011 at 01:53.

Members who have read this thread : 0

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