Hallo! Bin gerade dabei den ADC Port vom Luminary zu initialisieren, jedoch funkt das irgendwie nicht. Mein Code:
1 | void adc0_init() |
2 | {
|
3 | // Enable the ADC peripheral
|
4 | |
5 | SysCtlPeripheralEnable( SYSCTL_PERIPH_ADC ); |
6 | |
7 | // Setup the sequence
|
8 | //
|
9 | // Configure the ADC to sample the potentiometer when the timer expires.
|
10 | // After sampling, the ADC will interrupt the processor; this is used as
|
11 | // the heartbeat for the game.
|
12 | //
|
13 | ADCSequenceConfigure( ADC_BASE, // base |
14 | 0, // sequence num |
15 | ADC_TRIGGER_TIMER, // trigger |
16 | 0 ); // priority |
17 | |
18 | ADCSequenceStepConfigure( ADC_BASE, // base |
19 | 0, // sequence num |
20 | 0, // step num |
21 | ADC_CTL_CH0 ); // config |
22 | |
23 | |
24 | ADCSequenceEnable( ADC_BASE, 0 ); |
25 | |
26 | ADCIntEnable( ADC_BASE, 0); |
27 | IntEnable(INT_ADC0); |
28 | }
|
29 | |
30 | void ADC_isr( void ) |
31 | {
|
32 | // Clear the interrupt
|
33 | |
34 | ADCIntClear( ADC_BASE, 0 ); |
35 | |
36 | // Grab the data from the ADC
|
37 | |
38 | ADCSequenceDataGet( ADC_BASE, 0, &ulValue); |
39 | |
40 | |
41 | } // ADC_isr |
Habe im den Interrupt im Vektor (Startup) eingetragen. Weiß einer woran es liegen könnte, bzw. könnte mir wer tipps geben? danke im voraus! mfg. Hans