cigraphics / arduino-tvout

Automatically exported from code.google.com/p/arduino-tvout
0 stars 0 forks source link

Vertical sync incorrect with PAL. #35

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Wire according to schematic
2. Connect to sync-sensitive PAL+NTSC monitor/TV
3. Load DemoPAL from 1-beta

What is the expected output? What do you see instead?
Expecting a stable demo, instead get a rolling display where vertical sync does 
not lock on. In my case, the monitor detects the signal as NTSC, and fails to 
sync, since TVOut tries to do PAL :)

What version of the product are you using? On what operating system?
TVOutBeta1 from 2010-12-03. Hardware is ATMega328p running at 16MHz.

Please provide any additional information below.
In TVOut/spec/video_properties.h (line 60), _PAL_LINE_STOP_VSYNC is defined to 
7. Seeing that the corresponding define for NTSC is 3, I assumed (did not look 
closely at source) that this corresponded to the sync-width in #-of-lines. NTSC 
should be 3, but PAL should be 2.5. By replacing the 7 for 2, I was able to get 
a proper vsync lock. I have not tried this fix with other monitors (yet).

To fix:
Find _PAL_LINE_STOP_VSYNC, replace 7 with 2.

Original issue reported on code.google.com by jon.lang...@gmail.com on 15 May 2011 at 4:05

GoogleCodeExporter commented 9 years ago
i also had this issue with the TVOutBeta1... [ i couldn't get the earlier 
versions to sync at all ]

i can confirm that employing jon's fix detailed above corrected the issue for 
me.

Original comment by i...@ushtey.com on 18 Jan 2012 at 10:52

GoogleCodeExporter commented 9 years ago
The vertical sync is messed up regardless of NTSC or PAL, I have made some 
improvements to NTSC but i haven't tried with PAL yet.  Don't expect anything 
to soon however...

Original comment by mdmetzle@gmail.com on 25 Jun 2012 at 1:36

GoogleCodeExporter commented 9 years ago
I have fixed the v-Sync-problem in the video_gen.cpp on line 98

original: 
void vsync_line() {
    if (display.scanLine >= display.lines_frame) {
        OCR1A = _CYCLES_VIRT_SYNC;
        display.scanLine = 0;
Fixed:
void vsync_line() {
    if (display.scanLine >= display.lines_frame) {
        OCR1A = _CYCLES_VIRT_SYNC;
        display.scanLine = -1; 

Original comment by lerrypag...@gmail.com on 26 Nov 2013 at 1:38

GoogleCodeExporter commented 9 years ago
Hello! I had the same problem. arduino nano 328p (Chinese copy) and ebay rear 
camera display. Vertical sync was not working and the image was scrolling down. 
I changed this and it works! 2 days to go. The right TV, the image function 
properly, but here little 4, 3 inch, it will not begin operating 

"
I have fixed the v-sync problem in the video_gen.cpp line 98 

original: 
void vsync_line () {
if (display.scanLine> = display.lines_frame) {
OCR1A = _CYCLES_VIRT_SYNC; 
display.scanLine = 0; 
Fixed: 
void vsync_line () {
if (display.scanLine> = display.lines_frame) {
OCR1A = _CYCLES_VIRT_SYNC; 
display.scanLine = -1; 
"

Original comment by Jonne.Ta...@gmail.com on 25 Feb 2014 at 7:23

GoogleCodeExporter commented 9 years ago
and yes. I had a PAL signal.

Original comment by Jonne.Ta...@gmail.com on 25 Feb 2014 at 7:24

GoogleCodeExporter commented 9 years ago
Works like a charm.

Original comment by philkazi...@gmail.com on 2 Aug 2014 at 11:21