What happens if interrupt breaks PULSIN, PULSOUT, ADCIN, PWM, etc statements?


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: What happens if interrupt breaks PULSIN, PULSOUT, ADCIN, PWM, etc statements?

    If the application allows you can disable interrupts while
    those commands are running, and re-Enable straight after.
    No good for some applications such as a real time counter
    but in others you coupd get away with it.

  2. #2
    Join Date
    Feb 2013
    Posts
    1,123


    Did you find this post helpful? Yes | No

    Default Re: What happens if interrupt breaks PULSIN, PULSOUT, ADCIN, PWM, etc statements?

    Two more interrupt/timer/pwm questions, if you don't mind.

    1. Is it possible to configure timer to enable-disable hpwm generator at predefined time amounts? say, 1 second on, 1 second off. So all this code will run in background, without taking CPU time?
    2. Is it possible to change interrupt type on the fly? Say, interrupt was set to rising edge, it happened, and now changed to falling edge ?

  3. #3
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,605


    Did you find this post helpful? Yes | No

    Default Re: What happens if interrupt breaks PULSIN, PULSOUT, ADCIN, PWM, etc statements?

    1) For a short answer I would say no, not really but a standard timer interrupt can easily be used (which then obviously uses a combination of hardware (the timer) and software (the interrupt service routine). For a 100% hardare solution, I guess it depends on which PIC you're using and what features/peripherals it's got. It's possible that it's doable by combining for example the special event triggers and/or the configurable logic cell available on some devices but I haven't looked into it so I can't say for sure if it's possible or not.

    2) Sure, no problems with that.

    /Henrik.

  4. #4
    Join Date
    Feb 2013
    Posts
    1,123


    Did you find this post helpful? Yes | No

    Default Re: What happens if interrupt breaks PULSIN, PULSOUT, ADCIN, PWM, etc statements?

    Thanks!

    For the #1, I've read 16F1829 datasheet, and it says that it can emulate 555 timer in hardware, so I guess, it might be possible to do what I want.

    For the #2, I see this In the following way:

    Interrupt was set to rising edge, it happened, and code is launched, which does what it should do, in loop. Same time, interrupt type is changed to falling edge, so when signal on interrupt pin gets low, code is terminated and main code execution continues. This is what I want to do.

Similar Threads

  1. Pulsin alternative for 2khz pwm
    By retepsnikrep in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 5th January 2014, 19:19
  2. Pulsin vs. Interrupt RPM measurement
    By Tobias in forum General
    Replies: 1
    Last Post: - 31st December 2009, 01:29
  3. 18f4550 USB and pulsin or pulsin alternative
    By vacpress in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 15th January 2009, 13:14
  4. pulsout pulsin on same pin - timing?
    By vacpress in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 15th January 2009, 07:21
  5. Pulsin to pulsout with up than 4MHZ crystal ?
    By RCtech in forum mel PIC BASIC
    Replies: 5
    Last Post: - 18th May 2006, 19:23

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