friendofmegaman wrote:Nice. Where are we losing the clocks then... I mean, 96Mhz, how much time it takes to read data and send it to PC...
With my simple testing code (as follows) I think it was the ISR being called which took too many clock cycles (I recall reading 10 cycles of overhead somewhere). Getting away from the Arduino code will hopefully reduce this.
#include <WProgram.h>
#define CLOCK_PIN 23
#define HSYNC_PIN 21
volatile char clk_cnt = 0;
volatile bool got_hsync = false;
void ISR_clock() {
clk_cnt++;
}
void ISR_hsync() {
got_hsync = true;
}
int main() {
Serial.begin(1); //Always runs at Full Speed.
pinMode(CLOCK_PIN, INPUT);
attachInterrupt(CLOCK_PIN, ISR_clock, RISING);
pinMode(HSYNC_PIN, INPUT);
attachInterrupt(HSYNC_PIN, ISR_hsync, RISING);
for(;;) {
if(got_hsync) {
got_hsync = false;
Serial.write(clk_cnt);
clk_cnt=0;
}
}
}
Alley Beach wrote:a pi wouldnt work?
I have a beaglebone and an XMOS pcb i can donate if you think you can make it happen on one of those
If any of these have two SPI buses, I am quite sure it would be doable (at least with the Raspberry Pi or BeagleBone; I'm not familiar with the XMOS). Even without, the extra clock speed would probably make things magically work, at least when not running an OS (or if using an RTOS and a low-level API). I would like to eventually have this running on something quite small, though (not that a BeagleBone / Raspberry Pi is that big).
At least at first glance, this seems like almost exactly what I've been hoping for, thank you. It is for a Windows system, but should be easily adaptable.
Last edited by rvan (Apr 23, 2014 9:36 am)