From: Jon Langseth Date: Sun, 22 Jul 2012 00:30:23 +0000 (+0200) Subject: Starting to get somewhere on the video-sync-detect X-Git-Url: https://git.defcon.no/?a=commitdiff_plain;h=59abb8c1a25fa444e1884450517e88f3c016e765;p=avrfbosd Starting to get somewhere on the video-sync-detect --- diff --git a/syncgen/main.c b/syncgen/main.c index 564ec67..8ad9cb3 100644 --- a/syncgen/main.c +++ b/syncgen/main.c @@ -1,8 +1,9 @@ #include #include #include -#define ZERO PORTB=0b000 -#define BLACK PORTB=0b001 + +#define ZERO PORTB &= 0xFC +#define BLACK PORTB |= 0x01 // -----..----- ^ // | | | @@ -158,6 +159,14 @@ ISR (TIMER0_COMPA_vect) return; } +/* +ISR (INT0_vect) +{ + //PORTB ^= 0x10; + PORTB |= 0x10; +} +*/ + int main(void) { rasterline = 0; @@ -165,15 +174,53 @@ int main(void) hres = testimg_width / 8; - DDRB =0b111; + DDRB |= (1< 64us. Trigger one early.. - sei(); + // Video detection is done using ADC1 on PB2... + ADMUX |= (1< 10) + { + // Dummy code. + // This needs to be replaced with something that triggers a timer ... + /// Simply indicate on PB4 that we are seeing somethin. + PORTB |= 0x10; + // The next statement stops sync-generation, thus also image-generation.. + TIMSK &= ~(1<