EasyAVR6, ..
J12 0 4. , .
.
, :
/*
ADC init
*/
void ADCInit(void)
{
ADMUX = 0; // 0, AREF,
/* , . = 64, , */
ADCSRA = _BV(ADEN) | _BV(ADIF) | _BV(ADIE) | _BV(ADPS2) | _BV(ADPS1);
}
:
ADCSRA |= _BV(ADSC); // start conversion
:
/*
*/
ISR (ADC_vect)
{
uint16_t result = ADC;
__ ;
}
.
- . .
- . , , . , , . !
- ( Proteus , ). . .
- .
, ( ). .
.
1 | PORTA.0 | PORTB, LCD | 8 | |
250 | PORTA.1 | PORTC, LCD | 8 | |
500 | PORTA.2 | PORTB, LCD | 8 | |
2 | PORTA.3 | PORTB, LCD | 8 | |
1 | PORTA.4 | PORTC, LCD | 4 | |
250 | PORTA.4 | PORTC, LCD | 4 | |
500 | PORTA.3 | PORTB, LCD | 4 | |
2 | PORTA.2 | PORTC, LCD | 4 | |
1 | PORTA.1 | PORTC, LCD | 1 | |
250 | PORTA.0 | PORTB, LCD | 1 | |
500 | PORTA.0 | PORTC, LCD | 1 | |
2 | PORTA.1 | PORTB, LCD | 1 |
- AtMega16?
- ( )?
- AtMega16?
- 2 ?
- ?
- ?
- ?
- ?
- ?
.
|
|
http://www.gaw.ru/html.cgi/txt/doc/micros/avr/arh/start.htm
http://avr.ru/docs/books/avr