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

ATMEL T89C51CC01 PSIDLE mode problems...

Hello !!

I've following problem: I use a ATMEL T89C51CC01 Mcu with the Keil C51 c-compiler/simulator. When I use the ADC in pseudo idle mode (I set PSIDLE bit) the MCU doesn't wake up any more (although the ADEOC flag occurs !! and all other bits are set (EA,EADC,Priority highest and also tested lowest)).
Until now I've tested the software only on the simulator...
Has anybody an idea, what the problem might be ??
thx for your help,
florian mair.
P.s.: using the idle mode of the PCON sfr (IDL bit) the Mcu wakes up again ...

Parents
  • I can see a possible problem. The micro goto to sleep before the ADSSTON line executes. I would goto to sleep, start the conversion and clear the last end of conversion flag, all in one statement. In this case the ISR does not need to do anything.

    void Adc_int_(void) interrupt ADC_INT
    {
    }
    
    WORD ReadAdc( BYTE Channel )
    {
      ADCON = 0x48 | Channel; //= PSIDLE | ADSST | ~ADEOC
      //the only way to get to this line is for the conversion to be completed
      return( ADDH << 8 | ADDL );
    }
    

Reply
  • I can see a possible problem. The micro goto to sleep before the ADSSTON line executes. I would goto to sleep, start the conversion and clear the last end of conversion flag, all in one statement. In this case the ISR does not need to do anything.

    void Adc_int_(void) interrupt ADC_INT
    {
    }
    
    WORD ReadAdc( BYTE Channel )
    {
      ADCON = 0x48 | Channel; //= PSIDLE | ADSST | ~ADEOC
      //the only way to get to this line is for the conversion to be completed
      return( ADDH << 8 | ADDL );
    }
    

Children