1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

16F88 PWM and A/D conversion

Discussion in 'Microcontrollers' started by williB, Jun 5, 2005.

  1. williB

    williB New Member

    Joined:
    Aug 30, 2004
    Messages:
    2,217
    Likes:
    3
    Location:
    New Jersey
    i am going to be using the 16F684 for Analog/Digital conversion and PWM..
    Since i've never done PWM with a pic ,
    i am going to need some help ..
    one quick question , how many intervals can the PWM signal be broken into??
    ie on time vs off time per cycle??
     
  2. Jay.slovak

    Jay.slovak Active Member

    Joined:
    Jan 11, 2005
    Messages:
    1,726
    Likes:
    5
    Re: 16F684 PWM and A/D convertion

    Well, PIC's PWM module has 10 bit resolution, giving you 1024 different on/off states.
     
  3. williB

    williB New Member

    Joined:
    Aug 30, 2004
    Messages:
    2,217
    Likes:
    3
    Location:
    New Jersey
    cool thanks !
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. Someone Electro

    Someone Electro New Member

    Joined:
    Sep 10, 2003
    Messages:
    2,579
    Likes:
    2
    Location:
    A boring village in Europe (slovene)

    You mean duty cicles insted of states (you have only 2 states, on and off)
     
  6. Someone Electro

    Someone Electro New Member

    Joined:
    Sep 10, 2003
    Messages:
    2,579
    Likes:
    2
    Location:
    A boring village in Europe (slovene)
    hey we posted at the exsactly same time williB (check the time above the posts)
     
  7. Jay.slovak

    Jay.slovak Active Member

    Joined:
    Jan 11, 2005
    Messages:
    1,726
    Likes:
    5
    I ment On/Off ratio...
     
  8. motion

    motion New Member

    Joined:
    Jul 14, 2003
    Messages:
    560
    Likes:
    0
    Location:
    Quezon City.PH
    It depends on the period of Timer2. This in turn depends on the value of the PR2 register. The number of intervals is 4*(PR2+1).
     
  9. williB

    williB New Member

    Joined:
    Aug 30, 2004
    Messages:
    2,217
    Likes:
    3
    Location:
    New Jersey
    holy S ! , thoughts of chinese arithmetic come to mind..
    Tosc is probably going to be 20 Mhz , and my PWM frequency is 100HZ..
    EDIT ;:: i ment Fosc..
     
  10. Someone Electro

    Someone Electro New Member

    Joined:
    Sep 10, 2003
    Messages:
    2,579
    Likes:
    2
    Location:
    A boring village in Europe (slovene)
    Umm...
    You want this for an shaker light right?
    Then i wodnt recomend runing a PIC at 20Mhz.Run it at the lowest freq. posible.So it wodnt wase much those precus mA from that super cap.

    You dont need a fast clock to do this (it cod meaby run on the internal 32KHz oscilator)

    I tryed difrent freq. on a PIC and how fast dose it drain a cap.an PIC16F88 run at 16Mhz dicharged the 4400uF bank in seconds wile run at 32Khz it run for minutes .It was the PIC version of the zeatcteribles insane driving beeper so it also had to drive an small piezo speker.
     
  11. williB

    williB New Member

    Joined:
    Aug 30, 2004
    Messages:
    2,217
    Likes:
    3
    Location:
    New Jersey
    yes for the shaker..:)
    allright make it 32Khz , sounds good to me..
    so Fosc is 32Khz and Pwm freq is say 60 hz..
     
  12. williB

    williB New Member

    Joined:
    Aug 30, 2004
    Messages:
    2,217
    Likes:
    3
    Location:
    New Jersey
    i think that i'll use the F88 instead..
     
  13. Someone Electro

    Someone Electro New Member

    Joined:
    Sep 10, 2003
    Messages:
    2,579
    Likes:
    2
    Location:
    A boring village in Europe (slovene)
    Its an small and cheap MCU but it will work (it has 1 ADC,1 PWM...)
     
  14. williB

    williB New Member

    Joined:
    Aug 30, 2004
    Messages:
    2,217
    Likes:
    3
    Location:
    New Jersey
    And low voltage programming ..
    and an Ansel register which looks like selecting I/O pins is easier..
     
  15. DTMF

    DTMF New Member

    Joined:
    Jun 6, 2005
    Messages:
    48
    Likes:
    0
    Location:
    Australia
    Re: 16F88 PWM and A/D convertion

    wait a moment:

    but 16F84 doesnt have an ADC :!: :!: :!:

    how do you want to use it for analog digital conversion
     
  16. Someone Electro

    Someone Electro New Member

    Joined:
    Sep 10, 2003
    Messages:
    2,579
    Likes:
    2
    Location:
    A boring village in Europe (slovene)
    It also has an internal oscilator.

    Yay just got those nice motor controlers from microchip. (along whith some other stuf)
     
  17. Someone Electro

    Someone Electro New Member

    Joined:
    Sep 10, 2003
    Messages:
    2,579
    Likes:
    2
    Location:
    A boring village in Europe (slovene)
    an nother at the exsact time post! :D


    he seead F88 not F84.

    They have ADC beocse i used it on that one
     
  18. williB

    williB New Member

    Joined:
    Aug 30, 2004
    Messages:
    2,217
    Likes:
    3
    Location:
    New Jersey
    motor controllers ?
    what else?
     
  19. DTMF

    DTMF New Member

    Joined:
    Jun 6, 2005
    Messages:
    48
    Likes:
    0
    Location:
    Australia
    sorry i thought 16F84

    but he wrote 16F684

    soooorrrrrrrrrryyyy
     
  20. williB

    williB New Member

    Joined:
    Aug 30, 2004
    Messages:
    2,217
    Likes:
    3
    Location:
    New Jersey
    electro , how did your F88 come configured come from the factory??
     

    Attached Files:

  21. Someone Electro

    Someone Electro New Member

    Joined:
    Sep 10, 2003
    Messages:
    2,579
    Likes:
    2
    Location:
    A boring village in Europe (slovene)
    I didnt check that.


    And i proboly overwiten these settings a cuple of times.I dont have a new one.

    The new ones i have are the 16F876 (28 pin) and the 12F675 .Wich i got from microchip yesterday. I didnt even get them out the the box (now micorcip sends it to you in litle plastic boxes that have antistatic foam on the inside)
     

Share This Page