10 bit pwm as dac


Closed Thread
Results 1 to 3 of 3
  1. #1

    Question 10 bit pwm as dac

    Hi anyone

    I am working on a project.
    In this project I must use a DAC. I am going to use hardware PWM as DAC.
    I know that PIC16F877 has 10 bit PWM module.
    My compiler is PBP.
    My program reads an analog signal and converts it to digital.
    Then does some calculations.
    I want to convert the above result to analog with pwm.
    Please help me for implementing it.
    Can I use HPWM command in pbp?
    I think that this command isn’t useful for me because it needs the frequency.
    I am waiting for your helpful guidance.
    Thank you very much.

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    I have some questions here too... making you work for the answers will help you better to understand and resolve the problem...

    >Can I use HPWM command in pbp?

    Can you tell me if HPWM is a PBP command? Your answer to that will answer your own question. Clue: Look in the PBP Manual.

    >I think that this command isn’t useful for me because it needs the frequency.

    So how do you think PWM works without a frequency?

  3. #3
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    Hello, Yasser

    Yasser >>In this project I must use a DAC. I am going to use hardware PWM as DAC. I know that PIC16F877 has 10 bit PWM module. My compiler is PBP.<<

    Ok, that could work.

    Yasser >>My program reads an analog signal and converts it to digital. Then does some calculations.
    I want to convert the above result to analog with pwm.<<

    A AD would work on this. Thus choose a chip with a A/D and PWM.

    Yasser >>I am waiting for your helpful guidance.<<

    Ok. Why don't you send us some Psuedo code of what you want implemented. and we can go from there...

    Something like

    ADnumber var byte
    ADin porta, ADnumber

    calculations...

    CCPIN1=New value between 0 and 256.


    etc.

    Dwayne
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

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. Variable PWM PIC18F2431
    By trr1985 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 12th June 2009, 06:03
  3. PICBasic newbie problem
    By ELCouz in forum mel PIC BASIC Pro
    Replies: 32
    Last Post: - 12th February 2008, 00:55
  4. Need help with 16f819 10 bit ADC
    By bannrikae in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 26th September 2005, 15:20
  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 : 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