This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to resolve the contention between 2 ADC0801!!!???

How to resolve the contention between 2 ADC0801!!!???

I would like using two ADC0801 in order to read 2 Vol electric signal ., 2 ADC interfaces with AT89c51 by using common input..If I use an ADC, no problem, but with 2 ADC ,ADC will not working!!!! Please help me!!!

My programmer and file Proteus is below

www.MegaShare.com/512261

Parents
  • ìn fact, it is not simple like that!!!!,i want to use RTOS for this application,system with multi Task.For example:,read ADC1,read ADC2,comunicate with keyboard,and show with led 7segs....each task correspond with each <cycle time>,and <different priority>...

    i only want know the reason, in single task system: why can't i use 2 ADC in turn in order to read ...maybe there are some error in my programer,or my proteus ???? help me to determine!!!!

Reply
  • ìn fact, it is not simple like that!!!!,i want to use RTOS for this application,system with multi Task.For example:,read ADC1,read ADC2,comunicate with keyboard,and show with led 7segs....each task correspond with each <cycle time>,and <different priority>...

    i only want know the reason, in single task system: why can't i use 2 ADC in turn in order to read ...maybe there are some error in my programer,or my proteus ???? help me to determine!!!!

Children
  • Just use separate signals to drive the two chip-select lines.

    Or switch to an ADC with multiple inputs.

  • You need to stop throwing more confusion at this problem. Forget about RTOS, tasks, cycle times and priorities for now.

    why can't i use 2 ADC in turn in order to read

    How would anybody but you know? You haven't told us how you did use those 2 ADCs, nor what makes you think it didn't work.

  • There is no reason why it shouldn't be simple!

    It only gets complicated because you make it so:

    "i want to use RTOS for this application"

    Why do you want to do that?

    Usually, the reason to ues an RTOS is because you need one - so, if you don't actually need one, don't use one!

    If you simply want an exercise in using an RTOS, then start with stuff that you already understand - don't confuse the issue by trying to learn both ADC interfacing and RTOS at the same time!

    Master one first, then move on to the other...

    "For example:,read ADC1,read ADC2,comunicate with keyboard,and show with led 7segs..."

    Absolutely no need whatsoever for an RTOS to do all that - and more!

    "i only want know the reason, in single task system: why can't i use 2 ADC in turn in order to read"

    If you don't know how to do it in a single task system, then you are certainly not ready to start doing it in a multi-task system!

    Learn to walk before you try to run.

    Lay the foundations before you try to put the roof on.

    etc, etc,...

  • thanks Hans-Bernhard Broeker...that is a thing what i want to ask all of you..

  • For a start, how do you know that you have "contention" between the two ADCs in the first place?

    Does each one work independently if you remove the other from the circuit?

    If this doesn't work, then you have a far more fundamental problem...

  • Andy Neil.. i understand what you mean,i am doing that work right now, i don't want to dispute,please focus my subject which i mention

  • i have alredy run 1 ADC...and you can see my file here... www.mediafire.com/

  • if you alredy see my project,you will see clear,when i press button, chip can't read ADC cause there is not any "interrupt signal" which is sended by ADC after convert...

    "Does each one work independently if you remove the other from the circuit?"
    i can drive ADC1 when i remove ADC2...see my first file above

  • To my knowledge, the /INTR signal is not tristate, so you can not directly connect two /INTR outputs to a single interrupt pin on your processor.

    You either have to connect them using a AND gate (any /INTR going low will drive the output of the AND low) or connect them to two separate inputs of the processor.

    The problem with letting them feed the same interrupt is that you will not know which ADC that is ready to be serviced (unless you only started one conversion).

    This is a big reason for using an external analog multiplexer, or an ADC with multiple inputs. Then you have _one_ ADC that will issue an interrupt, and you will always know which signal that is currently multiplexed into the ADC or which channel of the ADC that you requested to perform a conversion.

  • thank for caring my problem..... my english is not good,download my project,and all of you can undenstand clearly...

  • In my progam:
    i use 2 button to control 2 ADC.each ADC have each pin INTR to connect 2 separate input pin of the processor..so why d'ont INTR pin of ADC work,after converted...this thing cause ADC can't be read by processor

  • Problem with an interrupt signal only affects how you will know that a conversion is done - it does not affect your ability to talk with the ADC.

  • when I remove ADC2 in my circuit(proteus),ADC1,processor run as normal
    When i remove ADC1,then ADC2 also does not work...Why??There is only ADC1 work actually
    if all 2 ADC connect in circuit,When I press any buttons,,chip does not work...see here.www.mediafire.com/

  • "Problem with an interrupt signal only affects how you will know that a conversion is done - it does not affect your ability to talk with the ADC"

    i understand this thing.My mean:i use button to allow operate ADC,star convert,,then wait signal INTR from ADC send to CHIp to alert "finish start convert",after chip will read ADC then show in leg7seg...is this right??

    my code use for operating ADC

    if(button1==1){
    CS_1=0;
    WR_1=0;
    WR_1=1;
    while (INTR_1==1);//wait for signal INRT_1...cho den khi co tin hieu ngat tu ADC
    CS_1=0;
    RD_1=0;
    //CS_1=1 not write here khong the dat o day...dan toi ko doc duoc
    }

  • ... you need to post them in a format people can read.

    Unfortunately, as far as I know, there is no universal schematic format - so you will have to export it to something like GIF or PDF.

    Note that JPEG is not (generally) a good choice for schematics...