question of the day


Closed Thread
Results 1 to 8 of 8
  1. #1
    scorpion's Avatar
    scorpion Guest

    Default question of the day

    a bit of history...
    I built a small board with two push buttons, two pots, and two hall effect switches, 4 leds and 4 pwm - analog converters.
    it also has a icd port and icp port that connects the the epic programmer. I am making this to try out programs before i make any boards.

    now for the problem...
    i would like to have.......8... yes 8 pwm outputs. the chances are that I will never use all 8. typically 4 max, but I would like to have the option if possible.

    and what I need to know...
    could anyone suggest some type of flow chart that will allow me to use the interrupts from tmr1 and tmr2 to create all 8 channels of pwm.

    the frequencies will be: Digital output: 33Hz, 100Hz, or 200Hz
    Analog output:3kHz

    the frequencies will be set in the program.

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


    Did you find this post helpful? Yes | No

    Default

    will not be so easy to do... do you want to set them with different frequency working at the same time and also be able to play with all frequency duty cycles???
    Steve

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

  3. #3
    scorpion's Avatar
    scorpion Guest


    Did you find this post helpful? Yes | No

    Default

    the analog will always be 3k and the digital will be one of the three. so there will be a max of 2 freqs at any time.
    thanks for any help you can provide

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


    Did you find this post helpful? Yes | No

    Default

    o.k so
    • 2 frequency, 1 switchable, 1 fix
      8 outputs max

    i figure you want to be able to vary each output duty cycle???

    let me know
    Steve

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

  5. #5
    scorpion's Avatar
    scorpion Guest


    Did you find this post helpful? Yes | No

    Default

    thats right
    i have made 2 functions. the first is a direct maped output from one of the pots or hall effect push buttons. there is also a function to sum the two pots or two halls.
    ... lets go 4 pwm outs max... should make things easier and i dont think i will need more in the foreseeable future.
    thanks again
    -Garett

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


    Did you find this post helpful? Yes | No

    Default

    which PIC are you planning to use for this ???
    Steve

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

  7. #7
    scorpion's Avatar
    scorpion Guest


    Did you find this post helpful? Yes | No

    Default

    sorry i thought i posted that
    16f873a

  8. #8
    scorpion's Avatar
    scorpion Guest


    Did you find this post helpful? Yes | No

    Default

    here is my plan.
    i would apreciate any input.
    I will use one timer for the 3khz pwm. this will interupt at 300khz as 1% adjust will be enough resolution for me. then I will count the interupts and set the bits as necessary.
    this means that I will have a interrupt every 3.33 us.

    one question that I have is: at a clock freq of 20Mhz will this interupt every 3us bog down the rest of my program.

    I will use the same strategy for the other pwm freqs.

    another question: with two sources of interupts is it possible that if one interrupt comes while im processing another will it throw off my count.

    or.... can(should) I use the 3.33us for all of my pwm channels?

    thanks
    -Garett

Similar Threads

  1. picbasic-l Calculating the day of Week from a date
    By Melanie in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 3rd August 2012, 00:09
  2. Remote PIC input question
    By Adrian in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 1st September 2007, 15:44
  3. Bad Eeprom write on '628???
    By bethr in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 17th March 2007, 07:21
  4. Question for a math guru
    By Christopher4187 in forum General
    Replies: 3
    Last Post: - 22nd November 2006, 09:45
  5. Please answer my first question
    By John_001 in forum Off Topic
    Replies: 1
    Last Post: - 15th September 2006, 06:49

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