interrupt vector for mc68hc908qt4

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

interrupt vector for mc68hc908qt4

1,923 Views
mevil
Contributor I
how mc68hc908qt4 handles the interrupt.
 
Im facing problem when using the adc interrupt of this particular chip.
 
i have written the code like this
 
interrupt 16 void adc_int (void)
{
/* reading the value of the adr register
}
 
i have done the init adc setting as
void initialise_adc(void) {
 
    ADSCR_AIEN = 1;
    ADSCR_ADCO = 0;
    ADICLK = 0X00;
   ADSCR_CH4 = 0;
   ADSCR_CH3 = 0;
  ADSCR_CH2 = 0;
   ADSCR_CH1 = 0;
   ADSCR_CH0 = 0;
    }
 
in main ()
{
initialise_adc();
}
 
bur during the debug it is giving  the error as
Error - Attempt to set A/D channel to a reserved value
 
please help me on this topic
 
 
Labels (1)
Tags (1)
0 Kudos
Reply
2 Replies

850 Views
bigmac
Specialist III
Hello,
 
It would seem that your problem occurs because you attempt to write the channel select bits individually - all five bits should be written in a single operation.  Each time these bits are written this will cause a conversion to commence for the selected channel.
 
void initialise_adc(void)
{
   ADICLK = 0x00;
   ADSCR_AIEN = 1;
   ADSCR_ADCO = 0;
   ADSCR_ADCH = 0;  /* Start conversion on Ch 0 */
}
 
Regards,
Mac
 

850 Views
trytohelp
NXP Employee
NXP Employee
Hi,
 
Your request is asking some investigation.
It will be better to log this issue in the CRM system.
- Go to following URL: http://www.freescale.com/TechSupport
- Click on Submit a Service Request. You will come to a login page.
- You can submit your request through the web from there.
 
Please provide us :
 
+ the codeWarrior Version used:
To do that you must:
Start the IDE and click on Help | About Metrowerks CodeWarrior.
Click on Installed Products
Provide us all info displayed.
Or you can save them in a txt file.
 
+ your example code reproducing the problem (the project folder in a zip file).
 
Pascal