braulio chi salavarria

Help with adc QY4

Discussion created by braulio chi salavarria on Jul 21, 2008
Latest reply on Jul 22, 2008 by braulio chi salavarria
hi, I 'm sorry to trouble you, but I can't make that work the adc of QY4, I'm new in the microcontroller freescale, but I start and I need some help., my program is this

#include <hidef.h> /* for EnableInterrupts macro */#include <MC68HC908QY4.h> /* include peripheral declarations */#include <startup.h>unsigned char result;void interrupt 16 ADC_ISR(void){  result=ADR;  }void inicializacion(void);void main(void) {  inicializacion();    ADICLK=0x80;  ADSCR = 0x43;     for(;;){         while (!ADSCR_COCO);        result=ADR;        PTB= result;      }           /* loop forever */  /* please make sure that you never leave this function */}void inicializacion(){   CONFIG1=0x09; CONFIG2=0x80; OSCTRIM=0x80;  DDRB=0xFF;   }

 please, could you put an easy example of adc in c

thanks, and I'm sorry for my english, I promise to learn speak english