Results 1 to 3 of 3

Thread: Analog Interrupt or separate PIC device?

  1. #1

    Analog Interrupt or separate PIC device?

    I need someone to help me decide on a design involving interrupts. I'm trying to decide to use a separate PIC just for the simple task of reading one analog input and providing a binary input to another PIC device. This is as opposed to having it done in the larger PIC with other code in the loop. In other words I want the A/D read to have no delays - simple reads and an out when compared to a 1-255 number. My gut tells me thats what interrupts are for - have an interrupt just for reading the Analog input on a pin, reading all the time. Am I correct?

    My thought for the single device is a 10F222 - one issue is I'd need two programming headers if I want to do ISP

    Thanks

  2. #2
    My gut tells me thats what interrupts are for - have an interrupt just for reading the Analog input on a pin, reading all the time
    Well, not quite, but it depends on your definition of "all the time". If your pic does nothing but read the adc all the time then there's no time for other things. You could setup a timer interrupt to read the adc every x msecs or so, and that would let your main routine run.

    However, when you stop and think about it that doesn't really get you anything. The way you originally described it, if your main routine only reads the state of the IO pins every 10 msecs then there's no reason to have something else reading the the adc faster than that, right? You might as well have the main pic just read the adc every 10msecs as part of your main loop.

    Sometimes folks think that adding more pics to the mix makes things better/easier, but in most cases all it does is complicate issues and raise the cost.

    Why do you need to read the adc continuously with no delays? What's the problem you're trying to solve?

  3. #3
    For continuously monitoring a voltage and expecting a "TRIP" signal, why not just use a voltage comparator and connect its output to the processor of choice? Depending on the processor, some have built in comparators that can be connected to an interrupt channel. Also some processors have a built in DAC that can be used to program the voltage comparator.
    Dave Purola,
    N8NTA
    EN82fn

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •