adc reference bug fixed
This commit is contained in:
parent
2c36fe05f8
commit
708b35c295
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,5 +1,6 @@
|
|||
# Prerequisites
|
||||
*.d
|
||||
gnuplotscript.gp
|
||||
|
||||
# Compiled Object files
|
||||
*.slo
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
set margin 10,10
|
||||
unset key
|
||||
set grid
|
||||
set title ''
|
||||
set xlabel 'U_{OUT} [V]'
|
||||
set ylabel 'U_{IN} [V]'
|
||||
set xrange [0:5]
|
||||
set yrange [0:5]
|
||||
set label at 5,5 ' [V] = 0' left
|
||||
unset output
|
||||
set terminal qt
|
||||
unset output
|
||||
plot "/tmp/tempfile0" using ($1*0.004888):($2*0.004888) binary format="%int16%int16" endian=big title ' [V] = 0' w l
|
|
@ -34,7 +34,10 @@ int main()
|
|||
|
||||
for(uint16_t x = 0; x < sample_count * delta; x += delta)
|
||||
{
|
||||
pf.addDot(Dot(x, ba[x], curve));
|
||||
drv.analogWrite0(x);
|
||||
uint16_t y = drv.analogRead(0);
|
||||
std::cout << x << " - " << y << std::endl;
|
||||
pf.addDot(Dot(x, y, curve));
|
||||
}
|
||||
|
||||
// speichern und plotty starten
|
||||
|
|
Binary file not shown.
|
@ -47,7 +47,7 @@ cli: drv $(OBJECTS_CLI)
|
|||
$(PATH_COMPILER) $(CFLAGS) $(OBJECTS_CLI) -L $(PATH_TMP_LIB) -o $(OUT_TMP_CLI) $(LDFLAGS_CLI)
|
||||
@bash -c 'if [ ! -f "$(OUT_DRV)" ]; then echo -e "\n*** Warning ***: driver not installed\nType \"sudo make install\" to install or update b15fdrv."; fi'
|
||||
|
||||
install: drv
|
||||
install: all
|
||||
@echo "Installing driver..."
|
||||
@mkdir -p $(PATH_INCLUDE)
|
||||
cp $(OUT_TMP_DRV) $(OUT_DRV)
|
||||
|
@ -55,7 +55,7 @@ install: drv
|
|||
cp $(OUT_TMP_PLOTTY) $(OUT_PLOTTY)
|
||||
cp drv/*.h $(PATH_INCLUDE)
|
||||
|
||||
uninstall:
|
||||
uninstall: clean
|
||||
@echo "Uninstalling driver..."
|
||||
rm -rf $(PATH_INCLUDE) $(OUT_DRV) $(OUT_CLI) $(OUT_PLOTTY)
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ clean:
|
|||
|
||||
checkfuses:
|
||||
@echo "Checking fuses..."
|
||||
@bash -c 'diff -B <( echo "$(FUSES)" ) <( avrdude -Pusb -p $(MCU) -c $(PROGRAMMER) 2>&1 | grep "safemode: Fuses OK" | tail -c 19 ) >/dev/null || avrdude -Pusb -p $(MCU) -c $(PROGRAMMER) -U lfuse:w:0x$(LFUSE):m -U hfuse:w:0x$(HFUSE):m -U efuse:w:0x$(EFUSE):m'
|
||||
@bash -c 'diff -B <( echo "$(FUSES)" ) <( avrdude -Pusb -p $(MCU) -c $(PROGRAMMER) 2>&1 | grep "safemode: Fuses OK" | tail -c 19 ) >/dev/null && echo "Fuses okay" || avrdude -Pusb -p $(MCU) -c $(PROGRAMMER) -U lfuse:w:0x$(LFUSE):m -U hfuse:w:0x$(HFUSE):m -U efuse:w:0x$(EFUSE):m'
|
||||
|
||||
upload: b15f checkfuses
|
||||
@echo "Uploading hex file..."
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
void ADU::init() volatile
|
||||
{
|
||||
// externe Referenz an AREF
|
||||
ADMUX = 0;
|
||||
ADMUX = _BV(REFS0);
|
||||
|
||||
// ADC aktiviert, Interruptbetrieb, prescaler = 128
|
||||
ADCSRA = _BV(ADEN) | _BV(ADIE) | _BV(ADPS2) | _BV(ADPS1) | _BV(ADPS0);
|
||||
|
|
Loading…
Reference in a new issue