I apologize if I keep using this post to talk about a problem that is not the initial topic.
I don't really know the rules of this forum and why I'm not allowed to create a specific post about my question.
I'm developing a product that reads the R channel from a VGA interface and it doesn't matter the analog level, just 0 or 1, using a comparator to do so.
Both vertical and horizontal sync signals are used to generate interrupts and this is working fine, to capture a monochrome frame.
But I need is to increase the sampling rate.
The maximum I could get with the code below was 160 pixels wide.
Is there a way to use I2S to get faster sampling around 20MHz?
Another possibility would be to use assemby to capture the bits, a language that I'm easy to use, but I haven't found a way to implement it into C code as ASM { nop; } for example.
Here is the code I currently use and atached an image of a capture:
Code: Select all
void IRAM_ATTR sync_horizontal() {
noInterrupts();
if ( vsync_line>2 && vsync_line<7 ) {
for ( pos_array=0; pos_array<160; pos_array++ ) {
mem[lyne_horizontal+(pos_array>>3)] |= ((GPIO.in >> 4) & 0x1)<<(8-pos_array&7);
}
line_horizontal += 20;
}
interrupts();
}