Forum Discussion
Altera_Forum
Honored Contributor
16 years agoHi Rama,
Your help is very precious. I am trying to put into practice what you told me but I still have a few problems... It does not work yet. The camera I am using is SDZ-375P and it is in PAL format (http://www.samsungcctvusa.com/products/productdetail.aspx?productid=55#). Thus, I don't really know which values to choose for the AVID start and Stop bit. I put 0 and 740 according to the DVI format but I don't think it's right. Furthermore, I don't understand how the pane register is coded. Each time I tried to change value (even with the mosaic model), it did not work. IOWR(video_in_base, 0x3 ,((640-318)*2 << 16) | (640-318)*2 ); //why 218 and not 320 ... ?in my case, it should be something like : " iowr(video_in_base, 0x3 , ((640-318)*4 << 16) | (640-318)*4 ); " because it is twice bigger (...) ? Do I have to specify somewhere that I am working in PAL format, for example by setting : " i2c_write(I2C_BASE, 0xb8>>1, 0x0f, 0x04); " I put a part of my code below for you to better understand my problems. while( i < 4); for(i=0;i<4;i++){ i2c_write(I2C_BASE, 0xb8>>1, 0xfe, (1<<i) ); // i2c_write(I2C_BASE, 0xb8>>1, 0x7f, 0x00); // // i2c_write(I2C_BASE, 0xb8>>1, 0x0f, 0x04); // PAL mode ? i2c_write(I2C_BASE, 0xb8>>1, 0x03,0x0D); // i2c_write(I2C_BASE, 0xb8>>1, 0x05,0x0C); // Enable Clock 2 output i2c_write(I2C_BASE, 0xb8>>1, 0x17,0x1B); i2c_write(I2C_BASE, 0xb8>>1, 0x15,0x81); // Enable Stable Sync mode i2c_write(I2C_BASE, 0xb8>>1, 0x00,0x00); // Select video source // Initialise video input cores IOWR(video_in_base, 0x0, 0 ); // stop channel
iowr(video_in_base, 0x2, IMAGE_MEMORY + video_in_addr);
iowr(video_in_base, 0x3 , ((640-318)*4 << 16) | 318*4 ); // ?? } // Main loop while ( 1 == 1 ) for(i=0;i<4;i++){ i2c_write(I2C_BASE, 0xb8>>1, 0xff, (1<<i) ); if(i2c_read(I2C_BASE, 0xb8>>1, 0x88) & 0x06)//Vertical sync and horizontal sync are locked { i2c_write(I2C_BASE, 0xb8>>1, 0xfe, (1<<i) ); i2c_write(I2C_BASE, 0xb8>>1, 0x1F, 0x00);// Disables the scaling. i2c_write(I2C_BASE, 0xb8>>1, 0x11, 0x00 ); //MSB de AVID start Video (0) i2c_write(I2C_BASE, 0xb8>>1, 0x12, 0x00 ); //LSB de AVID start Video(0) i2c_write(I2C_BASE, 0xb8>>1, 0x13, 0xB9 ); //MSB de AVID stop Video (740) i2c_write(I2C_BASE, 0xb8>>1, 0x14, 0x00 ); //LSB de AVID stop Video (740) /* // I think it is not useful i2c_write(I2C_BASE, 0xb8>>1, 0x18, 0x03 ); //Vertical Blanking Start Register (576) i2c_write(I2C_BASE, 0xb8>>1, 0x19, 0x03 ); //Vertical Blanking Stop Register (0) */ i2c_write(I2C_BASE, 0xb8>>1, 0xff, (1<<i) ); IOWR(video_in_base, 0x0, 1 ); // start channel
} else
iowr(video_in_base, 0x0, 0 ); // stop channel } Thank you for your patience, Myriam