SV: [Icc-avr] ATMega644p -> ADC
Steven Lose
sl at ecpower.dk
Sun Sep 28 11:07:20 PDT 2008
Hi.
have you included the right target header file?
Med venlig hilsen / Best regards / mit freundlichen Grüßen
EC POWER A/S
Steven Lose
Software Ingeniør
Tlf.: +45 87434100
Direkte tlf. +45 58286608
Email: sl at ecpower.dk
www.ecpower.dk
-----Oprindelig meddelelse-----
Fra: icc-avr-bounces at imagecraft.com [mailto:icc-avr-bounces at imagecraft.com] På vegne af Rainer Dehnert
Sendt: 28. september 2008 00:29
Til: icc-avr at imagecraft.com
Emne: [Icc-avr] ATMega644p -> ADC
Hi,
using ATMega644p at 20MHz with my desired settings:
- 1,1V internal Reference
- Auto trigger @ timer0 compare match
- division factor 128 -> 156,250kHz
#pragma interrupt_handler adc_isr:iv_ADC
//globals
unsigned int adc_data[9];
//adc isr
void adc_isr(void) {
static unsigned char input_index;
adc_data[input_index] = ADC;
if(++input_index == 8)
input_index = 0;
ADMUX = (0b10000000 + input_index);
putchar('a'); //only for debugging
}
//adc init
void adc_init(void) {
ADMUX = 0;
ADCSRA = 0b10101111;
ADCSRB = 0b00000011;
ADC = 0;
DIDR0 = 0b11111111;
}
Running the code above the adc-isr is never executed.
I called SEI() within 'init_devices' and the timer0_comp_isr is
executed every 1,022ms correctly.
What's going wrong?
Many thanks in advance,
Rainer
_______________________________________________
Icc-avr mailing list
Icc-avr at imagecraft.com
http://dragonsgate.net/mailman/listinfo/icc-avr
More information about the Icc-avr
mailing list