[an error occurred while processing this directive]
Вот текст этого проекта, точнее сишного файла
(«Телесистемы»: Конференция «Микроконтроллеры и их применение»)

миниатюрный аудио-видеорекордер mAVR

Отправлено eXeC001er 12 июля 2005 г. 15:00
В ответ на: В CodeVision в exaples есть готовый проект показывающий работу АЦП так и называется ADC8535 отправлено <font color=gray>eXeC001er</font> 12 июля 2005 г. 14:59

/* adc8535.c
ADC example for the AT90S8535 on
the Atmel STK500 starter kit

CodeVisionAVR C Compiler
© Copyright 2001-2002 HP InfoTech S.R.L.
www.hpinfotech.ro

Set the following jumpers on the STK500 board:
VTARGET, AREF, RESET, XTAL1, OSCSEL: 1-2

Connect the PORTB and LEDS headers with
a 10 wire ribbon cable

Connect the ISP6PIN and SPROG3 headers with
a 6 wire ribbon cable

The AT90S8535 must be located on socket SCKT3100A3

In the AVR Studio Tools|STK500|Board window set:
- VTarget=5.0V
- ARef=5.0V
- Oscillator=3.69MHz

Apply a positive DC voltage in the 0..5.0V range
between the PORTA header PA0 and GND pins
*/

// I/O register definitions for AT90S8535
#include <90s8535.h>
// delay functions
#include

#define ADC_VREF_TYPE 0x00
// ADC interrupt service routine
interrupt [ADC_INT] void adc_isr(void)
{
// The LEDs will display the 8 most
// semnificative ADC bits
PORTB=(unsigned char) ~(ADCW>>2);
// 20ms delay
delay_ms(20);
// Start a new AD conversion
ADCSR|=0x40;
}

void main(void)
{
// Port B initialization
PORTB=0xFF; // all outputs
DDRB=0xFF; // all LEDs are initially off

// ADC initialization
// ADC Clock frequency: 57.656 kHz
// ADC Interrupts: On
ADCSR=0x8E;

// Global enable interrupts
#asm("sei")

// Select ADC input 0
ADMUX=0;

// Start the first AD conversion
ADCSR|=0x40;

// All the job is done by ADC interrupts
while (1);
}

Составить ответ  |||  Конференция  |||  Архив

Ответы


Отправка ответа

Имя (обязательно): 
Пароль: 
E-mail: 
NoIX ключ Запомнить

Тема (обязательно):
Сообщение:

Ссылка на URL: 
Название ссылки: 

URL изображения: 


Перейти к списку ответов  |||  Конференция  |||  Архив  |||  Главная страница  |||  Содержание  |||  Без кадра

E-mail: info@telesys.ru