A/D's in 16F628A


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2005
    Posts
    23

    Smile A/D's in 16F628A

    Hi, I plan to use a 16F628A and have both A/D's on to load B0 and B1 respectively. I only need 8 bit conversions for 0-255 values. Can anyone help me with sample code to set these up? Also, how do I change the reference voltage swings to allow for, say, 0 to 3.5 V to produce 0 to 255 values internally?
    I also want to try to multiplex the PWM output to 4 inputs to a couple of H bridges to control two motors in both directions. (will use a 74LS08 quad AND gate using other outputs from PIC to bring one side of each gate high to enable that channel. The PWM out will drive all four AND gates.)
    I'm pretty sure how to use the PWM module, but need to know if I can change the duty cycle fast enough to operate all four AND gates properly and independantly.
    Any and all suggestions and sample code will be welcomed!
    Thanks a bunch!
    Ron

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    uneless you want to waste your time, use another PIC as there's no ADCs in 16F628 but only analog comparator.

    And there's only 1 CCP module... 1 PWM output

    There's few PIC dedicated to Motor Control. Those have built-in ECCP. AND they provide some nice dead-time feature

    The smaller i know... 16F690 AND it have ADCs too. Big deal
    Last edited by mister_e; - 19th November 2006 at 23:23.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    Dec 2005
    Posts
    23


    Did you find this post helpful? Yes | No

    Red face Thanks Steve

    Guess I was suffering from brain shutdown or something. I just read this morning that the 628 has comparitor modules AND NOT A/D - Dahhhh!!!
    I'll look at the 690 Thanks again.
    Ron

Similar Threads

  1. Crystal oscillator problems on a 16f628a
    By achilles03 in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 16th February 2009, 16:33
  2. boot loader for 16f628a ?
    By tdavis80 in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 5th January 2008, 02:07
  3. Are 16f628 and 16f628A difference each other?
    By elektrodam in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 15th July 2006, 06:20
  4. new user with problem using PGP Pro, Lab-X3 with 16F628A
    By equipoise in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 28th July 2004, 07:42
  5. HSEROUT and 16F628A
    By fredblah in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 6th May 2004, 00: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