OK, the LED array is now hooked up and apparently working.
Back to the signal sampling. I've spotted some demo code that does the 38KHz sampling on an analog pin. What I think it does is actually switch into an internal "fast read" mode which simply samples and places the sample on a hardware register. That's all. No interrupt associated with it - just running in the background.
See
Arduino Audio Input for an interesting example of 38KHz sampling and an explanation of the process. So that code basically sets up an automatic 26 us sample of an analog pin. It then in the main processing loop (which runs at indeterminate frequency) reads the ADCH value from hardware. That's the most significant 8 bits of the ADC value.
So I don't want my reading/processing in the main loop. I want a regular and "high" frequency interrupt running to do the reading of the ADCH and subsequent processing, which will include...
- detecting synch pulses
- detecting missing synch pulse for a frame pulse
- clamping (finding the bottom level of the sync, and location of the "black")
- separating the video signal from the sync pulses
- amplification =brightness, right?
- contrast <--- no idea how to do this/how it works yet
- gamma correction (which might be done externally...?)
For my first trick, though, I think I'll try and setup a 30kHz or so interrupt to read ADCH and simply turn the value into a duty cycle for the LED PWM output pin. I obviously need to be running the LED PWM at a high frequency to allow changes for pixels. Will calculate that later. If I can get that working, then I should be able to run the disc at a selected RPM (well, hopefully 750RPM) and see a steady picture. And then I can take it from there to work on the sync pulses, find the missing sync for frame, and then, finally, I'll be able to work on frame lock.
I can concentrate on the quality of the picture later on - I just need anything recognisable at this stage.