Николай Коровин (03.02.2009 16:23, просмотров: 12602) reZident
Во чего мега умеет :) 1) Соберите этот код под 128-ю мегу
//#include <inttypes.h>
#include <avr/io.h>
//#include <avr/interrupt.h>
//#include <avr/signal.h>
#define BIN8(x) BIN___(0##x)
#define BIN___(x) \
( \
((x / 01ul) % 010)*(2>>1) + \
((x / 010ul) % 010)*(2<<0) + \
((x / 0100ul) % 010)*(2<<1) + \
((x / 01000ul) % 010)*(2<<2) + \
((x / 010000ul) % 010)*(2<<3) + \
((x / 0100000ul) % 010)*(2<<4) + \
((x / 01000000ul) % 010)*(2<<5) + \
((x / 010000000ul) % 010)*(2<<6) \
)
#define BIN16(x1,x2) \
((BIN(x1)<<8)+BIN(x2))
#define BIN24(x1,x2,x3) \
((BIN(x1)<<16)+(BIN(x2)<<8)+BIN(x3))
#define BIN32(x1,x2,x3,x4) \
((BIN(x1)<<24)+(BIN(x2)<<16)+(BIN(x3)<<8)+BIN(x4))
#define BIN64(x1,x2,x3,x4,x5,x6,x7,x8) \
((__int64(BIN32(x1,x2,x3,x4)) << 32) + __int64(BIN32(x5,x6,x7,x8)))
#define debug_uart
main (void)
{
long i,j; //counters;
char I; //(I)nput;
static char VBuff [304*12]=
{0,224,255,255,3,0,0,144,255,255,7,0,0,224,255,255,0,0,0,68,255,255,7,0,
0,224,255,255,1,0,0,33,255,255,7,0,0,224,255,255,32,0,0,136,255,255,7,0,
0,224,255,255,0,0,0,64,255,255,7,0,0,224,255,255,0,0,0,144,254,255,7,0,
0,224,255,255,16,0,0,32,254,255,7,0,0,224,255,127,8,0,0,160,255,255,7,0,
0,224,255,191,0,0,0,128,254,255,7,0,0,224,255,31,8,0,0,16,254,255,7,0,
0,224,255,127,0,0,0,66,254,255,7,0,0,224,255,15,4,0,0,145,252,255,7,0,
0,224,255,63,0,0,128,4,253,255,7,0,0,224,255,15,2,0,0,160,250,255,7,0,
0,224,255,15,2,0,128,4,253,255,7,0,0,224,255,7,1,0,0,84,250,255,7,0,
0,224,255,7,0,0,0,0,253,255,7,0,0,224,255,7,0,0,0,160,250,255,7,0,
0,224,255,3,0,0,0,0,250,255,7,0,0,224,255,3,0,0,0,192,250,255,7,0,
0,224,255,1,0,0,0,0,250,255,7,0,0,224,255,3,4,128,10,0,245,255,7,0,
0,224,255,1,0,0,68,64,245,255,7,0,0,224,255,1,32,0,8,0,244,255,7,0,
0,224,255,1,4,0,16,0,234,255,7,0,0,224,255,0,16,0,4,0,245,255,7,0,
0,224,255,1,2,0,0,0,244,255,7,0,0,224,255,0,8,16,8,0,234,255,7,0,
0,224,255,0,32,0,16,0,212,255,7,0,0,224,255,0,16,16,32,0,232,255,7,0,
0,224,255,0,0,0,8,0,210,255,7,0,0,224,255,0,16,16,16,0,212,255,7,0,
0,224,255,0,0,0,32,0,144,255,7,0,0,224,255,0,144,16,16,0,208,255,7,0,
0,224,255,0,0,0,64,1,40,255,7,0,0,224,255,0,32,0,32,0,192,255,7,0,
0,224,127,0,0,0,128,1,32,255,7,0,0,224,191,0,32,0,160,0,160,255,7,0,
0,224,95,0,80,16,64,2,0,255,7,0,0,224,95,0,0,8,128,0,128,255,7,0,
0,224,175,0,64,16,64,1,0,255,7,0,0,224,151,0,32,4,0,0,0,255,7,0,
0,224,89,0,0,8,128,0,0,255,7,0,0,224,175,0,0,4,64,2,0,255,7,0,
0,224,47,0,128,10,128,16,0,254,7,0,0,224,71,0,136,5,144,0,0,255,7,0,
0,224,27,0,17,29,32,4,0,253,7,0,0,224,5,0,72,10,16,0,0,254,7,0,
0,224,2,0,20,23,64,40,0,253,7,0,0,224,35,0,34,46,16,0,0,252,7,0,
0,224,7,0,8,63,128,0,0,250,7,0,0,224,1,0,2,47,16,64,0,252,7,0,
0,224,3,0,140,255,32,0,0,248,7,0,0,224,1,0,66,63,0,128,0,244,7,0,
0,224,1,0,202,191,0,32,0,240,7,0,0,224,1,0,226,127,0,0,0,240,7,0,
0,224,1,0,228,255,8,0,0,224,7,0,0,224,0,0,242,127,0,0,0,240,7,0,
0,224,0,0,244,255,132,0,0,224,7,0,0,224,0,32,245,127,0,0,0,192,7,0,
0,224,0,0,248,255,0,0,0,224,7,0,0,224,0,0,253,255,2,0,0,192,7,0,
0,224,0,0,252,255,0,0,0,192,7,0,0,224,0,0,253,255,1,0,0,192,7,0,
0,224,0,0,254,255,1,0,0,192,7,0,0,224,0,0,253,255,1,0,0,128,7,0,
0,224,0,0,254,255,2,0,0,128,7,0,0,224,0,0,255,255,1,4,0,128,7,0,
0,224,0,0,254,255,3,0,0,0,7,0,0,224,0,128,255,255,1,8,0,0,7,0,
0,96,0,0,254,255,7,0,0,0,7,0,0,224,0,64,255,255,23,36,0,0,7,0,
0,224,0,0,255,255,47,0,0,0,7,0,0,96,0,128,255,255,127,8,0,0,7,0,
0,224,0,0,255,255,255,0,0,0,7,0,0,96,0,64,255,255,255,16,0,0,7,0,
0,224,0,0,255,255,255,128,0,0,7,0,0,224,0,128,255,255,255,16,0,0,7,0,
0,96,0,0,255,255,255,0,0,0,7,0,0,224,0,128,255,255,255,64,0,0,7,0,
0,96,0,0,255,255,255,0,0,0,7,0,0,224,0,64,255,255,255,0,0,0,7,0,
0,96,0,0,255,255,255,0,0,0,6,0,0,224,0,64,255,255,255,32,2,0,7,0,
0,96,0,0,255,255,255,5,0,0,6,0,0,96,0,128,255,255,255,80,4,0,6,0,
0,224,0,32,255,255,255,132,0,0,6,0,0,224,0,128,255,255,255,18,0,0,6,0,
0,96,0,0,255,255,255,73,0,0,6,0,0,224,0,128,255,255,255,5,0,0,6,0,
0,224,0,0,255,255,255,154,0,0,6,0,0,224,0,128,255,255,255,4,0,0,6,0,
0,224,0,128,255,255,255,21,0,0,6,0,0,224,1,128,255,255,255,1,0,0,6,0,
0,224,0,0,255,255,255,20,0,0,6,0,0,224,1,160,255,255,255,18,0,0,6,0,
0,224,0,0,255,255,255,42,0,0,6,0,0,224,1,128,255,255,255,3,0,0,7,0,
0,224,0,64,255,255,255,42,0,0,6,0,0,224,2,128,255,255,255,86,0,0,7,0,
0,224,0,64,255,255,255,85,0,0,7,0,0,224,1,64,255,255,255,55,0,0,7,0,
0,224,2,128,255,255,255,42,0,0,7,0,0,224,0,64,255,255,255,87,0,0,7,0,
0,224,1,64,255,255,255,78,0,0,7,0,0,224,1,64,251,255,255,173,0,0,7,0,
0,224,1,160,255,255,255,45,0,0,7,0,0,224,1,64,255,255,255,77,0,0,7,0,
0,224,1,160,255,255,255,85,0,0,7,0,0,224,0,64,255,255,255,27,0,0,7,0,
0,224,3,80,255,255,255,43,0,0,7,0,0,224,0,160,255,255,255,91,0,0,7,0,
0,224,1,144,255,255,255,87,0,0,7,0,0,224,2,160,255,255,255,103,0,0,7,0,
0,224,1,80,255,255,255,95,0,0,7,0,0,224,0,72,255,255,255,143,0,0,7,0,
0,224,1,160,255,255,255,63,0,0,7,0,0,224,0,72,255,255,255,95,0,0,7,0,
0,224,1,80,255,255,255,127,2,0,7,0,0,224,0,168,255,255,255,191,0,128,7,0,
0,224,33,128,255,255,255,127,5,0,7,0,0,224,0,168,255,255,255,191,2,0,7,0,
0,224,33,144,255,255,255,255,8,0,7,0,0,224,0,168,255,255,255,191,2,0,7,0,
0,224,97,64,255,255,255,127,5,0,7,0,0,224,0,168,255,255,255,191,10,4,7,0,
0,224,161,144,253,255,255,255,10,4,7,0,0,224,32,160,254,255,255,191,2,13,7,0,
0,224,33,80,250,255,255,255,13,6,7,0,0,224,160,168,254,255,255,191,2,26,7,0,
0,224,97,0,245,255,255,255,10,7,7,0,0,224,160,80,213,255,255,127,5,21,7,0,
0,224,161,0,86,255,255,123,21,19,7,0,0,224,96,96,201,255,255,255,10,11,7,0,
0,224,161,128,47,255,255,127,5,21,7,0,0,224,96,208,146,255,127,218,10,11,7,0,
0,224,66,64,15,254,95,87,21,22,7,0,0,224,160,200,21,254,173,85,5,43,6,0,
0,224,160,32,170,253,167,170,10,31,7,0,0,224,162,8,43,254,10,174,5,11,7,0,
0,224,160,16,255,249,133,90,5,59,7,0,0,224,162,8,214,254,19,237,10,11,7,0,
0,224,160,0,171,249,69,185,10,27,7,0,0,224,162,4,128,255,170,247,2,11,7,0,
0,224,130,129,0,251,235,87,5,31,7,0,0,224,192,64,132,251,186,175,3,11,7,0,
0,224,193,0,4,245,237,157,5,27,7,0,0,224,160,65,162,250,90,46,2,15,7,0,
0,224,128,1,4,242,12,16,34,27,7,0,0,224,225,136,2,245,98,50,9,15,7,0,
0,224,128,82,132,229,84,4,18,27,7,0,0,224,160,152,134,242,105,82,33,15,7,0,
0,224,192,90,136,229,85,36,43,27,7,0,0,224,64,16,206,243,122,146,20,15,7,0,
0,224,160,65,201,213,234,70,168,15,7,0,0,224,64,130,252,194,221,37,84,23,7,0,
0,224,64,65,117,75,166,163,20,15,7,0,0,224,64,130,244,170,213,85,232,23,7,0,
0,96,64,160,82,171,173,82,152,15,7,0,0,96,64,133,170,83,190,170,245,15,7,0,
0,96,64,68,85,215,93,181,168,15,7,0,0,32,128,162,174,65,174,170,217,15,7,0,
0,32,128,69,89,175,189,182,236,10,7,0,0,160,128,164,239,98,189,93,212,15,7,0,
0,32,0,74,181,133,90,183,236,14,7,0,0,64,128,164,237,101,253,93,212,7,7,0,
0,160,0,74,186,197,182,183,236,15,7,0,0,64,34,68,245,117,253,90,218,3,7,0,
0,64,128,169,221,197,250,183,110,15,7,0,0,224,128,164,251,115,247,106,83,7,7,0,
0,224,34,165,170,229,236,191,190,5,7,0,0,224,128,172,253,243,255,85,85,7,7,0,
0,224,33,73,214,229,244,255,91,134,7,0,0,224,2,148,253,242,255,85,215,3,7,0,
0,224,1,75,234,235,236,127,155,134,7,0,0,224,34,85,255,242,254,91,247,1,7,0,
0,224,1,85,182,229,250,191,213,130,7,0,0,224,2,149,253,245,254,91,247,2,7,0,
0,224,3,171,187,234,250,255,251,131,7,0,0,224,5,149,238,245,254,91,245,130,7,0,
0,224,3,149,253,245,245,183,251,129,7,0,0,224,3,52,247,243,253,95,246,130,7,0,
0,224,7,40,253,244,250,107,237,129,7,0,0,224,3,116,247,249,245,95,251,192,7,0,
0,224,7,80,253,246,251,87,246,128,7,0,0,224,7,232,127,249,245,91,251,193,7,0,
0,224,7,168,90,245,246,47,245,192,7,0,0,224,7,232,84,249,235,187,251,192,7,0,
0,224,15,168,43,245,246,31,245,192,7,0,0,224,7,232,237,250,175,215,123,224,7,0,
0,224,143,168,255,250,253,159,245,192,7,0,0,224,7,208,255,245,255,229,43,224,7,0,
0,224,15,168,255,249,253,235,5,192,7,0,0,224,7,232,255,250,254,245,3,224,7,0,
0,224,15,168,255,249,253,255,5,224,7,0,0,224,7,208,255,250,254,255,5,224,7,0,
0,224,143,169,255,245,253,255,5,224,7,0,0,224,15,208,255,252,253,255,3,224,7,0,
0,224,143,168,255,250,250,255,2,224,7,0,0,224,15,209,255,253,253,255,3,224,7,0,
0,224,79,208,255,250,250,255,2,224,7,0,0,224,15,80,255,254,253,255,1,240,7,0,
0,224,79,208,255,250,250,255,6,224,7,0,0,224,23,160,255,253,253,191,1,240,7,0,
0,224,39,80,255,246,250,255,3,224,7,0,0,224,7,208,255,253,250,127,2,240,7,0,
0,224,21,32,255,250,251,255,3,240,7,0,0,224,3,224,255,254,250,255,2,232,7,0,
0,224,139,80,255,250,251,255,3,240,7,0,0,224,66,160,255,254,253,127,0,232,7,0,
0,224,21,80,255,250,251,255,3,240,7,0,0,224,2,160,255,254,250,255,1,232,7,0,
0,224,10,80,255,253,251,127,1,240,7,0,0,224,2,208,255,254,250,255,2,248,7,0,
0,224,10,64,254,250,250,127,1,240,7,0,0,224,3,81,255,253,250,239,2,248,7,0,
0,224,11,160,255,249,249,127,1,240,7,0,0,224,7,209,255,253,254,255,1,248,7,0,
0,224,15,160,253,114,253,255,1,240,7,0,0,224,7,80,255,92,253,191,0,240,7,0,
0,224,15,162,254,242,254,255,1,240,7,0,0,224,15,160,255,169,255,191,0,248,7,0,
0,224,7,160,254,82,254,255,1,240,7,0,0,224,15,80,223,170,255,191,0,248,7,0,
0,224,15,64,253,21,253,255,1,240,7,0,0,224,15,160,255,213,254,191,0,248,7,0,
0,224,23,64,255,170,253,255,1,240,7,0,0,224,15,160,253,218,254,95,0,248,7,0,
0,224,47,64,191,180,250,255,1,248,7,0,0,224,15,64,213,173,250,191,0,252,7,0,
0,224,31,32,175,218,250,255,0,248,7,0,0,224,15,160,106,181,116,95,1,252,7,0,
0,224,63,64,173,106,213,247,0,252,7,0,0,224,31,64,82,189,169,223,1,252,7,0,
0,224,63,64,74,234,85,255,0,252,7,0,0,224,31,64,85,253,82,95,0,252,7,0,
0,224,63,128,36,245,170,247,0,252,7,0,0,224,31,64,42,250,83,94,0,252,7,0,
0,224,63,128,34,245,172,251,0,254,7,0,0,224,63,64,80,116,171,174,0,254,7,0,
0,224,95,0,42,82,84,253,0,254,7,0,0,224,63,128,84,64,169,93,0,254,7,0,
0,224,63,128,170,32,64,245,0,254,7,0,0,224,127,64,149,0,104,93,0,255,7,0,
0,224,191,0,117,0,146,117,0,255,7,0,0,224,127,128,90,0,180,218,0,255,7,0,
0,224,255,0,245,66,234,117,0,255,7,0,0,224,255,129,186,148,181,90,0,255,7,0,
0,224,255,1,117,210,234,106,0,255,7,0,0,224,255,129,190,85,253,91,0,255,7,0,
0,224,255,3,245,82,242,181,0,255,7,0,0,224,255,3,190,170,254,90,160,255,7,0,
0,224,255,7,245,85,245,171,192,255,7,0,0,224,255,135,190,38,255,91,232,255,7,0,
0,224,255,15,117,221,250,85,251,255,7,0,0,224,255,63,253,182,255,173,251,255,7,0,
0,224,255,63,181,219,250,87,255,255,7,0,0,224,255,63,253,175,255,170,255,255,7,0,
0,224,255,127,182,106,255,175,255,255,7,0,0,224,255,127,122,223,255,171,255,255,7,0,
0,224,255,127,213,106,254,87,255,255,7,0,0,224,255,127,186,223,255,85,255,255,7,0,
0,224,255,255,109,245,255,170,255,255,7,0,0,224,255,127,244,175,255,171,255,255,7,0,
0,224,255,255,170,254,255,85,255,255,7,0,0,224,255,255,244,219,255,85,255,255,7,0,
0,224,255,255,105,182,255,74,255,255,7,0,0,224,255,255,244,255,255,85,255,255,7,0,
0,224,255,255,105,190,255,133,255,255,7,0,0,224,255,255,180,255,127,106,255,255,7,0,
0,224,255,127,100,254,247,145,255,255,7,0,0,224,255,255,185,255,255,34,255,255,7,0,
0,224,255,255,232,255,255,136,255,255,7,0,0,224,255,127,168,255,127,33,255,255,7,0,
0,224,255,255,232,254,253,162,255,255,7,0,0,224,255,127,208,255,127,80,255,255,7,0,
0,224,255,255,80,254,127,130,255,255,7,0,0,224,255,127,232,255,175,72,255,255,7,0,
0,224,255,255,64,255,127,17,255,255,7,0,0,224,255,127,168,255,93,128,255,255,7,0,
0,224,255,255,32,254,183,65,255,255,7,0,0,224,255,127,192,253,109,64,255,255,7,0,
0,224,255,255,64,255,183,8,255,255,7,0,0,224,255,255,160,254,85,66,255,255,7,0,
0,224,255,127,128,253,171,128,255,255,7,0,0,224,255,255,64,254,86,136,255,255,7,0,
0,224,255,127,144,250,43,160,255,255,7,0,0,224,255,255,64,191,86,209,255,255,7,0,
0,224,255,127,0,109,43,64,255,255,7,0,0,224,255,127,128,251,43,96,255,255,7,0,
0,224,255,127,64,109,74,160,255,255,7,0,0,224,255,127,0,187,43,112,255,255,7,0,
0,224,255,255,128,234,21,160,255,255,7,0,0,224,255,63,128,173,42,104,255,255,7,0,
0,224,255,255,128,82,139,224,255,255,7,0,0,224,255,127,0,85,37,240,255,255,7,0,
0,224,255,191,128,149,10,232,255,255,7,0,0,224,255,127,0,160,37,232,254,255,7,0,
0,224,255,255,64,10,2,240,255,255,7,0,0,224,255,63,0,0,5,232,255,255,7,0,
0,224,255,255,0,2,8,248,254,255,7,0,0,224,255,63,0,0,1,236,253,255,7,0,
0,224,255,255,0,0,4,248,250,255,7,0,0,224,255,127,0,0,0,248,210,255,7,0};
DDRA =DDRB =DDRC =DDRD =DDRE =DDRF =DDRG =0;
PORTA=PORTB=PORTC=PORTD=PORTE=PORTF=PORTG=0xFF;
PORTB=127;
DDRB =128; //pin 7 out
PORTE|=128; //Pull-Up;
#ifdef debug_uart
UCSR0A=BIN8(00000000); //state and error flags must be written as zero, than double speed = "no", than multi-proc = "no".
UCSR0B=BIN8(00011000); //all interrupt = "disabled", than Receive="yes", than Transmit="yes", than Character Size (8)="0", than Data Bit 8 R and W both 0.
UCSR0C=BIN8(00000110); //reserved=0, than SyncMode="no", than Parity=00 ("disabled"), than 2nd stop-bit="no", than Character Size (8)="11", than Clock Polarity="n/a(0)".
//UBRR0=25; //38400 baud +0.2% error
UBRR0H=0;UBRR0L=25; //38400 baud +0.2% error
#else
DDRD |=BIN8(00010000); //D4 pin == RS-485 REDE
PORTD&=BIN8(11101111); //D4 pin set to 0 == "read"
UCSR1A=BIN8(00000000); //state and error flags must be written as zero, than double speed = "no", than multi-proc = "no".
UCSR1B=BIN8(00010000); //all interrupt = "disabled", than Receive="yes", than Transmit="no", than Character Size (8)="0", than Data Bit 8 R and W both 0.
UCSR1C=BIN8(00000110); //reserved=0, than SyncMode="no", than Parity=00 ("disabled"), than 2nd stop-bit="no", than Character Size (8)="11", than Clock Polarity="n/a(0)".
//UBRR1=25; //38400 baud +0.2% error
UBRR1H=0;UBRR1L=25; //38400 baud +0.2% error
#endif
UCSR0A=BIN8(00000010); //state and error flags must be written as zero, than double speed = "yes", than multi-proc = "no".
UBRR0H=0;UBRR0L=0; //2 Mbaud !!!
PORTB=128; //White Level
DDRB =128; //pin 7 out
for (I=0;;I++)
{
for (i=0;i<3;i++)
{
for (j=0;j<12;j++)
{
for (;!(UCSR0A&0x20););
UDR0=BIN8(11111111); //Empty
}
for (;!(UCSR0A&0x20););
UDR0=BIN8(00000000); //HSync
}
for (i=0;i<304;i++)
{
for (;!(UCSR0A&0x20););
PORTB=0; //Black Level;
UDR0=VBuff[i*12];
for (;!(UCSR0A&0x20););
PORTB=128; //White Level;
UDR0=VBuff[i*12+1];
for (j=2;j<12;j++)
{
for (;!(UCSR0A&0x20););
UDR0=VBuff[i*12+j];
}
for (;!(UCSR0A&0x20););
UDR0=BIN8(00000000); //HSync
}
for (i=0;i<3;i++)
{
for (j=0;j<12;j++)
{
for (;!(UCSR0A&0x20););
PORTB=0; //Black Level;
UDR0=BIN8(11111111); //Empty
}
for (;!(UCSR0A&0x20););
UDR0=BIN8(00000000); //HSync
}
for (i=0;i<2;i++)
{
for (j=0;j<11;j++)
{
for (;!(UCSR0A&0x20););
UDR0=BIN8(00000000); //VSync
}
for (;!(UCSR0A&0x20););
UDR0=BIN8(11111111); //HSync
for (;!(UCSR0A&0x20););
UDR0=BIN8(00000000); //HSync
}
for (j=0;j<6;j++)
{
for (;!(UCSR0A&0x20););
UDR0=BIN8(00000000); //VSync
}
for (j=0;j<6;j++)
{
for (;!(UCSR0A&0x20););
UDR0=BIN8(11111111); //Half-line
}
for (;!(UCSR0A&0x20););
UDR0=BIN8(00000000); //HSync
for (i=0;i<3;i++)
{
for (j=0;j<12;j++)
{
for (;!(UCSR0A&0x20););
UDR0=BIN8(11111111); //Empty
}
for (;!(UCSR0A&0x20););
UDR0=BIN8(00000000); //HSync
}
for (i=0;i<304;i++)
{
for (;!(UCSR0A&0x20););
PORTB=0; //Black Level;
UDR0=VBuff[i*12];
for (;!(UCSR0A&0x20););
PORTB=128; //White Level;
UDR0=VBuff[i*12+1];
for (j=2;j<12;j++)
{
for (;!(UCSR0A&0x20););
UDR0=VBuff[i*12+j];
}
for (;!(UCSR0A&0x20););
UDR0=BIN8(00000000); //HSync
}
for (i=0;i<2;i++)
{
for (j=0;j<12;j++)
{
for (;!(UCSR0A&0x20););
PORTB=0; //Black Level;
UDR0=BIN8(11111111); //Empty
}
for (;!(UCSR0A&0x20););
UDR0=BIN8(00000000); //HSync
}
for (j=0;j<6;j++)
{
for (;!(UCSR0A&0x20););
UDR0=BIN8(11111111); //Half-line
}
for (j=0;j<5;j++)
{
for (;!(UCSR0A&0x20););
UDR0=BIN8(00000000); //VSync
}
for (;!(UCSR0A&0x20););
UDR0=BIN8(11111111); //HSync
for (;!(UCSR0A&0x20););
UDR0=BIN8(00000000); //HSync
for (i=0;i<2;i++)
{
for (j=0;j<11;j++)
{
for (;!(UCSR0A&0x20););
UDR0=BIN8(00000000); //VSync
}
for (;!(UCSR0A&0x20););
UDR0=BIN8(11111111); //HSync
for (;!(UCSR0A&0x20););
UDR0=BIN8(00000000); //HSync
}
}
}
2) Тактируйте на 16 МГц;
3) Смешайте сигнал с 3-й и 17-й ноги при помощи пары резисторов;
4) Подайте на видеовход ближайшего телека;
5) Узрите Явление :)
ЗЫ: построчный сигнал гашения лежит прямо в видеопамяти, что в корне бессмысленно. Да и не нужна она как таковая -- всякие графики лучше "на ходу" генерить и не тратить оперативу.
ЗЫЫ: на прерываниях это еще бы могло параллельно решать какие-то другие задачи, т. к. за вывод отдувается в основном порт.
ЗЫЫЫ: диаграммы и построения сигнала для разных тактовых частот могу выложить, если интересно.