commit 954b27343edcccbd06ca1f1323329747d7ca0c0f Author: Mats van Reenen Date: Tue Jan 5 13:28:13 2021 +0100 initial commit diff --git a/oscioscoop.ino b/oscioscoop.ino new file mode 100644 index 0000000..09c548d --- /dev/null +++ b/oscioscoop.ino @@ -0,0 +1,38 @@ +const uint8_t ADC_DATA_PIN[] = { + 19, 18, 14, 15, + 40, 41, 17, 16 +}; +#define ADC_CLK_PIN 27 + +void setup() { + pinMode(ADC_CLK_PIN, OUTPUT); + for(int8_t i=7; i >= 0; i--){ + pinMode(ADC_DATA_PIN[i], INPUT); + } + digitalWrite(ADC_CLK_PIN, LOW); + Serial.begin(1E6); +} + +uint32_t d=50; +uint32_t t=0; +void loop() { + uint32_t T=500; + uint8_t value = 0; + + digitalWriteFast(ADC_CLK_PIN, LOW); + delayMicroseconds(1); + digitalWriteFast(ADC_CLK_PIN, HIGH); + delayMicroseconds(1); + +// for(int8_t i=7; i >= 0; i--){ +// value |= digitalRead(ADC_DATA_PIN[i]) << i; +// } + value = (GPIO6_PSR >> 16) & 0xFF; + + Serial.println(value, DEC); +// Serial.print('\t'); +// T = micros(); +//// Serial.println(T - t, DEC); +// while(t + d > micros()); +// t = T; +}