10-Bit PWM using PIC16F1509


Results 1 to 20 of 20

Threaded View

  1. #2
    Join Date
    May 2013
    Location
    australia
    Posts
    2,681


    Did you find this post helpful? Yes | No

    Default Re: 10-Bit PWM using PIC16F1509

    your code complies ok for me
    chk pic16f15009 microcontroller selected and mpasm assembler selected


    for 10 bit pwm you need to
    pot1<<6 before you load the regs

    Code:
    pot1=pot1<<6
     PWM1DCH = POT1.HIGHBYTE
     PWM1DCL = POT1.LOWBYTE
    ps
    I'm assuming pot1 is 0-1023 value of course


    you could be clever here an not right justify adc reading and save a step
    Last edited by richard; - 27th February 2015 at 04:51. Reason: ps and my 'd' key is dodgy

Similar Threads

  1. DMX512 Reception + 3 * 8-Bit PWM Outputs
    By JEC in forum Code Examples
    Replies: 5
    Last Post: - 16th February 2015, 16:21
  2. 16 bit PWM using CCP1
    By Normnet in forum mel PIC BASIC Pro
    Replies: 60
    Last Post: - 27th August 2014, 09:13
  3. Replies: 17
    Last Post: - 22nd May 2014, 20:58
  4. Replies: 1
    Last Post: - 13th March 2012, 00:34
  5. 10 bit pwm as dac
    By yasser hassani in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 30th June 2004, 16:12

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