CXEMATEKA.RU, © 2016 | Войти/Зарегистрироваться | In English

Читать всю тему: [+1223] ZX Spectrum «Ленинград 48к» - сборка, наладка, увеличение памяти, доработки, схемы, видео

Автор: Vadim
Кирилл, если под рукой есть Arduino, то можно проверить какие сигналы SCART-вход "переварит" с помощью следующей схемы:



и скетча:
/*
Vertical Bars Pattern PAL TV Signal Generator with Arduino

*/

#include
#include

///////////////////////////////////////////////////////////////////////////////////////
// Pins where the 2-bit DAC is connected

#define PINA0 6 // LSB, 1 kOhm resistor
#define PINA1 7 // MSB, 330 Ohm resistor

// PINA1 PINA0 OUTPUT
// 0 0 0.0V - Sync level
// 0 1 0.3V - Black level
// 1 0 0.6V - Gray level
// 1 1 1.0V - White level

#define LEVEL_SYNC PORTD &= ~(1 << PINA1); PORTD &= ~(1 << PINA0);
#define LEVEL_BLACK PORTD &= ~(1 << PINA1); PORTD |= 1 << PINA0;
#define LEVEL_GRAY PORTD |= 1 << PINA1; PORTD &= ~(1 << PINA0);
#define LEVEL_WHITE PORTD |= 1 << PINA1; PORTD |= 1 << PINA0;
///////////////////////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////////////////////////
inline void vsync_pulse()
{
LEVEL_SYNC;
_delay_us(30);
LEVEL_BLACK;
_delay_us(2);
}

///////////////////////////////////////////////////////////////////////////////////////
inline void equal_pulse()
{
LEVEL_SYNC;
_delay_us(2);
LEVEL_BLACK;
_delay_us(30);
}
///////////////////////////////////////////////////////////////////////////////////////
inline void hsync_pulse()
{
LEVEL_BLACK;
_delay_us(2); //2.2us
LEVEL_SYNC;
_delay_us(5); //4.6us
LEVEL_BLACK;
_delay_us(7); //6.9us
}

///////////////////////////////////////////////////////////////////////////////////////
int main()
{
register unsigned int line;

/* NOTE THAT THE SIGNAL GENERATED BY THIS PROGRAM HAS A NOT VERY ACCURATE TIMING SO
IT IS POSSIBLE THAT THE IMAGE BLINKS ON YOUR TV SCREEN OR DOESN'T SHOW AT ALL,
THIS PROGRAM WRITTEN IN C (INSTEAD OF ASSEMBLER) IS ONLY A PROOF OF CONCEPT */

line = 0;
DDRD = 0xFF; // PORTD, all pins are outputs

while(1)
{

if (line == 313)
{
line = 1;
}
else
{
line++;
}


switch(line)
{
case 1:
case 2:
vsync_pulse();
vsync_pulse();
break;

case 3:
vsync_pulse();
equal_pulse();
break;

case 4:
case 5:
case 310:
case 311:
case 312:
equal_pulse();
equal_pulse();
break;

default:
// Image scanline (not a sync line)

hsync_pulse(); // Horizontal Sync, lenght = 14us

LEVEL_GRAY;
_delay_us(8);
LEVEL_BLACK;
_delay_us(14);
LEVEL_WHITE;
_delay_us(8);
LEVEL_BLACK;
_delay_us(14);
LEVEL_GRAY;
_delay_us(6);
//50us in total
}
}
}

Полезный комментарий + 0 | Бесполезный комментарий - 0
вторник, 15 октября 17:47:17 2019    
Сообщений: 51

Просмотров страницы: 1,314,176

Программирование, оформление: Константин Айги
©2016 CXEMATEKA.RU