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

About on-chip ADC of ST3434E

Hi, everyone: Does anybody has used ST3434E before? The easiset ADC gets me confused. Following is my code:

#include <ST/upsd3400.h>
#include "DATATYPES.H"
#include "ADC.h"


sfr16 ADAT      = 0x95;
sfr16 P1SFS     = 0x8e;


#define ADC_ENABLE      0x20
#define ADC_START       0x02
#define ADC_BUSY        0x01
#define ADC_WORK        (ADC_ENABLE | ADC_START)


VOID ADC_Init(VOID)
{
        P1SFS   |= 0x0101; // ADC channel 0
        //P1SFS0        = 0x01;
        //P1SFS1        = 0x01;

        ACON    = ADC_ENABLE;// ADC enable, interrupt disable, channel 0
}

WORD ADC_Read(VOID)
{
        ACON = ADC_START;
        while (!(ACON & ADC_BUSY)); // wait until ADC is not busy
        //ACON &= ~ADC_ENABLE;
        return (ADAT);
}

The bit 0 of ACON is status flag, when it is set to 1, the AD conversion completed. But it is never set!

Keil 8, JTAG debugger

0