16 bit PWM using CCP1


Closed Thread
Results 1 to 40 of 61

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Yup, that's what mister-e's calculator says with 40mhz, 1:1, and 16-bit. 152 hz.

    The PIC18F2331/2431/4331/4431 series has a bunch of 14-bit PWM modules. But they are completely different from the CCP module.

    Bruce has done a few examples, but I don't think any of them were for music.

    best regards,
    DT

  2. #2
    Join Date
    Oct 2004
    Posts
    440


    Did you find this post helpful? Yes | No

    Default

    PIC18F2331/2431/4331/4431:

    FOSC 40 MHz
    MIPS 10
    PWM Resolution 14 bits
    PWM Frequency 2.4 kHz

    14 bit to slow for CD quality music.
    10 bit sounds good though.

    A dsPIC would be ideal.

    On my first post my code included saving the state of the critical registers.
    Would this be required in a longer program?

    Norm
    Last edited by Normnet; - 14th December 2009 at 05:57.

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Maybe you'd be better off with an R2R network as a Digital to Analog Converter.

    Something like what Steven Wright did here (Not PBP).
    SDMMCWavPlayer
    http://www.sfcompiler.co.uk/wiki/pmw...SDMMCWavPlayer


    And no, you won't need to save STATUS, WREG and BSR, unless you start using Low Priority interrupts.
    The Shadow registers automatically save and restore them in hardware for High priority ints on 18F's.
    <br>
    DT

  4. #4
    Join Date
    Oct 2004
    Posts
    440


    Did you find this post helpful? Yes | No

    Default

    R2 ladder done here PIC iPod wav player

    Now would like to port to PBP a basic PWM low pin count low part count wave player.
    The code is 8,069 program bytes possibly less if optimized.
    Are their < 28 pin 18F PICs supported by compiler 2.50C?

    Norm

Similar Threads

  1. Bits, Bytes Words and Arrays
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 24
    Last Post: - 14th June 2016, 07:55
  2. Half-bridge PWM with a 16F684 ?
    By Byte_Butcher in forum General
    Replies: 7
    Last Post: - 17th January 2010, 22:18
  3. PICBasic newbie problem
    By ELCouz in forum mel PIC BASIC Pro
    Replies: 32
    Last Post: - 12th February 2008, 00:55
  4. How to tell which PICs can handle 16 bit variables?
    By MikeTamu in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 31st August 2005, 08:44
  5. USART interrupt not interrupting right
    By Morpheus in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 6th March 2005, 01:07

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