This commit is contained in:
2024-12-22 05:22:46 +03:00
commit 1992e632d3
232 changed files with 20394 additions and 0 deletions

2
extras/tests/simavr_based/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
.links
.makefiles

View File

@@ -0,0 +1,62 @@
ifndef SILENCE
SILENCE=0
endif
PRJ_ROOT=$(shell git rev-parse --show-toplevel)
TESTS=$(wildcard test_*)
TESTS_SD=$(wildcard test_*sd_*)
TEST_FILES=$(addsuffix /.tested,$(TESTS))
SD_SRC_DIRS=$(addsuffix /src/.dir,$(TESTS_SD))
SRC=$(wildcard ../../src/*)
test: $(TEST_FILES) pmf externalCall
pmf:
make -C test_pmf
externalCall:
make -C test_externalCall
%/.tested: $(SRC) run_avr %/expect.txt %/platformio.ini .makefiles .links
make SILENCE=$(SILENCE) -C $(dir $@)
.makefiles: makefiles
makefiles: $(addsuffix /Makefile,$(TESTS))
touch .makefiles
%/Makefile:
cd $(dir $@); ln -s ../Makefile.test Makefile
.links: links
links: $(SD_SRC_DIRS)
touch .links
%/src/.dir:
mkdir -p $(dir $@)
cd $(dir $@); ln -sf $(PRJ_ROOT)/examples/StepperDemo/* .
run_avr: simavr/simavr/run_avr
ln -s simavr/simavr/run_avr .
simavr/simavr/run_avr: simavr/simavr/sim/run_avr.c
make -C simavr build-simavr
simavr/simavr/sim/run_avr.c:
# git clone https://github.com/gin66/simavr.git
git clone https://github.com/buserror/simavr.git
(cd simavr;git checkout 132cc67)
proper: clean
rm -f run_avr
rm -fR simavr
clean:
rm -fR */.pio */.tested */x.vcd */result.txt
find . -type l -delete
find . -type d -empty -delete
rm -f .links .makefiles

View File

@@ -0,0 +1,127 @@
#
# In order to execute the test for one directory use:
#
# make -C test_sd_01b_328p -f ../Makefile.test
SRC=$(wildcard ../../../src/*) $(wildcard src/*)
# platformio should contain only one env section.
# This section states the dut name
# atmega168
# atmega168p
# atmega328
# atmega328p
# atmega2560_timer1
# atmega2560_timer3
# atmega2560_timer4
# atmega2560_timer5
#
DUT=$(shell gawk '/env:/{print(substr($$1,6,length($$1)-6))}' platformio.ini)
TRACES=-at StepISR=trace@0x25/0x08 # PB3
TRACES+=-at FillISR=trace@0x25/0x10 # PB4
#
ifeq ($(DUT),atmega2560_timer1)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x025/0x20 #OC1A PB5 11 ATMega2560
TRACES+=-at StepB=trace@0x025/0x40 #OC1B PB6 12 ATMega2560
TRACES+=-at StepC=trace@0x025/0x80 #OC1C PB7 13 ATMega2560
#
else ifeq ($(DUT),atmega2560_timer3)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x02e/0x08 #OC3A PE3 5 ATMega2560
TRACES+=-at StepB=trace@0x02e/0x10 #OC3B PE4 2 ATMega2560
TRACES+=-at StepC=trace@0x02e/0x20 #OC3C PE5 3 ATMega2560
#
else ifeq ($(DUT),atmega2560_timer4)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x102/0x08 #OC4A PH3 6 ATMega2560
TRACES+=-at StepB=trace@0x102/0x10 #OC4B PH4 7 ATMega2560
TRACES+=-at StepC=trace@0x102/0x20 #OC4C PH5 8 ATMega2560
#
else ifeq ($(DUT),atmega2560_timer5)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x10b/0x08 #OC5A PL3 46 ATMega2560
TRACES+=-at StepB=trace@0x10b/0x10 #OC5B PL4 45 ATMega2560
TRACES+=-at StepC=trace@0x10b/0x20 #OC5C PL5 44 ATMega2560
else ifeq ($(DUT),atmega168)
DEVICE=atmega168
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 ATMega168
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 ATMega168
else ifeq ($(DUT),atmega168p)
DEVICE=atmega168p
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 ATMega168p
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 ATMega168p
else ifeq ($(DUT),atmega328)
DEVICE=atmega328
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 ATMega328
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 ATMega328
else ifeq ($(DUT),atmega328p)
DEVICE=atmega328p
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 ATMega328p
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 ATMega328p
else ifeq ($(DUT),atmega32u4)
DEVICE=atmega32u4
TRACES+=-at StepA=trace@0x025/0x20 #OC1A PB5 11
TRACES+=-at StepB=trace@0x025/0x40 #OC1B PB6 12
#TRACES+=-at StepC=trace@0x025/0x80 #OC1C PB7 13
endif
ifeq ($(DEVICE),atmega2560)
TRACES+=-at DirA=trace@0x2b/0x01 # Pin 21 PD0
TRACES+=-at DirB=trace@0x2b/0x02 # Pin 20 PD1
TRACES+=-at DirC=trace@0x10b/0x80 # Pin 42 PL7
TRACES+=-at EnableA=trace@0x2b/0x04 # Pin 19 PD2
TRACES+=-at EnableB=trace@0x2b/0x08 # Pin 18 PD3
TRACES+=-at EnableC=trace@0x10b/0x40 # Pin 43 PL6
else ifeq ($(DEVICE),$(filter $(DEVICE),atmega168 atmega168p atmega328 atmega328p))
TRACES+=-at DirA=trace@0x2b/0x20 # Pin 5 PD5
TRACES+=-at DirB=trace@0x2b/0x80 # Pin 7 PD7
TRACES+=-at EnableA=trace@0x2b/0x40 # Pin 6 PD6
TRACES+=-at EnableB=trace@0x25/0x01 # Pin 0 PB0
else ifeq ($(DUT),atmega32u4)
TRACES+=-at DirA=trace@0x25/0x10 # Pin 26 PB4
TRACES+=-at DirB=trace@0x25/0x08 # Pin 14 PB3
#TRACES+=-at DirC=trace@0x10b/0x80 # Pin 42 PL7
TRACES+=-at EnableA=trace@0x25/0x04 # Pin 16 PB2
TRACES+=-at EnableB=trace@0x25/0x02 # Pin 15 PB1
#TRACES+=-at EnableC=trace@0x10b/0x40 # Pin 43 PL6
endif
FIRMWARE=".pio/build/$(DUT)/firmware.elf"
DIR=$(shell env pwd)
ifndef SILENCE
SILENCE=0
endif
test: .tested
.tested: result.txt expect.txt ../judge.awk
echo DUT=$(DUT)
rm -f .tested
gawk -f ../judge.awk -v DIR=$(DIR) result.txt expect.txt
test -f .tested
result.txt: x.vcd
gawk -v SILENCE=$(SILENCE) -f ../eval.awk x.vcd
cat expect.txt
x.vcd: $(SRC) ../run_avr platformio.ini
env pio run -e $(DUT) || ~/.platformio/penv/bin/pio run -e $(DUT) || ~/.local/bin/pio run -e $(DUT)
../run_avr $(FIRMWARE) -m $(DEVICE) -o x.vcd $(TRACES)
clean:
rm -fR .pio .tested x.vcd result.txt

View File

@@ -0,0 +1,31 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
# There should be only one env section for the DUT under test.
# One of
# atmega168p
# atmega328p
# atmega2560_timer1
# atmega2560_timer3
# atmega2560_timer4
# atmega2560_timer5
#
[common]
# This is the line input to StepperDemo:
build_flags = -D SIM_TEST_INPUT='"? M1 V60 A40000 f w400 A40000 P0 w1000 W "'
[env:atmega328p]
platform = atmelavr
board = nanoatmega328
framework = arduino
build_flags = -Werror -Wall ${common.build_flags}
lib_extra_dirs = ../../../../..

View File

@@ -0,0 +1,128 @@
BEGIN {
ref = 16*100
dump_all = 0
}
dump_all == 1{print}
/^\$var wire 1/ {
names[++name_i] = $5
sym[$4] = $5
to_sym[$5] = $4
period_hl_hl[$4] = 0
period_lh_lh[$4] = 0
time_h[$4] = 0
time_l[$4] = 0
transition_l_h[$4] = 0
transition_h_l[$4] = 0
cnt_l_h[$4] = 0
cnt_h_l[$4] = 0
max_time_h[$4] = 0
sum_time_h[$4] = 0
state[$4] = "X"
}
/^#/ { time = substr($1,2) + 0 }
/^1.$/ {
s = substr($1,2)
if(!SILENCE) printf("%s=1 ", sym[s])
if (state[s] == 0) {
# transition L->H
cnt_l_h[s]++
last = transition_l_h[s]
transition_l_h[s] = time
if (last > 0) {
period_lh_lh[s] = time - last
}
last = transition_h_l[s]
if (last > 0) {
time_l[s] = time - last
}
if (sym[s] ~ /Step/) {
channel = substr(sym[s],5)
if(!SILENCE) printf("%s: ", channel)
dir = "Dir" channel
if (dir in to_sym) {
dir_sym = to_sym[dir]
if (state[dir_sym] == 0) {
position[channel]--
}
else {
position[channel]++
}
if(!SILENCE) printf("position=%d ",position[channel])
}
if(!SILENCE) printf("period=%.1fus high time=%.1fus",
period_lh_lh[s]/ref,time_h[s]/ref)
}
}
if(!SILENCE) printf("\n")
state[s] = 1
}
/^0.$/ {
s = substr($1,2)
if(!SILENCE) printf("%s=0 ", sym[s])
if (state[s] == 1) {
# transition H->L
cnt_h_l[s]++
last = transition_h_l[s]
transition_h_l[s] = time
if (last > 0) {
period_hl_hl[s] = time - last
}
last = transition_l_h[s]
if (last > 0) {
time_h[s] = time - last
}
if (sym[s] ~ /FillISR/) {
if(!SILENCE) printf("period=%.1fus ", period_lh_lh[s]/ref)
}
h_time = time_h[s]/ref
if(!SILENCE) printf("high time=%.1fus", h_time)
sum_time_h[s] += h_time
if (h_time > max_time_h[s]) {
max_time_h[s] = h_time
}
}
if(!SILENCE) printf("\n")
state[s] = 0
}
END {
n = asort(names)
for (i = 1;i <= n;i++) {
name = names[i]
s = to_sym[name]
info = sprintf("%8s: %8d*L->H, %8d*H->L",name,cnt_l_h[s],cnt_h_l[s])
if (name ~ /Step/) {
info = sprintf("%s, Max High=%dus Total High=%dus", info, max_time_h[s], sum_time_h[s])
}
if(!SILENCE) print(info)
if (name !~ /ISR/) {
print(info) >"result.txt"
}
}
channels["A"]=1
channels["B"]=1
channels["C"]=1
for (ch in channels) {
if (ch in position) {
info = sprintf("Position[%s]=%d\n",ch,position[ch])
if(!SILENCE) print(info)
print(info) >"result.txt"
}
}
for (i = 1;i <= n;i++) {
name = names[i]
s = to_sym[name]
if (max_time_h[s] > 0) {
info = sprintf("Time in %s max=%d us, total=%d us\n",name,max_time_h[s], sum_time_h[s])
if(!SILENCE) print(info)
print(info) >"result.txt"
}
}
}

View File

@@ -0,0 +1,38 @@
BEGIN {
ok = 1
timing = 0
if (DIR ~ /timing/) {
timing = 1
}
}
FNR == NR {
# result.txt
lines[FNR] = $0
}
FNR != NR {
# expect.txt
r = lines[FNR]
e = $0
r_test = r
e_test = e
if (timing == 0) {
gsub(/[0-9 ]*us/,"", r_test)
gsub(/[0-9 ]*us/,"", e_test)
}
if (e_test != r_test) {
print("result:",r)
print("expect:",e)
ok = 0
}
}
END {
if (ok == 1) {
print("PASS")
print("PASS") > ".tested"
}
}

View File

@@ -0,0 +1,22 @@
BEGIN {
ok = 0
}
FNR == NR {
# result.txt
lines[FNR] = $0
}
/^Position\[A\]/ {
print
}
$0 == "Position[A]=0" {
ok = 1
}
END {
if (ok == 1) {
print("PASS")
print("PASS") > ".tested"
}
}

View File

@@ -0,0 +1,26 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
[env:avr]
platform = atmelavr
board = nanoatmega328
framework = arduino
build_flags = -Werror -Wall -D SIM_TEST_INPUT='"t M1 03 I R W "' -DSIMAVR_FOC_WORKAROUND
lib_extra_dirs = ../../../../..
[env:atmega2560]
platform = atmelavr
board = megaatmega2560
framework = arduino
build_flags = -Werror -Wall
lib_extra_dirs = ../../../../..

View File

@@ -0,0 +1,26 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
[env:avr]
platform = atmelavr
board = nanoatmega328
framework = arduino
build_flags = -Werror -Wall -D SIM_TEST_INPUT='"t M1 04 I R W "' -DSIMAVR_FOC_WORKAROUND
lib_extra_dirs = ../../../../..
[env:atmega2560]
platform = atmelavr
board = megaatmega2560
framework = arduino
build_flags = -Werror -Wall
lib_extra_dirs = ../../../../..

View File

@@ -0,0 +1,26 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
[env:avr]
platform = atmelavr
board = nanoatmega328
framework = arduino
build_flags = -Werror -Wall -D SIM_TEST_INPUT='"t M1 05 I R W "' -DSIMAVR_FOC_WORKAROUND
lib_extra_dirs = ../../../../..
[env:atmega2560]
platform = atmelavr
board = megaatmega2560
framework = arduino
build_flags = -Werror -Wall
lib_extra_dirs = ../../../../..

View File

@@ -0,0 +1,30 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
# There should be only one env section for the DUT under test.
# One of
# atmega168p
# atmega328p
# atmega2560_timer1
# atmega2560_timer3
# atmega2560_timer4
# atmega2560_timer5
#
[common]
build_flags = -DTEST_TIMING
[env:atmega328p]
platform = atmelavr
board = nanoatmega328
framework = arduino
build_flags = -Werror -Wall -DSIMAVR_FOC_WORKAROUND ${common.build_flags}
lib_extra_dirs = ../../../../..

View File

@@ -0,0 +1,40 @@
#include <avr/sleep.h>
#include <AVRStepperPins.h>
#include <RampCalculator.h>
float acceleration_f;
uint32_t acceleration_i;
uint32_t steps;
void setup() {
Serial.begin(115200);
Serial.println("Start");
digitalWrite(stepPinStepperA, LOW);
digitalWrite(stepPinStepperB, LOW);
pinMode(stepPinStepperA, OUTPUT);
pinMode(stepPinStepperB, OUTPUT);
acceleration_f = 12345.0;
acceleration_i = 12345.0;
steps = 10;
}
void loop() {
digitalWrite(stepPinStepperA, HIGH);
uint32_t x;
// x = calculate_ticks_v1(steps, acceleration_f);
// x = calculate_ticks_v2(steps, acceleration_f);
// x = calculate_ticks_v3(steps, acceleration_f);
// x = calculate_ticks_v4(steps, acceleration_i);
// x = calculate_ticks_v5(steps, acceleration_i);
// x = calculate_ticks_v7(0x1234000, 1000);
x = calculate_ticks_v8(0x1234000, 1000);
digitalWrite(stepPinStepperA, LOW);
digitalWrite(stepPinStepperB, HIGH);
digitalWrite(stepPinStepperB, LOW);
Serial.println(x);
delay(100);
noInterrupts();
sleep_cpu();
}

View File

@@ -0,0 +1 @@
src/

View File

@@ -0,0 +1,131 @@
#
# In order to execute the test for one directory use:
#
# make -C test_sd_01b_328p -f ../Makefile.test
SRC=$(wildcard ../../../src/*) $(wildcard src/*)
# platformio should contain only one env section.
# This section states the dut name
# atmega168
# atmega168p
# atmega328
# atmega328p
# atmega2560_timer1
# atmega2560_timer3
# atmega2560_timer4
# atmega2560_timer5
#
DUT=$(shell gawk '/env:/{print(substr($$1,6,length($$1)-6))}' platformio.ini)
TRACES=-at StepISR=trace@0x25/0x08 # PB3
TRACES+=-at FillISR=trace@0x25/0x10 # PB4
#
ifeq ($(DUT),atmega2560_timer1)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x025/0x20 #OC1A PB5 11 ATMega2560
TRACES+=-at StepB=trace@0x025/0x40 #OC1B PB6 12 ATMega2560
TRACES+=-at StepC=trace@0x025/0x80 #OC1C PB7 13 ATMega2560
#
else ifeq ($(DUT),atmega2560_timer3)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x02e/0x08 #OC3A PE3 5 ATMega2560
TRACES+=-at StepB=trace@0x02e/0x10 #OC3B PE4 2 ATMega2560
TRACES+=-at StepC=trace@0x02e/0x20 #OC3C PE5 3 ATMega2560
#
else ifeq ($(DUT),atmega2560_timer4)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x102/0x08 #OC4A PH3 6 ATMega2560
TRACES+=-at StepB=trace@0x102/0x10 #OC4B PH4 7 ATMega2560
TRACES+=-at StepC=trace@0x102/0x20 #OC4C PH5 8 ATMega2560
#
else ifeq ($(DUT),atmega2560_timer5)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x10b/0x08 #OC5A PL3 46 ATMega2560
TRACES+=-at StepB=trace@0x10b/0x10 #OC5B PL4 45 ATMega2560
TRACES+=-at StepC=trace@0x10b/0x20 #OC5C PL5 44 ATMega2560
else ifeq ($(DUT),atmega168)
DEVICE=atmega168
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 ATMega168
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 ATMega168
else ifeq ($(DUT),atmega168p)
DEVICE=atmega168p
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 ATMega168p
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 ATMega168p
else ifeq ($(DUT),atmega328)
DEVICE=atmega328
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 ATMega328
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 ATMega328
else ifeq ($(DUT),atmega328p)
DEVICE=atmega328p
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 ATMega328p
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 ATMega328p
else ifeq ($(DUT),atmega32u4)
DEVICE=atmega32u4
TRACES+=-at StepA=trace@0x025/0x20 #OC1A PB5 11
TRACES+=-at StepB=trace@0x025/0x40 #OC1B PB6 12
#TRACES+=-at StepC=trace@0x025/0x80 #OC1C PB7 13
endif
ifeq ($(DEVICE),atmega2560)
TRACES+=-at DirA=trace@0x2b/0x01 # Pin 21 PD0
TRACES+=-at DirB=trace@0x2b/0x02 # Pin 20 PD1
TRACES+=-at DirC=trace@0x10b/0x80 # Pin 42 PL7
TRACES+=-at EnableA=trace@0x2b/0x04 # Pin 19 PD2
TRACES+=-at EnableB=trace@0x2b/0x08 # Pin 18 PD3
TRACES+=-at EnableC=trace@0x10b/0x40 # Pin 43 PL6
else ifeq ($(DEVICE),$(filter $(DEVICE),atmega168 atmega168p atmega328 atmega328p))
TRACES+=-at DirA=trace@0x2b/0x20 # Pin 5 PD5
TRACES+=-at DirB=trace@0x2b/0x80 # Pin 7 PD7
TRACES+=-at EnableA=trace@0x2b/0x40 # Pin 6 PD6
TRACES+=-at EnableB=trace@0x25/0x01 # Pin 8 PB0
else ifeq ($(DUT),atmega32u4)
TRACES+=-at DirA=trace@0x25/0x10 # Pin 26 PB4
TRACES+=-at DirB=trace@0x25/0x08 # Pin 14 PB3
#TRACES+=-at DirC=trace@0x10b/0x80 # Pin 42 PL7
TRACES+=-at EnableA=trace@0x25/0x04 # Pin 16 PB2
TRACES+=-at EnableB=trace@0x25/0x02 # Pin 15 PB1
#TRACES+=-at EnableC=trace@0x10b/0x40 # Pin 43 PL6
endif
FIRMWARE=".pio/build/$(DUT)/firmware.elf"
DIR=$(shell env pwd)
ifndef SILENCE
SILENCE=0
endif
test: .tested
.tested: result.txt expect.txt ../judge.awk
echo DUT=$(DUT)
rm -f .tested
gawk -f ../judge.awk -v DIR=$(DIR) result.txt expect.txt
test -f .tested
result.txt: x.vcd
gawk -v SILENCE=$(SILENCE) -f ../eval.awk x.vcd
cat expect.txt
x.vcd: $(SRC) ../run_avr platformio.ini src/ExternalCall.ino
~/.platformio/penv/bin/pio run -e $(DUT) || ~/.local/bin/pio run -e $(DUT) || env pio run -e $(DUT)
../run_avr $(FIRMWARE) -m $(DEVICE) -o x.vcd $(TRACES)
src/ExternalCall.ino:
mkdir -p src
cd src; ln -s ../../../../../examples/ExternalCall/ExternalCall.ino .
clean:
rm -fR .pio .tested x.vcd result.txt

View File

@@ -0,0 +1,22 @@
DirA: 3*L->H, 2*H->L
DirB: 3*L->H, 2*H->L
EnableA: 2*L->H, 1*H->L
EnableB: 2*L->H, 1*H->L
StepA: 2890*L->H, 2890*H->L, Max High=9us Total High=13574us
StepB: 2890*L->H, 2890*H->L, Max High=9us Total High=13454us
Position[A]=190
Position[B]=190
Time in DirA max=10063958 us, total=15122519 us
Time in DirB max=39260160 us, total=44318721 us
Time in EnableA max=4162 us, total=4162 us
Time in EnableB max=29200356 us, total=29200356 us
Time in StepA max=9 us, total=13574 us
Time in StepB max=9 us, total=13454 us

View File

@@ -0,0 +1,31 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
# There should be only one env section for the DUT under test.
# One of
# atmega168p
# atmega328p
# atmega2560_timer1
# atmega2560_timer3
# atmega2560_timer4
# atmega2560_timer5
#
[common]
# This is the line input to StepperDemo:
build_flags = -D SIMULATOR
[env:atmega328p]
platform = atmelavr
board = nanoatmega328
framework = arduino
build_flags = -Werror -Wall ${common.build_flags}
lib_extra_dirs = ../../../../..

View File

@@ -0,0 +1 @@
src/

View File

@@ -0,0 +1,132 @@
#
# In order to execute the test for one directory use:
#
# make -C test_sd_01b_328p -f ../Makefile.test
SRC=$(wildcard ../../../src/*) $(wildcard src/*)
# platformio should contain only one env section.
# This section states the dut name
# atmega168
# atmega168p
# atmega328
# atmega328p
# atmega2560_timer1
# atmega2560_timer3
# atmega2560_timer4
# atmega2560_timer5
#
DUT=$(shell gawk '/env:/{print(substr($$1,6,length($$1)-6))}' platformio.ini)
TRACES=-at StepISR=trace@0x25/0x08 # PB3
TRACES+=-at FillISR=trace@0x25/0x10 # PB4
#
ifeq ($(DUT),atmega2560_timer1)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x025/0x20 #OC1A PB5 11 ATMega2560
TRACES+=-at StepB=trace@0x025/0x40 #OC1B PB6 12 ATMega2560
TRACES+=-at StepC=trace@0x025/0x80 #OC1C PB7 13 ATMega2560
#
else ifeq ($(DUT),atmega2560_timer3)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x02e/0x08 #OC3A PE3 5 ATMega2560
TRACES+=-at StepB=trace@0x02e/0x10 #OC3B PE4 2 ATMega2560
TRACES+=-at StepC=trace@0x02e/0x20 #OC3C PE5 3 ATMega2560
#
else ifeq ($(DUT),atmega2560_timer4)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x102/0x08 #OC4A PH3 6 ATMega2560
TRACES+=-at StepB=trace@0x102/0x10 #OC4B PH4 7 ATMega2560
TRACES+=-at StepC=trace@0x102/0x20 #OC4C PH5 8 ATMega2560
#
else ifeq ($(DUT),atmega2560_timer5)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x10b/0x08 #OC5A PL3 46 ATMega2560
TRACES+=-at StepB=trace@0x10b/0x10 #OC5B PL4 45 ATMega2560
TRACES+=-at StepC=trace@0x10b/0x20 #OC5C PL5 44 ATMega2560
else ifeq ($(DUT),atmega168)
DEVICE=atmega168
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 atmega168
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 atmega168
else ifeq ($(DUT),atmega168p)
DEVICE=atmega168p
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 atmega168p
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 atmega168p
else ifeq ($(DUT),atmega328)
DEVICE=atmega328
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 ATMega328
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 ATMega328
else ifeq ($(DUT),atmega328p)
DEVICE=atmega328p
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 ATMega328p
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 ATMega328p
else ifeq ($(DUT),atmega32u4)
DEVICE=atmega32u4
TRACES+=-at StepA=trace@0x025/0x20 #OC1A PB5 11
TRACES+=-at StepB=trace@0x025/0x40 #OC1B PB6 12
#TRACES+=-at StepC=trace@0x025/0x80 #OC1C PB7 13
endif
ifeq ($(DEVICE),atmega2560)
TRACES+=-at DirA=trace@0x2b/0x01 # Pin 21 PD0
TRACES+=-at DirB=trace@0x2b/0x02 # Pin 20 PD1
TRACES+=-at DirC=trace@0x10b/0x80 # Pin 42 PL7
TRACES+=-at EnableA=trace@0x2b/0x04 # Pin 19 PD2
TRACES+=-at EnableB=trace@0x2b/0x08 # Pin 18 PD3
TRACES+=-at EnableC=trace@0x10b/0x40 # Pin 43 PL6
else ifeq ($(DEVICE),$(filter $(DEVICE),atmega168 atmega168p atmega328 atmega328p))
TRACES+=-at DirA=trace@0x2b/0x20 # Pin 5 PD5
TRACES+=-at DirB=trace@0x2b/0x80 # Pin 7 PD7
TRACES+=-at EnableA=trace@0x2b/0x40 # Pin 6 PD6
TRACES+=-at EnableB=trace@0x25/0x01 # Pin 8 PB0
else ifeq ($(DUT),atmega32u4)
TRACES+=-at DirA=trace@0x25/0x10 # Pin 26 PB4
TRACES+=-at DirB=trace@0x25/0x08 # Pin 14 PB3
#TRACES+=-at DirC=trace@0x10b/0x80 # Pin 42 PL7
TRACES+=-at EnableA=trace@0x25/0x04 # Pin 16 PB2
TRACES+=-at EnableB=trace@0x25/0x02 # Pin 15 PB1
#TRACES+=-at EnableC=trace@0x10b/0x40 # Pin 43 PL6
endif
FIRMWARE=".pio/build/$(DUT)/firmware.elf"
DIR=$(shell env pwd)
ifndef SILENCE
SILENCE=0
endif
test: .tested
.tested: result.txt expect.txt ../judge.awk
echo DUT=$(DUT)
rm -f .tested
gawk -f ../judge.awk -v DIR=$(DIR) result.txt expect.txt
test -f .tested
result.txt: x.vcd
gawk -v SILENCE=$(SILENCE) -f ../eval.awk x.vcd >/dev/null
cat expect.txt
x.vcd: $(SRC) ../run_avr platformio.ini src/Issue150.ino
~/.platformio/penv/bin/pio run -e $(DUT) || ~/.local/bin/pio run -e $(DUT) || env pio run -e $(DUT)
../run_avr $(FIRMWARE) -m $(DEVICE) -o x.vcd $(TRACES)
src/Issue150.ino:
mkdir -p src
cd src; ln -s ../../../../../examples/Issue150/Issue150.ino .
clean:
rm -fR .pio .tested x.vcd result.txt

View File

@@ -0,0 +1,16 @@
DirA: 0*L->H, 0*H->L
DirB: 1*L->H, 0*H->L
EnableA: 2*L->H, 1*H->L
EnableB: 0*L->H, 0*H->L
StepA: 4000*L->H, 4000*H->L, Max High=10us Total High=20775us
StepB: 2*L->H, 2*H->L, Max High=4us Total High=9us
Position[A]=4000
Position[B]=2
Time in EnableA max=4194 us, total=4194 us
Time in StepA max=10 us, total=20775 us
Time in StepB max=4 us, total=9 us

View File

@@ -0,0 +1,31 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
# There should be only one env section for the DUT under test.
# One of
# atmega168p
# atmega328p
# atmega2560_timer1
# atmega2560_timer3
# atmega2560_timer4
# atmega2560_timer5
#
[common]
# This is the line input to StepperDemo:
build_flags = -D SIMULATOR
[env:atmega328p]
platform = atmelavr
board = nanoatmega328
framework = arduino
build_flags = -Werror -Wall ${common.build_flags}
lib_extra_dirs = ../../../../..

View File

@@ -0,0 +1 @@
src/

View File

@@ -0,0 +1,132 @@
#
# In order to execute the test for one directory use:
#
# make -C test_sd_01b_328p -f ../Makefile.test
SRC=$(wildcard ../../../src/*) $(wildcard src/*)
# platformio should contain only one env section.
# This section states the dut name
# atmega168
# atmega168p
# atmega328
# atmega328p
# atmega2560_timer1
# atmega2560_timer3
# atmega2560_timer4
# atmega2560_timer5
#
DUT=$(shell gawk '/env:/{print(substr($$1,6,length($$1)-6))}' platformio.ini)
TRACES=-at StepISR=trace@0x25/0x08 # PB3
TRACES+=-at FillISR=trace@0x25/0x10 # PB4
#
ifeq ($(DUT),atmega2560_timer1)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x025/0x20 #OC1A PB5 11 ATMega2560
TRACES+=-at StepB=trace@0x025/0x40 #OC1B PB6 12 ATMega2560
TRACES+=-at StepC=trace@0x025/0x80 #OC1C PB7 13 ATMega2560
#
else ifeq ($(DUT),atmega2560_timer3)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x02e/0x08 #OC3A PE3 5 ATMega2560
TRACES+=-at StepB=trace@0x02e/0x10 #OC3B PE4 2 ATMega2560
TRACES+=-at StepC=trace@0x02e/0x20 #OC3C PE5 3 ATMega2560
#
else ifeq ($(DUT),atmega2560_timer4)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x102/0x08 #OC4A PH3 6 ATMega2560
TRACES+=-at StepB=trace@0x102/0x10 #OC4B PH4 7 ATMega2560
TRACES+=-at StepC=trace@0x102/0x20 #OC4C PH5 8 ATMega2560
#
else ifeq ($(DUT),atmega2560_timer5)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x10b/0x08 #OC5A PL3 46 ATMega2560
TRACES+=-at StepB=trace@0x10b/0x10 #OC5B PL4 45 ATMega2560
TRACES+=-at StepC=trace@0x10b/0x20 #OC5C PL5 44 ATMega2560
else ifeq ($(DUT),atmega168)
DEVICE=atmega168
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 atmega168
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 atmega168
else ifeq ($(DUT),atmega168p)
DEVICE=atmega168p
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 atmega168p
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 atmega168p
else ifeq ($(DUT),atmega328)
DEVICE=atmega328
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 ATMega328
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 ATMega328
else ifeq ($(DUT),atmega328p)
DEVICE=atmega328p
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 ATMega328p
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 ATMega328p
else ifeq ($(DUT),atmega32u4)
DEVICE=atmega32u4
TRACES+=-at StepA=trace@0x025/0x20 #OC1A PB5 11
TRACES+=-at StepB=trace@0x025/0x40 #OC1B PB6 12
#TRACES+=-at StepC=trace@0x025/0x80 #OC1C PB7 13
endif
ifeq ($(DEVICE),atmega2560)
TRACES+=-at DirA=trace@0x2b/0x01 # Pin 21 PD0
TRACES+=-at DirB=trace@0x2b/0x02 # Pin 20 PD1
TRACES+=-at DirC=trace@0x10b/0x80 # Pin 42 PL7
TRACES+=-at EnableA=trace@0x2b/0x04 # Pin 19 PD2
TRACES+=-at EnableB=trace@0x2b/0x08 # Pin 18 PD3
TRACES+=-at EnableC=trace@0x10b/0x40 # Pin 43 PL6
else ifeq ($(DEVICE),$(filter $(DEVICE),atmega168 atmega168p atmega328 atmega328p))
TRACES+=-at DirA=trace@0x2b/0x20 # Pin 5 PD5
TRACES+=-at DirB=trace@0x2b/0x80 # Pin 7 PD7
TRACES+=-at EnableA=trace@0x2b/0x40 # Pin 6 PD6
TRACES+=-at EnableB=trace@0x25/0x01 # Pin 8 PB0
else ifeq ($(DUT),atmega32u4)
TRACES+=-at DirA=trace@0x25/0x10 # Pin 26 PB4
TRACES+=-at DirB=trace@0x25/0x08 # Pin 14 PB3
#TRACES+=-at DirC=trace@0x10b/0x80 # Pin 42 PL7
TRACES+=-at EnableA=trace@0x25/0x04 # Pin 16 PB2
TRACES+=-at EnableB=trace@0x25/0x02 # Pin 15 PB1
#TRACES+=-at EnableC=trace@0x10b/0x40 # Pin 43 PL6
endif
FIRMWARE=".pio/build/$(DUT)/firmware.elf"
DIR=$(shell env pwd)
ifndef SILENCE
SILENCE=0
endif
test: .tested
.tested: result.txt expect.txt ../judge.awk
echo DUT=$(DUT)
rm -f .tested
gawk -f ../judge.awk -v DIR=$(DIR) result.txt expect.txt
test -f .tested
result.txt: x.vcd
gawk -v SILENCE=$(SILENCE) -f ../eval.awk x.vcd >/dev/null
cat expect.txt
x.vcd: $(SRC) ../run_avr platformio.ini src/Issue151.ino
~/.platformio/penv/bin/pio run -e $(DUT) || ~/.local/bin/pio run -e $(DUT) || env pio run -e $(DUT)
../run_avr $(FIRMWARE) -m $(DEVICE) -o x.vcd $(TRACES)
src/Issue151.ino:
mkdir -p src
cd src; ln -s ../../../../../examples/Issue151/Issue151.ino .
clean:
rm -fR .pio .tested x.vcd result.txt

View File

@@ -0,0 +1,16 @@
DirA: 0*L->H, 0*H->L
DirB: 1*L->H, 0*H->L
EnableA: 2*L->H, 1*H->L
EnableB: 0*L->H, 0*H->L
StepA: 20000*L->H, 20000*H->L, Max High=10us Total High=101913us
StepB: 2*L->H, 2*H->L, Max High=4us Total High=9us
Position[A]=20000
Position[B]=2
Time in EnableA max=4203 us, total=4203 us
Time in StepA max=10 us, total=101913 us
Time in StepB max=4 us, total=9 us

View File

@@ -0,0 +1,31 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
# There should be only one env section for the DUT under test.
# One of
# atmega168p
# atmega328p
# atmega2560_timer1
# atmega2560_timer3
# atmega2560_timer4
# atmega2560_timer5
#
[common]
# This is the line input to StepperDemo:
build_flags = -D SIMULATOR
[env:atmega328p]
platform = atmelavr
board = nanoatmega328
framework = arduino
build_flags = -Werror -Wall ${common.build_flags}
lib_extra_dirs = ../../../../..

View File

@@ -0,0 +1 @@
src/

View File

@@ -0,0 +1,132 @@
#
# In order to execute the test for one directory use:
#
# make -C test_sd_01b_328p -f ../Makefile.test
SRC=$(wildcard ../../../src/*) $(wildcard src/*)
# platformio should contain only one env section.
# This section states the dut name
# atmega168
# atmega168p
# atmega328
# atmega328p
# atmega2560_timer1
# atmega2560_timer3
# atmega2560_timer4
# atmega2560_timer5
#
DUT=$(shell gawk '/env:/{print(substr($$1,6,length($$1)-6))}' platformio.ini)
TRACES=-at StepISR=trace@0x25/0x08 # PB3
TRACES+=-at FillISR=trace@0x25/0x10 # PB4
#
ifeq ($(DUT),atmega2560_timer1)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x025/0x20 #OC1A PB5 11 ATMega2560
TRACES+=-at StepB=trace@0x025/0x40 #OC1B PB6 12 ATMega2560
TRACES+=-at StepC=trace@0x025/0x80 #OC1C PB7 13 ATMega2560
#
else ifeq ($(DUT),atmega2560_timer3)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x02e/0x08 #OC3A PE3 5 ATMega2560
TRACES+=-at StepB=trace@0x02e/0x10 #OC3B PE4 2 ATMega2560
TRACES+=-at StepC=trace@0x02e/0x20 #OC3C PE5 3 ATMega2560
#
else ifeq ($(DUT),atmega2560_timer4)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x102/0x08 #OC4A PH3 6 ATMega2560
TRACES+=-at StepB=trace@0x102/0x10 #OC4B PH4 7 ATMega2560
TRACES+=-at StepC=trace@0x102/0x20 #OC4C PH5 8 ATMega2560
#
else ifeq ($(DUT),atmega2560_timer5)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x10b/0x08 #OC5A PL3 46 ATMega2560
TRACES+=-at StepB=trace@0x10b/0x10 #OC5B PL4 45 ATMega2560
TRACES+=-at StepC=trace@0x10b/0x20 #OC5C PL5 44 ATMega2560
else ifeq ($(DUT),atmega168)
DEVICE=atmega168
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 atmega168
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 atmega168
else ifeq ($(DUT),atmega168p)
DEVICE=atmega168p
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 atmega168p
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 atmega168p
else ifeq ($(DUT),atmega328)
DEVICE=atmega328
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 ATMega328
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 ATMega328
else ifeq ($(DUT),atmega328p)
DEVICE=atmega328p
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 ATMega328p
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 ATMega328p
else ifeq ($(DUT),atmega32u4)
DEVICE=atmega32u4
TRACES+=-at StepA=trace@0x025/0x20 #OC1A PB5 11
TRACES+=-at StepB=trace@0x025/0x40 #OC1B PB6 12
#TRACES+=-at StepC=trace@0x025/0x80 #OC1C PB7 13
endif
ifeq ($(DEVICE),atmega2560)
TRACES+=-at DirA=trace@0x2b/0x01 # Pin 21 PD0
TRACES+=-at DirB=trace@0x2b/0x02 # Pin 20 PD1
TRACES+=-at DirC=trace@0x10b/0x80 # Pin 42 PL7
TRACES+=-at EnableA=trace@0x2b/0x04 # Pin 19 PD2
TRACES+=-at EnableB=trace@0x2b/0x08 # Pin 18 PD3
TRACES+=-at EnableC=trace@0x10b/0x40 # Pin 43 PL6
else ifeq ($(DEVICE),$(filter $(DEVICE),atmega168 atmega168p atmega328 atmega328p))
TRACES+=-at DirA=trace@0x2b/0x20 # Pin 5 PD5
TRACES+=-at DirB=trace@0x2b/0x80 # Pin 7 PD7
TRACES+=-at EnableA=trace@0x2b/0x40 # Pin 6 PD6
TRACES+=-at EnableB=trace@0x25/0x01 # Pin 8 PB0
else ifeq ($(DUT),atmega32u4)
TRACES+=-at DirA=trace@0x25/0x10 # Pin 26 PB4
TRACES+=-at DirB=trace@0x25/0x08 # Pin 14 PB3
#TRACES+=-at DirC=trace@0x10b/0x80 # Pin 42 PL7
TRACES+=-at EnableA=trace@0x25/0x04 # Pin 16 PB2
TRACES+=-at EnableB=trace@0x25/0x02 # Pin 15 PB1
#TRACES+=-at EnableC=trace@0x10b/0x40 # Pin 43 PL6
endif
FIRMWARE=".pio/build/$(DUT)/firmware.elf"
DIR=$(shell env pwd)
ifndef SILENCE
SILENCE=0
endif
test: .tested
.tested: result.txt expect.txt ../judge.awk
echo DUT=$(DUT)
rm -f .tested
gawk -f ../judge.awk -v DIR=$(DIR) result.txt expect.txt
test -f .tested
result.txt: x.vcd
gawk -v SILENCE=$(SILENCE) -f ../eval.awk x.vcd >/dev/null
cat expect.txt
x.vcd: $(SRC) ../run_avr platformio.ini src/Issue152.ino
~/.platformio/penv/bin/pio run -e $(DUT) || ~/.local/bin/pio run -e $(DUT) || env pio run -e $(DUT)
../run_avr $(FIRMWARE) -m $(DEVICE) -o x.vcd $(TRACES)
src/Issue152.ino:
mkdir -p src
cd src; ln -s ../../../../../examples/Issue152/Issue152.ino .
clean:
rm -fR .pio .tested x.vcd result.txt

View File

@@ -0,0 +1,20 @@
DirA: 0*L->H, 0*H->L
DirB: 1*L->H, 0*H->L
EnableA: 2*L->H, 1*H->L
EnableB: 0*L->H, 0*H->L
StepA: 20000*L->H, 20000*H->L, Max High=10us Total High=104644us
StepB: 2*L->H, 2*H->L, Max High=4us Total High=9us
Position[A]=20000
Position[B]=2
Time in EnableA max=4199 us, total=4199 us
Time in FillISR max=1848 us, total=59230 us
Time in StepA max=10 us, total=104644 us
Time in StepB max=4 us, total=9 us
Time in StepISR max=7 us, total=85706 us

View File

@@ -0,0 +1,31 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
# There should be only one env section for the DUT under test.
# One of
# atmega168p
# atmega328p
# atmega2560_timer1
# atmega2560_timer3
# atmega2560_timer4
# atmega2560_timer5
#
[common]
# This is the line input to StepperDemo:
build_flags = -D SIMULATOR -D SIMAVR_TIME_MEASUREMENT
[env:atmega328p]
platform = atmelavr
board = nanoatmega328
framework = arduino
build_flags = -Werror -Wall ${common.build_flags}
lib_extra_dirs = ../../../../..

View File

@@ -0,0 +1 @@
src/

View File

@@ -0,0 +1,132 @@
#
# In order to execute the test for one directory use:
#
# make -C test_sd_01b_328p -f ../Makefile.test
SRC=$(wildcard ../../../src/*) $(wildcard src/*)
# platformio should contain only one env section.
# This section states the dut name
# atmega168
# atmega168p
# atmega328
# atmega328p
# atmega2560_timer1
# atmega2560_timer3
# atmega2560_timer4
# atmega2560_timer5
#
DUT=$(shell gawk '/env:/{print(substr($$1,6,length($$1)-6))}' platformio.ini)
TRACES=-at StepISR=trace@0x25/0x08 # PB3
TRACES+=-at FillISR=trace@0x25/0x10 # PB4
#
ifeq ($(DUT),atmega2560_timer1)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x025/0x20 #OC1A PB5 11 ATMega2560
TRACES+=-at StepB=trace@0x025/0x40 #OC1B PB6 12 ATMega2560
TRACES+=-at StepC=trace@0x025/0x80 #OC1C PB7 13 ATMega2560
#
else ifeq ($(DUT),atmega2560_timer3)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x02e/0x08 #OC3A PE3 5 ATMega2560
TRACES+=-at StepB=trace@0x02e/0x10 #OC3B PE4 2 ATMega2560
TRACES+=-at StepC=trace@0x02e/0x20 #OC3C PE5 3 ATMega2560
#
else ifeq ($(DUT),atmega2560_timer4)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x102/0x08 #OC4A PH3 6 ATMega2560
TRACES+=-at StepB=trace@0x102/0x10 #OC4B PH4 7 ATMega2560
TRACES+=-at StepC=trace@0x102/0x20 #OC4C PH5 8 ATMega2560
#
else ifeq ($(DUT),atmega2560_timer5)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x10b/0x08 #OC5A PL3 46 ATMega2560
TRACES+=-at StepB=trace@0x10b/0x10 #OC5B PL4 45 ATMega2560
TRACES+=-at StepC=trace@0x10b/0x20 #OC5C PL5 44 ATMega2560
else ifeq ($(DUT),atmega168)
DEVICE=atmega168
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 atmega168
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 atmega168
else ifeq ($(DUT),atmega168p)
DEVICE=atmega168p
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 atmega168p
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 atmega168p
else ifeq ($(DUT),atmega328)
DEVICE=atmega328
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 ATMega328
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 ATMega328
else ifeq ($(DUT),atmega328p)
DEVICE=atmega328p
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 ATMega328p
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 ATMega328p
else ifeq ($(DUT),atmega32u4)
DEVICE=atmega32u4
TRACES+=-at StepA=trace@0x025/0x20 #OC1A PB5 11
TRACES+=-at StepB=trace@0x025/0x40 #OC1B PB6 12
#TRACES+=-at StepC=trace@0x025/0x80 #OC1C PB7 13
endif
ifeq ($(DEVICE),atmega2560)
TRACES+=-at DirA=trace@0x2b/0x01 # Pin 21 PD0
TRACES+=-at DirB=trace@0x2b/0x02 # Pin 20 PD1
TRACES+=-at DirC=trace@0x10b/0x80 # Pin 42 PL7
TRACES+=-at EnableA=trace@0x2b/0x04 # Pin 19 PD2
TRACES+=-at EnableB=trace@0x2b/0x08 # Pin 18 PD3
TRACES+=-at EnableC=trace@0x10b/0x40 # Pin 43 PL6
else ifeq ($(DEVICE),$(filter $(DEVICE),atmega168 atmega168p atmega328 atmega328p))
TRACES+=-at DirA=trace@0x2b/0x20 # Pin 5 PD5
TRACES+=-at DirB=trace@0x2b/0x80 # Pin 7 PD7
TRACES+=-at EnableA=trace@0x2b/0x40 # Pin 6 PD6
TRACES+=-at EnableB=trace@0x25/0x01 # Pin 8 PB0
else ifeq ($(DUT),atmega32u4)
TRACES+=-at DirA=trace@0x25/0x10 # Pin 26 PB4
TRACES+=-at DirB=trace@0x25/0x08 # Pin 14 PB3
#TRACES+=-at DirC=trace@0x10b/0x80 # Pin 42 PL7
TRACES+=-at EnableA=trace@0x25/0x04 # Pin 16 PB2
TRACES+=-at EnableB=trace@0x25/0x02 # Pin 15 PB1
#TRACES+=-at EnableC=trace@0x10b/0x40 # Pin 43 PL6
endif
FIRMWARE=".pio/build/$(DUT)/firmware.elf"
DIR=$(shell env pwd)
ifndef SILENCE
SILENCE=0
endif
test: .tested
.tested: result.txt expect.txt ../judge.awk
echo DUT=$(DUT)
rm -f .tested
gawk -f ../judge.awk -v DIR=$(DIR) result.txt expect.txt
test -f .tested
result.txt: x.vcd
gawk -v SILENCE=$(SILENCE) -f ../eval.awk x.vcd >/dev/null
cat expect.txt
x.vcd: $(SRC) ../run_avr platformio.ini src/Issue172.ino
~/.platformio/penv/bin/pio run -e $(DUT) || ~/.local/bin/pio run -e $(DUT) || env pio run -e $(DUT)
../run_avr $(FIRMWARE) -m $(DEVICE) -o x.vcd $(TRACES)
src/Issue172.ino:
mkdir -p src
cd src; ln -s ../../../../../examples/Issue172/Issue172.ino .
clean:
rm -fR .pio .tested x.vcd result.txt

View File

@@ -0,0 +1,20 @@
DirA: 0*L->H, 1*H->L
DirB: 1*L->H, 0*H->L
EnableA: 2*L->H, 1*H->L
EnableB: 0*L->H, 0*H->L
StepA: 2060*L->H, 2060*H->L, Max High=9us Total High=8067us
StepB: 2*L->H, 2*H->L, Max High=4us Total High=9us
Position[A]=0
Position[B]=2
Time in EnableA max=4204 us, total=4204 us
Time in FillISR max=1737 us, total=39497 us
Time in StepA max=9 us, total=8067 us
Time in StepB max=4 us, total=9 us
Time in StepISR max=6 us, total=8184 us

View File

@@ -0,0 +1,31 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
# There should be only one env section for the DUT under test.
# One of
# atmega168p
# atmega328p
# atmega2560_timer1
# atmega2560_timer3
# atmega2560_timer4
# atmega2560_timer5
#
[common]
# This is the line input to StepperDemo:
build_flags = -D SIMULATOR -D SIMAVR_TIME_MEASUREMENT
[env:atmega328p]
platform = atmelavr
board = nanoatmega328
framework = arduino
build_flags = -Werror -Wall ${common.build_flags}
lib_extra_dirs = ../../../../..

View File

@@ -0,0 +1 @@
src/

View File

@@ -0,0 +1,132 @@
#
# In order to execute the test for one directory use:
#
# make -C test_sd_01b_328p -f ../Makefile.test
SRC=$(wildcard ../../../src/*) $(wildcard src/*)
# platformio should contain only one env section.
# This section states the dut name
# atmega168
# atmega168p
# atmega328
# atmega328p
# atmega2560_timer1
# atmega2560_timer3
# atmega2560_timer4
# atmega2560_timer5
#
DUT=$(shell gawk '/env:/{print(substr($$1,6,length($$1)-6))}' platformio.ini)
TRACES=-at StepISR=trace@0x25/0x08 # PB3
TRACES+=-at FillISR=trace@0x25/0x10 # PB4
#
ifeq ($(DUT),atmega2560_timer1)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x025/0x20 #OC1A PB5 11 ATMega2560
TRACES+=-at StepB=trace@0x025/0x40 #OC1B PB6 12 ATMega2560
TRACES+=-at StepC=trace@0x025/0x80 #OC1C PB7 13 ATMega2560
#
else ifeq ($(DUT),atmega2560_timer3)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x02e/0x08 #OC3A PE3 5 ATMega2560
TRACES+=-at StepB=trace@0x02e/0x10 #OC3B PE4 2 ATMega2560
TRACES+=-at StepC=trace@0x02e/0x20 #OC3C PE5 3 ATMega2560
#
else ifeq ($(DUT),atmega2560_timer4)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x102/0x08 #OC4A PH3 6 ATMega2560
TRACES+=-at StepB=trace@0x102/0x10 #OC4B PH4 7 ATMega2560
TRACES+=-at StepC=trace@0x102/0x20 #OC4C PH5 8 ATMega2560
#
else ifeq ($(DUT),atmega2560_timer5)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x10b/0x08 #OC5A PL3 46 ATMega2560
TRACES+=-at StepB=trace@0x10b/0x10 #OC5B PL4 45 ATMega2560
TRACES+=-at StepC=trace@0x10b/0x20 #OC5C PL5 44 ATMega2560
else ifeq ($(DUT),atmega168)
DEVICE=atmega168
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 atmega168
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 atmega168
else ifeq ($(DUT),atmega168p)
DEVICE=atmega168p
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 atmega168p
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 atmega168p
else ifeq ($(DUT),atmega328)
DEVICE=atmega328
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 ATMega328
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 ATMega328
else ifeq ($(DUT),atmega328p)
DEVICE=atmega328p
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 ATMega328p
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 ATMega328p
else ifeq ($(DUT),atmega32u4)
DEVICE=atmega32u4
TRACES+=-at StepA=trace@0x025/0x20 #OC1A PB5 11
TRACES+=-at StepB=trace@0x025/0x40 #OC1B PB6 12
#TRACES+=-at StepC=trace@0x025/0x80 #OC1C PB7 13
endif
ifeq ($(DEVICE),atmega2560)
TRACES+=-at DirA=trace@0x2b/0x01 # Pin 21 PD0
TRACES+=-at DirB=trace@0x2b/0x02 # Pin 20 PD1
TRACES+=-at DirC=trace@0x10b/0x80 # Pin 42 PL7
TRACES+=-at EnableA=trace@0x2b/0x04 # Pin 19 PD2
TRACES+=-at EnableB=trace@0x2b/0x08 # Pin 18 PD3
TRACES+=-at EnableC=trace@0x10b/0x40 # Pin 43 PL6
else ifeq ($(DEVICE),$(filter $(DEVICE),atmega168 atmega168p atmega328 atmega328p))
TRACES+=-at DirA=trace@0x2b/0x20 # Pin 5 PD5
TRACES+=-at DirB=trace@0x2b/0x80 # Pin 7 PD7
TRACES+=-at EnableA=trace@0x2b/0x40 # Pin 6 PD6
TRACES+=-at EnableB=trace@0x25/0x01 # Pin 8 PB0
else ifeq ($(DUT),atmega32u4)
TRACES+=-at DirA=trace@0x25/0x10 # Pin 26 PB4
TRACES+=-at DirB=trace@0x25/0x08 # Pin 14 PB3
#TRACES+=-at DirC=trace@0x10b/0x80 # Pin 42 PL7
TRACES+=-at EnableA=trace@0x25/0x04 # Pin 16 PB2
TRACES+=-at EnableB=trace@0x25/0x02 # Pin 15 PB1
#TRACES+=-at EnableC=trace@0x10b/0x40 # Pin 43 PL6
endif
FIRMWARE=".pio/build/$(DUT)/firmware.elf"
DIR=$(shell env pwd)
ifndef SILENCE
SILENCE=0
endif
test: .tested
.tested: result.txt expect.txt ../judge.awk
echo DUT=$(DUT)
rm -f .tested
gawk -f ../judge.awk -v DIR=$(DIR) result.txt expect.txt
test -f .tested
result.txt: x.vcd
gawk -v SILENCE=$(SILENCE) -f ../eval.awk x.vcd >/dev/null
cat expect.txt
x.vcd: $(SRC) ../run_avr platformio.ini src/Issue173.ino
~/.platformio/penv/bin/pio run -e $(DUT) || ~/.local/bin/pio run -e $(DUT) || env pio run -e $(DUT)
../run_avr $(FIRMWARE) -m $(DEVICE) -o x.vcd $(TRACES)
src/Issue173.ino:
mkdir -p src
cd src; ln -s ../../../../../examples/Issue173/Issue173.ino .
clean:
rm -fR .pio .tested x.vcd result.txt

View File

@@ -0,0 +1,20 @@
DirA: 0*L->H, 1*H->L
DirB: 1*L->H, 0*H->L
EnableA: 3*L->H, 2*H->L
EnableB: 0*L->H, 0*H->L
StepA: 1050*L->H, 1050*H->L, Max High=9us Total High=4119us
StepB: 2*L->H, 2*H->L, Max High=4us Total High=9us
Position[A]=0
Position[B]=2
Time in EnableA max=4204 us, total=8409 us
Time in FillISR max=1917 us, total=25558 us
Time in StepA max=9 us, total=4119 us
Time in StepB max=4 us, total=9 us
Time in StepISR max=5 us, total=4224 us

View File

@@ -0,0 +1,31 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
# There should be only one env section for the DUT under test.
# One of
# atmega168p
# atmega328p
# atmega2560_timer1
# atmega2560_timer3
# atmega2560_timer4
# atmega2560_timer5
#
[common]
# This is the line input to StepperDemo:
build_flags = -D SIMULATOR -D SIMAVR_TIME_MEASUREMENT
[env:atmega328p]
platform = atmelavr
board = nanoatmega328
framework = arduino
build_flags = -Werror -Wall ${common.build_flags}
lib_extra_dirs = ../../../../..

View File

@@ -0,0 +1 @@
src/

View File

@@ -0,0 +1,132 @@
#
# In order to execute the test for one directory use:
#
# make -C test_sd_01b_328p -f ../Makefile.test
SRC=$(wildcard ../../../src/*) $(wildcard src/*)
# platformio should contain only one env section.
# This section states the dut name
# atmega168
# atmega168p
# atmega328
# atmega328p
# atmega2560_timer1
# atmega2560_timer3
# atmega2560_timer4
# atmega2560_timer5
#
DUT=$(shell gawk '/env:/{print(substr($$1,6,length($$1)-6))}' platformio.ini)
TRACES=-at StepISR=trace@0x25/0x08 # PB3
TRACES+=-at FillISR=trace@0x25/0x10 # PB4
#
ifeq ($(DUT),atmega2560_timer1)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x025/0x20 #OC1A PB5 11 ATMega2560
TRACES+=-at StepB=trace@0x025/0x40 #OC1B PB6 12 ATMega2560
TRACES+=-at StepC=trace@0x025/0x80 #OC1C PB7 13 ATMega2560
#
else ifeq ($(DUT),atmega2560_timer3)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x02e/0x08 #OC3A PE3 5 ATMega2560
TRACES+=-at StepB=trace@0x02e/0x10 #OC3B PE4 2 ATMega2560
TRACES+=-at StepC=trace@0x02e/0x20 #OC3C PE5 3 ATMega2560
#
else ifeq ($(DUT),atmega2560_timer4)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x102/0x08 #OC4A PH3 6 ATMega2560
TRACES+=-at StepB=trace@0x102/0x10 #OC4B PH4 7 ATMega2560
TRACES+=-at StepC=trace@0x102/0x20 #OC4C PH5 8 ATMega2560
#
else ifeq ($(DUT),atmega2560_timer5)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x10b/0x08 #OC5A PL3 46 ATMega2560
TRACES+=-at StepB=trace@0x10b/0x10 #OC5B PL4 45 ATMega2560
TRACES+=-at StepC=trace@0x10b/0x20 #OC5C PL5 44 ATMega2560
else ifeq ($(DUT),atmega168)
DEVICE=atmega168
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 atmega168
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 atmega168
else ifeq ($(DUT),atmega168p)
DEVICE=atmega168p
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 atmega168p
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 atmega168p
else ifeq ($(DUT),atmega328)
DEVICE=atmega328
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 ATMega328
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 ATMega328
else ifeq ($(DUT),atmega328p)
DEVICE=atmega328p
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 ATMega328p
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 ATMega328p
else ifeq ($(DUT),atmega32u4)
DEVICE=atmega32u4
TRACES+=-at StepA=trace@0x025/0x20 #OC1A PB5 11
TRACES+=-at StepB=trace@0x025/0x40 #OC1B PB6 12
#TRACES+=-at StepC=trace@0x025/0x80 #OC1C PB7 13
endif
ifeq ($(DEVICE),atmega2560)
TRACES+=-at DirA=trace@0x2b/0x01 # Pin 21 PD0
TRACES+=-at DirB=trace@0x2b/0x02 # Pin 20 PD1
TRACES+=-at DirC=trace@0x10b/0x80 # Pin 42 PL7
TRACES+=-at EnableA=trace@0x2b/0x04 # Pin 19 PD2
TRACES+=-at EnableB=trace@0x2b/0x08 # Pin 18 PD3
TRACES+=-at EnableC=trace@0x10b/0x40 # Pin 43 PL6
else ifeq ($(DEVICE),$(filter $(DEVICE),atmega168 atmega168p atmega328 atmega328p))
TRACES+=-at DirA=trace@0x2b/0x20 # Pin 5 PD5
TRACES+=-at DirB=trace@0x2b/0x80 # Pin 7 PD7
TRACES+=-at EnableA=trace@0x2b/0x40 # Pin 6 PD6
TRACES+=-at EnableB=trace@0x25/0x01 # Pin 8 PB0
else ifeq ($(DUT),atmega32u4)
TRACES+=-at DirA=trace@0x25/0x10 # Pin 26 PB4
TRACES+=-at DirB=trace@0x25/0x08 # Pin 14 PB3
#TRACES+=-at DirC=trace@0x10b/0x80 # Pin 42 PL7
TRACES+=-at EnableA=trace@0x25/0x04 # Pin 16 PB2
TRACES+=-at EnableB=trace@0x25/0x02 # Pin 15 PB1
#TRACES+=-at EnableC=trace@0x10b/0x40 # Pin 43 PL6
endif
FIRMWARE=".pio/build/$(DUT)/firmware.elf"
DIR=$(shell env pwd)
ifndef SILENCE
SILENCE=0
endif
test: .tested
.tested: result.txt expect.txt ../judge.awk
echo DUT=$(DUT)
rm -f .tested
gawk -f ../judge.awk -v DIR=$(DIR) result.txt expect.txt
test -f .tested
result.txt: x.vcd
gawk -v SILENCE=$(SILENCE) -f ../eval.awk x.vcd >/dev/null
cat expect.txt
x.vcd: $(SRC) ../run_avr platformio.ini src/Issue208.ino
~/.platformio/penv/bin/pio run -e $(DUT) || ~/.local/bin/pio run -e $(DUT) || env pio run -e $(DUT)
../run_avr $(FIRMWARE) -m $(DEVICE) -o x.vcd $(TRACES)
src/Issue208.ino:
mkdir -p src
cd src; ln -s ../../../../../examples/Issue208/Issue208.ino .
clean:
rm -fR .pio .tested x.vcd result.txt

View File

@@ -0,0 +1,18 @@
DirA: 0*L->H, 1*H->L
DirB: 1*L->H, 0*H->L
EnableA: 0*L->H, 0*H->L
EnableB: 0*L->H, 0*H->L
StepA: 234999*L->H, 234999*H->L, Max High=10us Total High=923957us
StepB: 2*L->H, 2*H->L, Max High=12us Total High=25us
Position[A]=37271
Position[B]=2
Time in FillISR max=776 us, total=1220640 us
Time in StepA max=10 us, total=923957 us
Time in StepB max=12 us, total=25 us
Time in StepISR max=6 us, total=894406 us

View File

@@ -0,0 +1,31 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
# There should be only one env section for the DUT under test.
# One of
# atmega168p
# atmega328p
# atmega2560_timer1
# atmega2560_timer3
# atmega2560_timer4
# atmega2560_timer5
#
[common]
# This is the line input to StepperDemo:
build_flags = -D SIMULATOR -D SIMAVR_TIME_MEASUREMENT
[env:atmega328p]
platform = atmelavr
board = nanoatmega328
framework = arduino
build_flags = -Werror -Wall ${common.build_flags}
lib_extra_dirs = ../../../../..

View File

@@ -0,0 +1 @@
src/

View File

@@ -0,0 +1,131 @@
#
# In order to execute the test for one directory use:
#
# make -C test_sd_01b_328p -f ../Makefile.test
SRC=$(wildcard ../../../src/*) $(wildcard src/*)
# platformio should contain only one env section.
# This section states the dut name
# atmega168
# atmega168p
# atmega328
# atmega328p
# atmega2560_timer1
# atmega2560_timer3
# atmega2560_timer4
# atmega2560_timer5
#
DUT=$(shell gawk '/env:/{print(substr($$1,6,length($$1)-6))}' platformio.ini)
TRACES=-at StepISR=trace@0x25/0x08 # PB3
TRACES+=-at FillISR=trace@0x25/0x10 # PB4
#
ifeq ($(DUT),atmega2560_timer1)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x025/0x20 #OC1A PB5 11 ATMega2560
TRACES+=-at StepB=trace@0x025/0x40 #OC1B PB6 12 ATMega2560
TRACES+=-at StepC=trace@0x025/0x80 #OC1C PB7 13 ATMega2560
#
else ifeq ($(DUT),atmega2560_timer3)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x02e/0x08 #OC3A PE3 5 ATMega2560
TRACES+=-at StepB=trace@0x02e/0x10 #OC3B PE4 2 ATMega2560
TRACES+=-at StepC=trace@0x02e/0x20 #OC3C PE5 3 ATMega2560
#
else ifeq ($(DUT),atmega2560_timer4)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x102/0x08 #OC4A PH3 6 ATMega2560
TRACES+=-at StepB=trace@0x102/0x10 #OC4B PH4 7 ATMega2560
TRACES+=-at StepC=trace@0x102/0x20 #OC4C PH5 8 ATMega2560
#
else ifeq ($(DUT),atmega2560_timer5)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x10b/0x08 #OC5A PL3 46 ATMega2560
TRACES+=-at StepB=trace@0x10b/0x10 #OC5B PL4 45 ATMega2560
TRACES+=-at StepC=trace@0x10b/0x20 #OC5C PL5 44 ATMega2560
else ifeq ($(DUT),atmega168)
DEVICE=atmega168
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 atmega168
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 atmega168
else ifeq ($(DUT),atmega168p)
DEVICE=atmega168p
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 atmega168p
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 atmega168p
else ifeq ($(DUT),atmega328)
DEVICE=atmega328
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 ATMega328
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 ATMega328
else ifeq ($(DUT),atmega328p)
DEVICE=atmega328p
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 ATMega328p
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 ATMega328p
else ifeq ($(DUT),atmega32u4)
DEVICE=atmega32u4
TRACES+=-at StepA=trace@0x025/0x20 #OC1A PB5 11
TRACES+=-at StepB=trace@0x025/0x40 #OC1B PB6 12
#TRACES+=-at StepC=trace@0x025/0x80 #OC1C PB7 13
endif
ifeq ($(DEVICE),atmega2560)
TRACES+=-at DirA=trace@0x2b/0x01 # Pin 21 PD0
TRACES+=-at DirB=trace@0x2b/0x02 # Pin 20 PD1
TRACES+=-at DirC=trace@0x10b/0x80 # Pin 42 PL7
TRACES+=-at EnableA=trace@0x2b/0x04 # Pin 19 PD2
TRACES+=-at EnableB=trace@0x2b/0x08 # Pin 18 PD3
TRACES+=-at EnableC=trace@0x10b/0x40 # Pin 43 PL6
else ifeq ($(DEVICE),$(filter $(DEVICE),atmega168 atmega168p atmega328 atmega328p))
TRACES+=-at DirA=trace@0x2b/0x20 # Pin 5 PD5
TRACES+=-at DirB=trace@0x2b/0x80 # Pin 7 PD7
TRACES+=-at EnableA=trace@0x2b/0x40 # Pin 6 PD6
TRACES+=-at EnableB=trace@0x25/0x01 # Pin 8 PB0
else ifeq ($(DUT),atmega32u4)
TRACES+=-at DirA=trace@0x25/0x10 # Pin 26 PB4
TRACES+=-at DirB=trace@0x25/0x08 # Pin 14 PB3
#TRACES+=-at DirC=trace@0x10b/0x80 # Pin 42 PL7
TRACES+=-at EnableA=trace@0x25/0x04 # Pin 16 PB2
TRACES+=-at EnableB=trace@0x25/0x02 # Pin 15 PB1
#TRACES+=-at EnableC=trace@0x10b/0x40 # Pin 43 PL6
endif
FIRMWARE=".pio/build/$(DUT)/firmware.elf"
DIR=$(shell env pwd)
ifndef SILENCE
SILENCE=0
endif
test: .tested
.tested: result.txt ../judge_pos0.awk
echo DUT=$(DUT)
rm -f .tested
gawk -f ../judge_pos0.awk -v DIR=$(DIR) result.txt
test -f .tested
result.txt: x.vcd
gawk -v SILENCE=$(SILENCE) -f ../eval.awk x.vcd >/dev/null
x.vcd: $(SRC) ../run_avr platformio.ini src/Issue250.ino
~/.platformio/penv/bin/pio run -e $(DUT) || ~/.local/bin/pio run -e $(DUT) || env pio run -e $(DUT)
../run_avr $(FIRMWARE) -m $(DEVICE) -o x.vcd $(TRACES)
src/Issue250.ino:
mkdir -p src
cd src; ln -s ../../../../../examples/Issue250/Issue250.ino .
clean:
rm -fR .pio .tested x.vcd result.txt

View File

@@ -0,0 +1,31 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
# There should be only one env section for the DUT under test.
# One of
# atmega168p
# atmega328p
# atmega2560_timer1
# atmega2560_timer3
# atmega2560_timer4
# atmega2560_timer5
#
[common]
# This is the line input to StepperDemo:
build_flags = -D SIMULATOR -D SIMAVR_TIME_MEASUREMENT
[env:atmega328p]
platform = atmelavr
board = nanoatmega328
framework = arduino
build_flags = -Werror -Wall ${common.build_flags}
lib_extra_dirs = ../../../../..

View File

@@ -0,0 +1 @@
src/

View File

@@ -0,0 +1,131 @@
#
# In order to execute the test for one directory use:
#
# make -C test_sd_01b_328p -f ../Makefile.test
SRC=$(wildcard ../../../src/*) $(wildcard src/*)
# platformio should contain only one env section.
# This section states the dut name
# atmega168
# atmega168p
# atmega328
# atmega328p
# atmega2560_timer1
# atmega2560_timer3
# atmega2560_timer4
# atmega2560_timer5
#
DUT=$(shell gawk '/env:/{print(substr($$1,6,length($$1)-6))}' platformio.ini)
TRACES=-at StepISR=trace@0x25/0x08 # PB3
TRACES+=-at FillISR=trace@0x25/0x10 # PB4
#
ifeq ($(DUT),atmega2560_timer1)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x025/0x20 #OC1A PB5 11 ATMega2560
TRACES+=-at StepB=trace@0x025/0x40 #OC1B PB6 12 ATMega2560
TRACES+=-at StepC=trace@0x025/0x80 #OC1C PB7 13 ATMega2560
#
else ifeq ($(DUT),atmega2560_timer3)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x02e/0x08 #OC3A PE3 5 ATMega2560
TRACES+=-at StepB=trace@0x02e/0x10 #OC3B PE4 2 ATMega2560
TRACES+=-at StepC=trace@0x02e/0x20 #OC3C PE5 3 ATMega2560
#
else ifeq ($(DUT),atmega2560_timer4)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x102/0x08 #OC4A PH3 6 ATMega2560
TRACES+=-at StepB=trace@0x102/0x10 #OC4B PH4 7 ATMega2560
TRACES+=-at StepC=trace@0x102/0x20 #OC4C PH5 8 ATMega2560
#
else ifeq ($(DUT),atmega2560_timer5)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x10b/0x08 #OC5A PL3 46 ATMega2560
TRACES+=-at StepB=trace@0x10b/0x10 #OC5B PL4 45 ATMega2560
TRACES+=-at StepC=trace@0x10b/0x20 #OC5C PL5 44 ATMega2560
else ifeq ($(DUT),atmega168)
DEVICE=atmega168
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 atmega168
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 atmega168
else ifeq ($(DUT),atmega168p)
DEVICE=atmega168p
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 atmega168p
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 atmega168p
else ifeq ($(DUT),atmega328)
DEVICE=atmega328
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 ATMega328
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 ATMega328
else ifeq ($(DUT),atmega328p)
DEVICE=atmega328p
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 ATMega328p
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 ATMega328p
else ifeq ($(DUT),atmega32u4)
DEVICE=atmega32u4
TRACES+=-at StepA=trace@0x025/0x20 #OC1A PB5 11
TRACES+=-at StepB=trace@0x025/0x40 #OC1B PB6 12
#TRACES+=-at StepC=trace@0x025/0x80 #OC1C PB7 13
endif
ifeq ($(DEVICE),atmega2560)
TRACES+=-at DirA=trace@0x2b/0x01 # Pin 21 PD0
TRACES+=-at DirB=trace@0x2b/0x02 # Pin 20 PD1
TRACES+=-at DirC=trace@0x10b/0x80 # Pin 42 PL7
TRACES+=-at EnableA=trace@0x2b/0x04 # Pin 19 PD2
TRACES+=-at EnableB=trace@0x2b/0x08 # Pin 18 PD3
TRACES+=-at EnableC=trace@0x10b/0x40 # Pin 43 PL6
else ifeq ($(DEVICE),$(filter $(DEVICE),atmega168 atmega168p atmega328 atmega328p))
TRACES+=-at DirA=trace@0x2b/0x20 # Pin 5 PD5
TRACES+=-at DirB=trace@0x2b/0x80 # Pin 7 PD7
TRACES+=-at EnableA=trace@0x2b/0x40 # Pin 6 PD6
TRACES+=-at EnableB=trace@0x25/0x01 # Pin 8 PB0
else ifeq ($(DUT),atmega32u4)
TRACES+=-at DirA=trace@0x25/0x10 # Pin 26 PB4
TRACES+=-at DirB=trace@0x25/0x08 # Pin 14 PB3
#TRACES+=-at DirC=trace@0x10b/0x80 # Pin 42 PL7
TRACES+=-at EnableA=trace@0x25/0x04 # Pin 16 PB2
TRACES+=-at EnableB=trace@0x25/0x02 # Pin 15 PB1
#TRACES+=-at EnableC=trace@0x10b/0x40 # Pin 43 PL6
endif
FIRMWARE=".pio/build/$(DUT)/firmware.elf"
DIR=$(shell env pwd)
ifndef SILENCE
SILENCE=0
endif
test: .tested
.tested: result.txt ../judge_pos0.awk
echo DUT=$(DUT)
rm -f .tested
gawk -f ../judge_pos0.awk -v DIR=$(DIR) result.txt
test -f .tested
result.txt: x.vcd
gawk -v SILENCE=$(SILENCE) -f ../eval.awk x.vcd >/dev/null
x.vcd: $(SRC) ../run_avr platformio.ini src/Issue250.ino
~/.platformio/penv/bin/pio run -e $(DUT) || ~/.local/bin/pio run -e $(DUT) || env pio run -e $(DUT)
../run_avr $(FIRMWARE) -m $(DEVICE) -o x.vcd $(TRACES)
src/Issue250.ino:
mkdir -p src
cd src; ln -s ../../../../../examples/Issue250/Issue250.ino .
clean:
rm -fR .pio .tested x.vcd result.txt

View File

@@ -0,0 +1,32 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
# There should be only one env section for the DUT under test.
# One of
# atmega168p
# atmega328p
# atmega2560_timer1
# atmega2560_timer3
# atmega2560_timer4
# atmega2560_timer5
#
[common]
# This is the line input to StepperDemo:
#build_flags = -D SIMULATOR -D SIMAVR_TIME_MEASUREMENT -D BLOCK_INTERRUPT_US=30
build_flags = -D SIMULATOR -D SIMAVR_TIME_MEASUREMENT -D BLOCK_INTERRUPT_US=30 -D LOOPS=100 -D TOGGLE_DIRECTION=false -D USE_MOVETO=false
[env:atmega328p]
platform = atmelavr
board = nanoatmega328
framework = arduino
build_flags = -Werror -Wall ${common.build_flags}
lib_extra_dirs = ../../../../..

View File

@@ -0,0 +1 @@
src/

View File

@@ -0,0 +1,131 @@
#
# In order to execute the test for one directory use:
#
# make -C test_sd_01b_328p -f ../Makefile.test
SRC=$(wildcard ../../../src/*) $(wildcard src/*)
# platformio should contain only one env section.
# This section states the dut name
# atmega168
# atmega168p
# atmega328
# atmega328p
# atmega2560_timer1
# atmega2560_timer3
# atmega2560_timer4
# atmega2560_timer5
#
DUT=$(shell gawk '/env:/{print(substr($$1,6,length($$1)-6))}' platformio.ini)
TRACES=-at StepISR=trace@0x25/0x08 # PB3
TRACES+=-at FillISR=trace@0x25/0x10 # PB4
#
ifeq ($(DUT),atmega2560_timer1)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x025/0x20 #OC1A PB5 11 ATMega2560
TRACES+=-at StepB=trace@0x025/0x40 #OC1B PB6 12 ATMega2560
TRACES+=-at StepC=trace@0x025/0x80 #OC1C PB7 13 ATMega2560
#
else ifeq ($(DUT),atmega2560_timer3)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x02e/0x08 #OC3A PE3 5 ATMega2560
TRACES+=-at StepB=trace@0x02e/0x10 #OC3B PE4 2 ATMega2560
TRACES+=-at StepC=trace@0x02e/0x20 #OC3C PE5 3 ATMega2560
#
else ifeq ($(DUT),atmega2560_timer4)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x102/0x08 #OC4A PH3 6 ATMega2560
TRACES+=-at StepB=trace@0x102/0x10 #OC4B PH4 7 ATMega2560
TRACES+=-at StepC=trace@0x102/0x20 #OC4C PH5 8 ATMega2560
#
else ifeq ($(DUT),atmega2560_timer5)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x10b/0x08 #OC5A PL3 46 ATMega2560
TRACES+=-at StepB=trace@0x10b/0x10 #OC5B PL4 45 ATMega2560
TRACES+=-at StepC=trace@0x10b/0x20 #OC5C PL5 44 ATMega2560
else ifeq ($(DUT),atmega168)
DEVICE=atmega168
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 atmega168
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 atmega168
else ifeq ($(DUT),atmega168p)
DEVICE=atmega168p
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 atmega168p
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 atmega168p
else ifeq ($(DUT),atmega328)
DEVICE=atmega328
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 ATMega328
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 ATMega328
else ifeq ($(DUT),atmega328p)
DEVICE=atmega328p
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 ATMega328p
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 ATMega328p
else ifeq ($(DUT),atmega32u4)
DEVICE=atmega32u4
TRACES+=-at StepA=trace@0x025/0x20 #OC1A PB5 11
TRACES+=-at StepB=trace@0x025/0x40 #OC1B PB6 12
#TRACES+=-at StepC=trace@0x025/0x80 #OC1C PB7 13
endif
ifeq ($(DEVICE),atmega2560)
TRACES+=-at DirA=trace@0x2b/0x01 # Pin 21 PD0
TRACES+=-at DirB=trace@0x2b/0x02 # Pin 20 PD1
TRACES+=-at DirC=trace@0x10b/0x80 # Pin 42 PL7
TRACES+=-at EnableA=trace@0x2b/0x04 # Pin 19 PD2
TRACES+=-at EnableB=trace@0x2b/0x08 # Pin 18 PD3
TRACES+=-at EnableC=trace@0x10b/0x40 # Pin 43 PL6
else ifeq ($(DEVICE),$(filter $(DEVICE),atmega168 atmega168p atmega328 atmega328p))
TRACES+=-at DirA=trace@0x2b/0x20 # Pin 5 PD5
TRACES+=-at DirB=trace@0x2b/0x80 # Pin 7 PD7
TRACES+=-at EnableA=trace@0x2b/0x40 # Pin 6 PD6
TRACES+=-at EnableB=trace@0x25/0x01 # Pin 8 PB0
else ifeq ($(DUT),atmega32u4)
TRACES+=-at DirA=trace@0x25/0x10 # Pin 26 PB4
TRACES+=-at DirB=trace@0x25/0x08 # Pin 14 PB3
#TRACES+=-at DirC=trace@0x10b/0x80 # Pin 42 PL7
TRACES+=-at EnableA=trace@0x25/0x04 # Pin 16 PB2
TRACES+=-at EnableB=trace@0x25/0x02 # Pin 15 PB1
#TRACES+=-at EnableC=trace@0x10b/0x40 # Pin 43 PL6
endif
FIRMWARE=".pio/build/$(DUT)/firmware.elf"
DIR=$(shell env pwd)
ifndef SILENCE
SILENCE=0
endif
test: .tested
.tested: result.txt ../judge_pos0.awk
echo DUT=$(DUT)
rm -f .tested
gawk -f ../judge_pos0.awk -v DIR=$(DIR) result.txt
test -f .tested
result.txt: x.vcd
gawk -v SILENCE=$(SILENCE) -f ../eval.awk x.vcd >/dev/null
x.vcd: $(SRC) ../run_avr platformio.ini src/Issue280.ino
~/.platformio/penv/bin/pio run -e $(DUT) || ~/.local/bin/pio run -e $(DUT) || env pio run -e $(DUT)
../run_avr $(FIRMWARE) -m $(DEVICE) -o x.vcd $(TRACES)
src/Issue280.ino:
mkdir -p src
cd src; ln -s ../../../../../examples/Issue280/Issue280.ino .
clean:
rm -fR .pio .tested x.vcd result.txt

View File

@@ -0,0 +1,16 @@
DirA: 0*L->H, 1*H->L
DirB: 0*L->H, 0*H->L
EnableA: 3*L->H, 2*H->L
EnableB: 0*L->H, 0*H->L
StepA: 33872*L->H, 33872*H->L, Max High=10us Total High=133363us
StepB: 0*L->H, 0*H->L, Max High=0us Total High=0us
Position[A]=0
Time in EnableA max=8284 us, total=12482 us
Time in FillISR max=1734 us, total=175782 us
Time in StepA max=10 us, total=133363 us
Time in StepISR max=5 us, total=128886 us

View File

@@ -0,0 +1,31 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
# There should be only one env section for the DUT under test.
# One of
# atmega168p
# atmega328p
# atmega2560_timer1
# atmega2560_timer3
# atmega2560_timer4
# atmega2560_timer5
#
[common]
# This is the line input to StepperDemo:
build_flags = -D SIMULATOR -D SIMAVR_TIME_MEASUREMENT
[env:atmega328p]
platform = atmelavr
board = nanoatmega328
framework = arduino
build_flags = -Werror -Wall ${common.build_flags}
lib_extra_dirs = ../../../../..

View File

@@ -0,0 +1 @@
src/

View File

@@ -0,0 +1,135 @@
#
# In order to execute the test for one directory use:
#
# make -C test_sd_01b_328p -f ../Makefile.test
SRC=$(wildcard ../../../src/*) $(wildcard src/*)
# platformio should contain only one env section.
# This section states the dut name
# atmega168
# atmega168p
# atmega328
# atmega328p
# atmega2560_timer1
# atmega2560_timer3
# atmega2560_timer4
# atmega2560_timer5
#
DUT=$(shell gawk '/env:/{print(substr($$1,6,length($$1)-6))}' platformio.ini)
TRACES=-at StepISR=trace@0x25/0x08 # PB3
TRACES+=-at FillISR=trace@0x25/0x10 # PB4
#
ifeq ($(DUT),atmega2560_timer1)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x025/0x20 #OC1A PB5 11 ATMega2560
TRACES+=-at StepB=trace@0x025/0x40 #OC1B PB6 12 ATMega2560
TRACES+=-at StepC=trace@0x025/0x80 #OC1C PB7 13 ATMega2560
#
else ifeq ($(DUT),atmega2560_timer3)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x02e/0x08 #OC3A PE3 5 ATMega2560
TRACES+=-at StepB=trace@0x02e/0x10 #OC3B PE4 2 ATMega2560
TRACES+=-at StepC=trace@0x02e/0x20 #OC3C PE5 3 ATMega2560
#
else ifeq ($(DUT),atmega2560_timer4)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x102/0x08 #OC4A PH3 6 ATMega2560
TRACES+=-at StepB=trace@0x102/0x10 #OC4B PH4 7 ATMega2560
TRACES+=-at StepC=trace@0x102/0x20 #OC4C PH5 8 ATMega2560
#
else ifeq ($(DUT),atmega2560_timer5)
DEVICE=atmega2560
TRACES+=-at StepA=trace@0x10b/0x08 #OC5A PL3 46 ATMega2560
TRACES+=-at StepB=trace@0x10b/0x10 #OC5B PL4 45 ATMega2560
TRACES+=-at StepC=trace@0x10b/0x20 #OC5C PL5 44 ATMega2560
else ifeq ($(DUT),atmega168)
DEVICE=atmega168
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 atmega168
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 atmega168
else ifeq ($(DUT),atmega168p)
DEVICE=atmega168p
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 atmega168p
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 atmega168p
else ifeq ($(DUT),atmega328)
DEVICE=atmega328
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 ATMega328
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 ATMega328
else ifeq ($(DUT),atmega328p)
DEVICE=atmega328p
TRACES+=-at StepA=trace@0x25/0x02 #OC1A PB1 9 ATMega328p
TRACES+=-at StepB=trace@0x25/0x04 #OC1B PB2 10 ATMega328p
else ifeq ($(DUT),atmega32u4)
DEVICE=atmega32u4
TRACES+=-at StepA=trace@0x025/0x20 #OC1A PB5 11
TRACES+=-at StepB=trace@0x025/0x40 #OC1B PB6 12
#TRACES+=-at StepC=trace@0x025/0x80 #OC1C PB7 13
endif
ifeq ($(DEVICE),atmega2560)
TRACES+=-at DirA=trace@0x2b/0x01 # Pin 21 PD0
TRACES+=-at DirB=trace@0x2b/0x02 # Pin 20 PD1
TRACES+=-at DirC=trace@0x10b/0x80 # Pin 42 PL7
TRACES+=-at EnableA=trace@0x2b/0x04 # Pin 19 PD2
TRACES+=-at EnableB=trace@0x2b/0x08 # Pin 18 PD3
TRACES+=-at EnableC=trace@0x10b/0x40 # Pin 43 PL6
else ifeq ($(DEVICE),$(filter $(DEVICE),atmega168 atmega168p atmega328 atmega328p))
TRACES+=-at DirA=trace@0x2b/0x20 # Pin 5 PD5
TRACES+=-at DirB=trace@0x2b/0x80 # Pin 7 PD7
TRACES+=-at EnableA=trace@0x2b/0x40 # Pin 6 PD6
TRACES+=-at EnableB=trace@0x25/0x01 # Pin 8 PB0
else ifeq ($(DUT),atmega32u4)
TRACES+=-at DirA=trace@0x25/0x10 # Pin 26 PB4
TRACES+=-at DirB=trace@0x25/0x08 # Pin 14 PB3
#TRACES+=-at DirC=trace@0x10b/0x80 # Pin 42 PL7
TRACES+=-at EnableA=trace@0x25/0x04 # Pin 16 PB2
TRACES+=-at EnableB=trace@0x25/0x02 # Pin 15 PB1
#TRACES+=-at EnableC=trace@0x10b/0x40 # Pin 43 PL6
endif
FIRMWARE=".pio/build/$(DUT)/firmware.elf"
DIR=$(shell env pwd)
ifndef SILENCE
SILENCE=0
endif
test: .tested
.tested: result.txt expect.txt ../judge.awk
echo DUT=$(DUT)
rm -f .tested
gawk -f ../judge.awk -v DIR=$(DIR) result.txt expect.txt
test -f .tested
result.txt: x.vcd
gawk -v SILENCE=$(SILENCE) -f ../eval.awk x.vcd
cat expect.txt
x.vcd: $(SRC) ../run_avr platformio.ini src/PMF_test.ino src/test_03.h
~/.platformio/penv/bin/pio run -e $(DUT) || ~/.local/bin/pio run -e $(DUT) || env pio run -e $(DUT)
../run_avr $(FIRMWARE) -m $(DEVICE) -o x.vcd $(TRACES)
src/PMF_test.ino:
mkdir -p src
cd src; ln -s ../../../pc_based/PMF_test.ino .
src/test_03.h:
mkdir -p src
cd src; ln -s ../../../pc_based/test_03.h .
clean:
rm -fR .pio .tested x.vcd result.txt

View File

@@ -0,0 +1,10 @@
DirA: 0*L->H, 0*H->L
DirB: 1*L->H, 0*H->L
EnableA: 0*L->H, 0*H->L
EnableB: 0*L->H, 0*H->L
StepA: 0*L->H, 0*H->L, Max High=0us Total High=0us
StepB: 2*L->H, 2*H->L, Max High=12us Total High=16us
Position[B]=2
Time in StepB max=12 us, total=16 us

View File

@@ -0,0 +1,31 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
# There should be only one env section for the DUT under test.
# One of
# atmega168p
# atmega328p
# atmega2560_timer1
# atmega2560_timer3
# atmega2560_timer4
# atmega2560_timer5
#
[common]
# This is the line input to StepperDemo:
build_flags = -D SIMULATOR
[env:atmega328p]
platform = atmelavr
board = nanoatmega328
framework = arduino
build_flags = -Werror -Wall ${common.build_flags}
lib_extra_dirs = ../../../../..

View File

@@ -0,0 +1,15 @@
DirA: 0*L->H, 0*H->L
DirB: 1*L->H, 0*H->L
DirC: 0*L->H, 0*H->L
EnableA: 1*L->H, 1*H->L
EnableB: 1*L->H, 0*H->L
EnableC: 1*L->H, 0*H->L
StepA: 3200*L->H, 3200*H->L, Max High=13us Total High=17018us
StepB: 0*L->H, 0*H->L, Max High=0us Total High=0us
StepC: 0*L->H, 0*H->L, Max High=0us Total High=0us
Position[A]=3200
Time in EnableA max=450673 us, total=450673 us
Time in StepA max=13 us, total=17018 us

View File

@@ -0,0 +1,32 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
# There should be only one env section for the DUT under test.
# One of
# atmega168p
# atmega328p
# atmega2560_timer1
# atmega2560_timer3
# atmega2560_timer4
# atmega2560_timer5
#
[common]
# This is the line input to StepperDemo:
build_flags = -D SIM_TEST_INPUT='"? M1 A1000 V100 R3200 W t W "'
[env:atmega2560_timer1]
platform = atmelavr
board = megaatmega2560
framework = arduino
build_flags = -Werror -Wall -DFAS_TIMER_MODULE=1 ${common.build_flags}
lib_extra_dirs = ../../../../..

View File

@@ -0,0 +1,15 @@
DirA: 0*L->H, 0*H->L
DirB: 1*L->H, 0*H->L
DirC: 0*L->H, 0*H->L
EnableA: 1*L->H, 1*H->L
EnableB: 1*L->H, 0*H->L
EnableC: 1*L->H, 0*H->L
StepA: 3200*L->H, 3200*H->L, Max High=13us Total High=17029us
StepB: 0*L->H, 0*H->L, Max High=0us Total High=0us
StepC: 0*L->H, 0*H->L, Max High=0us Total High=0us
Position[A]=3200
Time in EnableA max=450673 us, total=450673 us
Time in StepA max=13 us, total=17029 us

View File

@@ -0,0 +1,32 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
# There should be only one env section for the DUT under test.
# One of
# atmega168p
# atmega328p
# atmega2560_timer1
# atmega2560_timer3
# atmega2560_timer4
# atmega2560_timer5
#
[common]
# This is the line input to StepperDemo:
build_flags = -D SIM_TEST_INPUT='"? M1 A1000 V100 R3200 W t W "'
[env:atmega2560_timer3]
platform = atmelavr
board = megaatmega2560
framework = arduino
build_flags = -Werror -Wall -DFAS_TIMER_MODULE=3 ${common.build_flags}
lib_extra_dirs = ../../../../..

View File

@@ -0,0 +1,15 @@
DirA: 0*L->H, 0*H->L
DirB: 1*L->H, 0*H->L
DirC: 0*L->H, 0*H->L
EnableA: 1*L->H, 1*H->L
EnableB: 1*L->H, 0*H->L
EnableC: 1*L->H, 0*H->L
StepA: 3200*L->H, 3200*H->L, Max High=13us Total High=17029us
StepB: 0*L->H, 0*H->L, Max High=0us Total High=0us
StepC: 0*L->H, 0*H->L, Max High=0us Total High=0us
Position[A]=3200
Time in EnableA max=450673 us, total=450673 us
Time in StepA max=13 us, total=17029 us

View File

@@ -0,0 +1,32 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
# There should be only one env section for the DUT under test.
# One of
# atmega168p
# atmega328p
# atmega2560_timer1
# atmega2560_timer3
# atmega2560_timer4
# atmega2560_timer5
#
[common]
# This is the line input to StepperDemo:
build_flags = -D SIM_TEST_INPUT='"? M1 A1000 V100 R3200 W t W "'
[env:atmega2560_timer4]
platform = atmelavr
board = megaatmega2560
framework = arduino
build_flags = -Werror -Wall ${common.build_flags}
lib_extra_dirs = ../../../../..

View File

@@ -0,0 +1,15 @@
DirA: 0*L->H, 0*H->L
DirB: 1*L->H, 0*H->L
DirC: 1*L->H, 0*H->L
EnableA: 1*L->H, 1*H->L
EnableB: 1*L->H, 0*H->L
EnableC: 1*L->H, 0*H->L
StepA: 3200*L->H, 3200*H->L, Max High=13us Total High=17029us
StepB: 0*L->H, 0*H->L, Max High=0us Total High=0us
StepC: 0*L->H, 0*H->L, Max High=0us Total High=0us
Position[A]=3200
Time in EnableA max=450673 us, total=450673 us
Time in StepA max=13 us, total=17029 us

View File

@@ -0,0 +1,32 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
# There should be only one env section for the DUT under test.
# One of
# atmega168p
# atmega328p
# atmega2560_timer1
# atmega2560_timer3
# atmega2560_timer4
# atmega2560_timer5
#
[common]
# This is the line input to StepperDemo:
build_flags = -D SIM_TEST_INPUT='"? M1 A1000 V100 R3200 W t W "'
[env:atmega2560_timer5]
platform = atmelavr
board = megaatmega2560
framework = arduino
build_flags = -Werror -Wall -DFAS_TIMER_MODULE=5 ${common.build_flags}
lib_extra_dirs = ../../../../..

View File

@@ -0,0 +1,12 @@
DirA: 0*L->H, 0*H->L
DirB: 1*L->H, 0*H->L
EnableA: 1*L->H, 1*H->L
EnableB: 1*L->H, 0*H->L
StepA: 3200*L->H, 3200*H->L, Max High=12us Total High=16420us
StepB: 0*L->H, 0*H->L, Max High=0us Total High=0us
Position[A]=3200
Time in EnableA max=442486 us, total=442486 us
Time in StepA max=12 us, total=16420 us

View File

@@ -0,0 +1,31 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
# There should be only one env section for the DUT under test.
# One of
# atmega168p
# atmega328p
# atmega2560_timer1
# atmega2560_timer3
# atmega2560_timer4
# atmega2560_timer5
#
[common]
# This is the line input to StepperDemo:
build_flags = -D SIM_TEST_INPUT='"? M1 A1000 V100 R3200 W t W "'
[env:atmega328p]
platform = atmelavr
board = nanoatmega328
framework = arduino
build_flags = -Werror -Wall ${common.build_flags}
lib_extra_dirs = ../../../../..

View File

@@ -0,0 +1,12 @@
DirA: 1*L->H, 0*H->L
DirB: 1*L->H, 0*H->L
EnableA: 1*L->H, 1*H->L
EnableB: 1*L->H, 0*H->L
StepA: 3200*L->H, 3200*H->L, Max High=11us Total High=15936us
StepB: 0*L->H, 0*H->L, Max High=0us Total High=0us
Position[A]=3200
Time in EnableA max=335993 us, total=335993 us
Time in StepA max=11 us, total=15936 us

View File

@@ -0,0 +1,32 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
# There should be only one env section for the DUT under test.
# One of
# atmega168p
# atmega328p
# atmega2560_timer1
# atmega2560_timer3
# atmega2560_timer4
# atmega2560_timer5
#
[common]
# This is the line input to StepperDemo:
build_flags = -D SIM_TEST_INPUT='"? M1 A1000 V100 R3200 W t W "'
[env:atmega32u4]
platform = atmelavr
board = leonardo
framework = arduino
build_flags = -Werror -Wall ${common.build_flags}
lib_extra_dirs = ../../../../..

View File

@@ -0,0 +1,15 @@
DirA: 0*L->H, 0*H->L
DirB: 1*L->H, 0*H->L
DirC: 0*L->H, 0*H->L
EnableA: 1*L->H, 0*H->L
EnableB: 2*L->H, 1*H->L
EnableC: 1*L->H, 0*H->L
StepA: 0*L->H, 0*H->L, Max High=0us Total High=0us
StepB: 3200*L->H, 3200*H->L, Max High=13us Total High=16810us
StepC: 0*L->H, 0*H->L, Max High=0us Total High=0us
Position[B]=3200
Time in EnableB max=450586 us, total=450586 us
Time in StepB max=13 us, total=16810 us

View File

@@ -0,0 +1,32 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
# There should be only one env section for the DUT under test.
# One of
# atmega168p
# atmega328p
# atmega2560_timer1
# atmega2560_timer3
# atmega2560_timer4
# atmega2560_timer5
#
[common]
# This is the line input to StepperDemo:
build_flags = -D SIM_TEST_INPUT='"? M2 A1000 V100 R3200 W t W "'
[env:atmega2560_timer1]
platform = atmelavr
board = megaatmega2560
framework = arduino
build_flags = -Werror -Wall -DFAS_TIMER_MODULE=1 ${common.build_flags}
lib_extra_dirs = ../../../../..

View File

@@ -0,0 +1,15 @@
DirA: 0*L->H, 0*H->L
DirB: 1*L->H, 0*H->L
DirC: 0*L->H, 0*H->L
EnableA: 1*L->H, 0*H->L
EnableB: 2*L->H, 1*H->L
EnableC: 1*L->H, 0*H->L
StepA: 0*L->H, 0*H->L, Max High=0us Total High=0us
StepB: 3200*L->H, 3200*H->L, Max High=13us Total High=16811us
StepC: 0*L->H, 0*H->L, Max High=0us Total High=0us
Position[B]=3200
Time in EnableB max=450586 us, total=450586 us
Time in StepB max=13 us, total=16811 us

View File

@@ -0,0 +1,32 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
# There should be only one env section for the DUT under test.
# One of
# atmega168p
# atmega328p
# atmega2560_timer1
# atmega2560_timer3
# atmega2560_timer4
# atmega2560_timer5
#
[common]
# This is the line input to StepperDemo:
build_flags = -D SIM_TEST_INPUT='"? M2 A1000 V100 R3200 W t W "'
[env:atmega2560_timer3]
platform = atmelavr
board = megaatmega2560
framework = arduino
build_flags = -Werror -Wall -DFAS_TIMER_MODULE=3 ${common.build_flags}
lib_extra_dirs = ../../../../..

View File

@@ -0,0 +1,15 @@
DirA: 0*L->H, 0*H->L
DirB: 1*L->H, 0*H->L
DirC: 0*L->H, 0*H->L
EnableA: 1*L->H, 0*H->L
EnableB: 2*L->H, 1*H->L
EnableC: 1*L->H, 0*H->L
StepA: 0*L->H, 0*H->L, Max High=0us Total High=0us
StepB: 3200*L->H, 3200*H->L, Max High=13us Total High=16811us
StepC: 0*L->H, 0*H->L, Max High=0us Total High=0us
Position[B]=3200
Time in EnableB max=450586 us, total=450586 us
Time in StepB max=13 us, total=16811 us

View File

@@ -0,0 +1,32 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
# There should be only one env section for the DUT under test.
# One of
# atmega168p
# atmega328p
# atmega2560_timer1
# atmega2560_timer3
# atmega2560_timer4
# atmega2560_timer5
#
[common]
# This is the line input to StepperDemo:
build_flags = -D SIM_TEST_INPUT='"? M2 A1000 V100 R3200 W t W "'
[env:atmega2560_timer4]
platform = atmelavr
board = megaatmega2560
framework = arduino
build_flags = -Werror -Wall ${common.build_flags}
lib_extra_dirs = ../../../../..

View File

@@ -0,0 +1,15 @@
DirA: 0*L->H, 0*H->L
DirB: 1*L->H, 0*H->L
DirC: 1*L->H, 0*H->L
EnableA: 1*L->H, 0*H->L
EnableB: 2*L->H, 1*H->L
EnableC: 1*L->H, 0*H->L
StepA: 0*L->H, 0*H->L, Max High=0us Total High=0us
StepB: 3200*L->H, 3200*H->L, Max High=13us Total High=16811us
StepC: 0*L->H, 0*H->L, Max High=0us Total High=0us
Position[B]=3200
Time in EnableB max=450586 us, total=450586 us
Time in StepB max=13 us, total=16811 us

View File

@@ -0,0 +1,32 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
# There should be only one env section for the DUT under test.
# One of
# atmega168p
# atmega328p
# atmega2560_timer1
# atmega2560_timer3
# atmega2560_timer4
# atmega2560_timer5
#
[common]
# This is the line input to StepperDemo:
build_flags = -D SIM_TEST_INPUT='"? M2 A1000 V100 R3200 W t W "'
[env:atmega2560_timer5]
platform = atmelavr
board = megaatmega2560
framework = arduino
build_flags = -Werror -Wall -DFAS_TIMER_MODULE=5 ${common.build_flags}
lib_extra_dirs = ../../../../..

View File

@@ -0,0 +1,12 @@
DirA: 0*L->H, 0*H->L
DirB: 1*L->H, 0*H->L
EnableA: 1*L->H, 0*H->L
EnableB: 2*L->H, 1*H->L
StepA: 0*L->H, 0*H->L, Max High=0us Total High=0us
StepB: 3200*L->H, 3200*H->L, Max High=12us Total High=16206us
Position[B]=3200
Time in EnableB max=442405 us, total=442405 us
Time in StepB max=12 us, total=16206 us

View File

@@ -0,0 +1,31 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
# There should be only one env section for the DUT under test.
# One of
# atmega168p
# atmega328p
# atmega2560_timer1
# atmega2560_timer3
# atmega2560_timer4
# atmega2560_timer5
#
[common]
# This is the line input to StepperDemo:
build_flags = -D SIM_TEST_INPUT='"? M2 A1000 V100 R3200 W t W "'
[env:atmega328p]
platform = atmelavr
board = nanoatmega328
framework = arduino
build_flags = -Werror -Wall ${common.build_flags}
lib_extra_dirs = ../../../../..

View File

@@ -0,0 +1,15 @@
DirA: 0*L->H, 0*H->L
DirB: 1*L->H, 0*H->L
DirC: 0*L->H, 0*H->L
EnableA: 1*L->H, 0*H->L
EnableB: 1*L->H, 0*H->L
EnableC: 2*L->H, 1*H->L
StepA: 0*L->H, 0*H->L, Max High=0us Total High=0us
StepB: 0*L->H, 0*H->L, Max High=0us Total High=0us
StepC: 3200*L->H, 3200*H->L, Max High=13us Total High=16832us
Position[C]=3200
Time in EnableC max=450495 us, total=450495 us
Time in StepC max=13 us, total=16832 us

View File

@@ -0,0 +1,32 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
# There should be only one env section for the DUT under test.
# One of
# atmega168p
# atmega328p
# atmega2560_timer1
# atmega2560_timer3
# atmega2560_timer4
# atmega2560_timer5
#
[common]
# This is the line input to StepperDemo:
build_flags = -D SIM_TEST_INPUT='"? M3 A1000 V100 R3200 W t W "'
[env:atmega2560_timer1]
platform = atmelavr
board = megaatmega2560
framework = arduino
build_flags = -Werror -Wall -DFAS_TIMER_MODULE=1 ${common.build_flags}
lib_extra_dirs = ../../../../..

View File

@@ -0,0 +1,15 @@
DirA: 0*L->H, 0*H->L
DirB: 1*L->H, 0*H->L
DirC: 0*L->H, 0*H->L
EnableA: 1*L->H, 0*H->L
EnableB: 1*L->H, 0*H->L
EnableC: 2*L->H, 1*H->L
StepA: 0*L->H, 0*H->L, Max High=0us Total High=0us
StepB: 0*L->H, 0*H->L, Max High=0us Total High=0us
StepC: 3200*L->H, 3200*H->L, Max High=13us Total High=16822us
Position[C]=3200
Time in EnableC max=450494 us, total=450494 us
Time in StepC max=13 us, total=16822 us

View File

@@ -0,0 +1,32 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
# There should be only one env section for the DUT under test.
# One of
# atmega168p
# atmega328p
# atmega2560_timer1
# atmega2560_timer3
# atmega2560_timer4
# atmega2560_timer5
#
[common]
# This is the line input to StepperDemo:
build_flags = -D SIM_TEST_INPUT='"? M3 A1000 V100 R3200 W t W "'
[env:atmega2560_timer3]
platform = atmelavr
board = megaatmega2560
framework = arduino
build_flags = -Werror -Wall -DFAS_TIMER_MODULE=3 ${common.build_flags}
lib_extra_dirs = ../../../../..

View File

@@ -0,0 +1,15 @@
DirA: 0*L->H, 0*H->L
DirB: 1*L->H, 0*H->L
DirC: 0*L->H, 0*H->L
EnableA: 1*L->H, 0*H->L
EnableB: 1*L->H, 0*H->L
EnableC: 2*L->H, 1*H->L
StepA: 0*L->H, 0*H->L, Max High=0us Total High=0us
StepB: 0*L->H, 0*H->L, Max High=0us Total High=0us
StepC: 3200*L->H, 3200*H->L, Max High=13us Total High=16822us
Position[C]=3200
Time in EnableC max=450494 us, total=450494 us
Time in StepC max=13 us, total=16822 us

View File

@@ -0,0 +1,32 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
# There should be only one env section for the DUT under test.
# One of
# atmega168p
# atmega328p
# atmega2560_timer1
# atmega2560_timer3
# atmega2560_timer4
# atmega2560_timer5
#
[common]
# This is the line input to StepperDemo:
build_flags = -D SIM_TEST_INPUT='"? M3 A1000 V100 R3200 W t W "'
[env:atmega2560_timer4]
platform = atmelavr
board = megaatmega2560
framework = arduino
build_flags = -Werror -Wall ${common.build_flags}
lib_extra_dirs = ../../../../..

View File

@@ -0,0 +1,15 @@
DirA: 0*L->H, 0*H->L
DirB: 1*L->H, 0*H->L
DirC: 1*L->H, 0*H->L
EnableA: 1*L->H, 0*H->L
EnableB: 1*L->H, 0*H->L
EnableC: 2*L->H, 1*H->L
StepA: 0*L->H, 0*H->L, Max High=0us Total High=0us
StepB: 0*L->H, 0*H->L, Max High=0us Total High=0us
StepC: 3200*L->H, 3200*H->L, Max High=13us Total High=16822us
Position[C]=3200
Time in EnableC max=450494 us, total=450494 us
Time in StepC max=13 us, total=16822 us

View File

@@ -0,0 +1,32 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
# There should be only one env section for the DUT under test.
# One of
# atmega168p
# atmega328p
# atmega2560_timer1
# atmega2560_timer3
# atmega2560_timer4
# atmega2560_timer5
#
[common]
# This is the line input to StepperDemo:
build_flags = -D SIM_TEST_INPUT='"? M3 A1000 V100 R3200 W t W "'
[env:atmega2560_timer5]
platform = atmelavr
board = megaatmega2560
framework = arduino
build_flags = -Werror -Wall -DFAS_TIMER_MODULE=5 ${common.build_flags}
lib_extra_dirs = ../../../../..

View File

@@ -0,0 +1,12 @@
DirA: 0*L->H, 0*H->L
DirB: 1*L->H, 0*H->L
EnableA: 1*L->H, 1*H->L
EnableB: 1*L->H, 0*H->L
StepA: 3200*L->H, 3200*H->L, Max High=11us Total High=16389us
StepB: 0*L->H, 0*H->L, Max High=0us Total High=0us
Position[A]=3200
Time in EnableA max=442485 us, total=442485 us
Time in StepA max=11 us, total=16389 us

View File

@@ -0,0 +1,31 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
# There should be only one env section for the DUT under test.
# One of
# atmega168p
# atmega328p
# atmega2560_timer1
# atmega2560_timer3
# atmega2560_timer4
# atmega2560_timer5
#
[common]
# This is the line input to StepperDemo:
build_flags = -D SIM_TEST_INPUT='"? M1 A1000000 V50 R3200 W t W "'
[env:atmega328p]
platform = atmelavr
board = nanoatmega328
framework = arduino
build_flags = -Werror -Wall ${common.build_flags}
lib_extra_dirs = ../../../../..

View File

@@ -0,0 +1,12 @@
DirA: 0*L->H, 0*H->L
DirB: 1*L->H, 0*H->L
EnableA: 1*L->H, 1*H->L
EnableB: 1*L->H, 0*H->L
StepA: 3200*L->H, 3200*H->L, Max High=12us Total High=16367us
StepB: 0*L->H, 0*H->L, Max High=0us Total High=0us
Position[A]=3200
Time in EnableA max=225396 us, total=225396 us
Time in StepA max=12 us, total=16367 us

View File

@@ -0,0 +1,31 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
# There should be only one env section for the DUT under test.
# One of
# atmega168p
# atmega328p
# atmega2560_timer1
# atmega2560_timer3
# atmega2560_timer4
# atmega2560_timer5
#
[common]
# This is the line input to StepperDemo:
build_flags = -D SIM_TEST_INPUT='"M1 A1000000 V50 R3200 W t W "'
[env:atmega328p]
platform = atmelavr
board = nanoatmega328
framework = arduino
build_flags = -Werror -Wall ${common.build_flags}
lib_extra_dirs = ../../../../..

View File

@@ -0,0 +1,29 @@
DirA: 0*L->H, 0*H->L
DirB: 1*L->H, 0*H->L
DirC: 0*L->H, 0*H->L
EnableA: 1*L->H, 1*H->L
EnableB: 2*L->H, 1*H->L
EnableC: 2*L->H, 1*H->L
StepA: 64000*L->H, 64000*H->L, Max High=25us Total High=314366us
StepB: 64000*L->H, 64000*H->L, Max High=30us Total High=360899us
StepC: 64000*L->H, 64000*H->L, Max High=33us Total High=459850us
Position[A]=64000
Position[B]=64000
Position[C]=64000
Time in EnableA max=233600 us, total=233600 us
Time in EnableB max=246089 us, total=246089 us
Time in EnableC max=254247 us, total=254247 us
Time in FillISR max=2867 us, total=2123376 us
Time in StepA max=25 us, total=314366 us
Time in StepB max=30 us, total=360899 us
Time in StepC max=33 us, total=459850 us

View File

@@ -0,0 +1,32 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
# There should be only one env section for the DUT under test.
# One of
# atmega168p
# atmega328p
# atmega2560_timer1
# atmega2560_timer3
# atmega2560_timer4
# atmega2560_timer5
#
[common]
# This is the line input to StepperDemo:
build_flags = -D SIM_TEST_INPUT='"M1 A10000 V50 R64000 M2 A11000 V50 R64000 M3 A12000 V50 R64000 W M2 W M1 W t W "' -D SIMAVR_TIME_MEASUREMENT_QUEUE
[env:atmega2560_timer4]
platform = atmelavr
board = megaatmega2560
framework = arduino
build_flags = -Werror -Wall ${common.build_flags}
lib_extra_dirs = ../../../../..

View File

@@ -0,0 +1,22 @@
DirA: 0*L->H, 0*H->L
DirB: 1*L->H, 0*H->L
EnableA: 1*L->H, 1*H->L
EnableB: 2*L->H, 1*H->L
StepA: 1000*L->H, 1000*H->L, Max High=12us Total High=4227us
StepB: 1000*L->H, 1000*H->L, Max High=16us Total High=4975us
Position[A]=1000
Position[B]=1000
Time in EnableA max=225400 us, total=225400 us
Time in EnableB max=238121 us, total=238121 us
Time in FillISR max=2674 us, total=48012 us
Time in StepA max=12 us, total=4227 us
Time in StepB max=16 us, total=4975 us
Time in StepISR max=6 us, total=8566 us

View File

@@ -0,0 +1,31 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
# There should be only one env section for the DUT under test.
# One of
# atmega168p
# atmega328p
# atmega2560_timer1
# atmega2560_timer3
# atmega2560_timer4
# atmega2560_timer5
#
[common]
# This is the line input to StepperDemo:
build_flags = -D SIM_TEST_INPUT='"M1 A100000 V40 R1000 M2 A100000 V40 R1000 W M1 W t W "' -D SIMAVR_TIME_MEASUREMENT
[env:atmega328p]
platform = atmelavr
board = nanoatmega328
framework = arduino
build_flags = -Werror -Wall ${common.build_flags}
lib_extra_dirs = ../../../../..

View File

@@ -0,0 +1,16 @@
DirA: 0*L->H, 0*H->L
DirB: 1*L->H, 0*H->L
EnableA: 1*L->H, 1*H->L
EnableB: 1*L->H, 0*H->L
StepA: 1000*L->H, 1000*H->L, Max High=10us Total High=3941us
StepB: 0*L->H, 0*H->L, Max High=0us Total High=0us
Position[A]=1000
Time in EnableA max=225401 us, total=225401 us
Time in FillISR max=2037 us, total=27769 us
Time in StepA max=10 us, total=3941 us
Time in StepISR max=5 us, total=3975 us

View File

@@ -0,0 +1,31 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
# There should be only one env section for the DUT under test.
# One of
# atmega168p
# atmega328p
# atmega2560_timer1
# atmega2560_timer3
# atmega2560_timer4
# atmega2560_timer5
#
[common]
# This is the line input to StepperDemo:
build_flags = -D SIM_TEST_INPUT='"M1 A100000 V27 R1000 W "' -D SIMAVR_TIME_MEASUREMENT
[env:atmega328p]
platform = atmelavr
board = nanoatmega328
framework = arduino
build_flags = -Werror -Wall ${common.build_flags}
lib_extra_dirs = ../../../../..

View File

@@ -0,0 +1,12 @@
DirA: 0*L->H, 1*H->L
DirB: 1*L->H, 0*H->L
EnableA: 1*L->H, 1*H->L
EnableB: 1*L->H, 0*H->L
StepA: 14440*L->H, 14440*H->L, Max High=11us Total High=55558us
StepB: 0*L->H, 0*H->L, Max High=0us Total High=0us
Position[A]=0
Time in EnableA max=442487 us, total=442487 us
Time in StepA max=11 us, total=55558 us

View File

@@ -0,0 +1,31 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
# There should be only one env section for the DUT under test.
# One of
# atmega168p
# atmega328p
# atmega2560_timer1
# atmega2560_timer3
# atmega2560_timer4
# atmega2560_timer5
#
[common]
# This is the line input to StepperDemo:
build_flags = -D SIM_TEST_INPUT='"? M1 V60 A40000 f w400 A40000 P0 w1000 W "'
[env:atmega328p]
platform = atmelavr
board = nanoatmega328
framework = arduino
build_flags = -Werror -Wall ${common.build_flags}
lib_extra_dirs = ../../../../..

View File

@@ -0,0 +1,12 @@
DirA: 0*L->H, 0*H->L
DirB: 1*L->H, 0*H->L
EnableA: 1*L->H, 1*H->L
EnableB: 1*L->H, 0*H->L
StepA: 1*L->H, 1*H->L, Max High=5us Total High=5us
StepB: 0*L->H, 0*H->L, Max High=0us Total High=0us
Position[A]=1
Time in EnableA max=225397 us, total=225397 us
Time in StepA max=5 us, total=5 us

Some files were not shown because too many files have changed in this diff Show More