此帖出自微控制器 MCU论坛
最新回复
static unsigned int results;
void main(void)
{
WDTCTL = WDTPW+WDTHOLD;
P6SEL |= 0x04;
ADC12CTL0 = 0x0270; /* ADC12ON+REFON +REF2_5V +SHT0_2(4分频)*/
ADC12CTL1 = SHP; /*你ADC的时钟源好像是ACLK 采样/转换时钟是ADC12SC*/
ADC12MCTL0 = 0x02;
ADC12IE = 0x01;
ADC12CTL0 |= ENC;
_EINT();
while(1)
{
ADC12CTL0 |= ADC12SC; /*你1次采样/转换需要 (ADC12SC*X / SHT0_2)
如果设为连续采样就不需要ADC12SC */
_BIS_SR(LPM0_bits);
}
}
interrupt[ADC_VECTOR] void ADC12ISR (void)
{
results = ADC12MEM0;
_BIC_SR_IRQ(LPM0_bits);
}
详情
回复
发表于 2004-9-1 18:39
| ||
|
||
| |
|
|
| |
|
|
| |
|
|
此帖出自微控制器 MCU论坛
| ||
|
||
此帖出自微控制器 MCU论坛
| ||
|
||
| |
|
|
| |
|
|
| |
|
|
| |
|
|
此帖出自微控制器 MCU论坛
| ||
|
||
EEWorld Datasheet 技术支持