-
Thread
PWM -> Analog (+12V/-12V)
Versorgungsspanung +12V; -12V und GND (0V). Habe einen µC mit einem PWM ausgang (10kHZ) 0/+5V. Einen OP AD708 und würde daraus gerne eine Analogspannung von ca. 0-24V (-12V bis +12V) bekommen. Hatte Schon an eine Differenzverstärkerschaltung gedacht, nur haut das leider nicht so hin. Wenn möglich auch nur
-
Thread
Problem mit static bzw. volatile (Regelung)
stdio.h> #include <stdlib.h> #include <delay.h> #define ADC_VREF_TYPE 0x00 // Read the AD conversion result unsigned int read_adc(unsigned char adc_input) { ADMUX=adc_input|ADC_VREF_TYPE; // Start the AD conversion ADCSR|=0x40; // Wait for the AD conversion to complete while ((ADCSR
3600 Hz -> t_0 = 1/(3600/255) = 70.83 ms // TCCR2=0x06; 14400 Hz -> t_0 = 1/(14400/255) = 17,708 ms // TCCR2=0x05; 28800 Hz -> t_0 = 1/(28800/255) = 8,85 ms // TCCR2=0x02; 460800 Hz -> t_0 = 1/(460800/255) = 0,553 ms // Mode: Normal top=FFh // OC2 output: Disconnected ASSR=
-
Thread
PI-Regelung bleibt hängen...
Output functions #include <stdio.h> #include <stdlib.h> #define ADC_VREF_TYPE 0x00 // Read the AD conversion result unsigned int read_adc(unsigned char adc_input) { ADMUX=adc_input|ADC_VREF_TYPE; // Start the AD conversion ADCSR|=0x40; // Wait for the AD conversion to complete while ((ADCSR
***** // Mittelung des A/D Ergebnis: for(i=1; i<=10; i++) { ad_summe += read_adc(0); } ad_summe/=10; itoa(ad_summe, istwert); ******/ itoa(read_adc(0),istwert); puts(istwert); }
-
Thread
Interrupts funktionieren nicht.
Output functions #include <stdio.h> #include <stdlib.h> #define ADC_VREF_TYPE 0x00 // Read the AD conversion result unsigned int read_adc(unsigned char adc_input) { ADMUX=adc_input|ADC_VREF_TYPE; // Start the AD conversion ADCSR|=0x40; // Wait for the AD conversion to complete while ((ADCSR
3600 Hz -> t_0 = 1/(3600/255) = 70.83 ms // TCCR2=0x06; 14400 Hz -> t_0 = 1/(14400/255) = 17,708 ms // TCCR2=0x05; 28800 Hz -> t_0 = 1/(28800/255) = 8,85 ms // Mode: Normal top=FFh // OC2 output: Disconnected ASSR=0x00; TCCR2=0x00; TCNT2=0x00; OCR2=0x00; // External Interrupt(s) initialization