A little HELP!!


Closed Thread
Page 1 of 2 12 LastLast
Results 1 to 40 of 77

Thread: A little HELP!!

  1. #1
    Join Date
    Mar 2011
    Location
    Los Angeles, California
    Posts
    322

    Question A little HELP!!

    Okay so I am still struggling with this code. In television there are three forms of video standards for different parts of the world. There is NTSC, which is the American standard, PAL a European standard and SECAM another standard. Most of the world uses either the NTSC or PAL standard. The basic difference is weather the power is 50 cycles per second (PAL) or 60 cycles per second (NTSC) as this is used for the timing of the television electronics. Since this STV5730 seems to display an out of sync picture most of the time my guess is that the code has the PAL standard embedded somewhere in it. I can see a display for a short time with the characters in the PIC code then it goes back to a scrambled sync signal. I have never seem an "overlay" display where the characters are superimposed over the incoming picture. I am hoping someone with much, much more knowledge than I have can tell me what to change in the code? Thanks in advance.

    Code:
    '****************************************************************
    '*  Name    : English OSD                                       *
    '*  Author  : Ed Cannady                                        *
    '*  Notice  : Copyright (c) 2017 [select VIEW...EDITOR OPTIONS] *
    '*          : All Rights Reserved                               *
    '*  Date    : 6/4/2017                                          *
    '*  Version : 1.0                                               *
    '*  Notes   :                                                   *
    '*          :                                                   *
    '****************************************************************
    'OSDCSX.bas version 2.0
    'Incruser with STV5730A and PIC 18F2520 - 20 MHz
    'Source for PICBasic PRO 
    'Risto Kõiva 2001, F1FCO & F6CSX, March 2003
    'Turns on F1UBZ insert (part RS232 / MAX232 useless) or demo board STV5730 
    'Page mode, color bars
    'Cyclic change of background color
    '23cm or 70cm band display according to pin 18 status (RA1)
    
    
    '** HARDWARE DEFINITION **
    Define OSC 20
    
    	CMCON = 7 'put the 18F2520 in digital mode on PORT A
        ADCON1 = $0F
    
    	Clk VAR PORTC.4
    	Sda VAR PORTC.5
    	Csn VAR PORTC.3
    	Mute VAR PORTB.7 '0 if sync valid, 1 if no sync
        mode VAR PORTB.3 'pin # 9, 0 = Page mode, 1 = Mixed mode
    	On_off VAR PORTA.2 'Stop the incruser: pin # 1, 0 = off, 1 = on	
    	Band VAR PORTA.1 'incrustation 23 cm if 0 or 70 cm if 1
    	
    INPUT Mode
    INPUT Mute
    INPUT On_off
    INPUT Band
    
    OUTPUT Clk
    OUTPUT Sda
    OUTPUT Csn
    
    '** DEFINITION OF VARIABLES **
    	
    	ICount VAR BYTE
    	Bit_Counter VAR BYTE
    	WData VAR WORD
    	C VAR WORD
    	B1 VAR BYTE
    	B2 VAR BIT
    	B3 VAR BIT
    	B4 VAR BIT
    	
    	W1 VAR BYTE
    	W2 VAR BYTE
    	
    '** START OF PROGRAM **
    	
    	GOSUB Init 'initialization
    	GOSUB Mode_mixed 'Mixed mode by default
    	GOSUB Display_mixed
    	b1 = 1
    	b2 = 1
    	b3 = 1	
    	c  = 0
    Looped:	
    
    	B1 = On_off
    	IF b1 = 0 THEN Incrust_off 'monitors the On_off button
    	B4 = Band
    	IF b4 = 0 THEN
    		W1= $02
    		W2= $03
    		ELSE
    		W1= $07
    		W2= $00
    	ENDIF
    		
    	B3 = MODE 'reads MODE
        
    	IF b3 = b2 THEN Jump 'does not change anything
    		
    	IF b3 = 1 THEN 'If MODE = 1: Mixed Mode, Picture Overlay
    		c = 0
    		GOSUB Mode_mixed
    		GOSUB Display_mixed 		
    		B2 = b3
    		ELSE 
    		GOSUB Mode_page 'Mode Page: Mire		
    		FOR c = 0 TO 6
    		WData = $00CD: GOSUB Send '(tip at address 13)
    		WData = $1000 + ($201 * c): GOSUB Send 'background color change 
    		GOSUB Display_page
    		PAUSE 2000
    		NEXT c
    		B3 = Mode 'reads mode
    		B2 = ~ b3 'b2 is not equal to b3, we do not jump and we start again
    	ENDIF 
    		
    	PAUSE 500
    	GOTO Looped		
    
    Jump:
    	PAUSE 200
    	GOTO Looped
    
    
    	END
    	
    '	disable debug
    '------------------------------------------------- -------------------------------------------------- -------------------------------------------------- ---------
    'No overlay. We go into mixed mode and we delete the screen
    Incrust_off:
     
    		GOSUB Mode_mixed
    		PAUSE 100
    		b1 = 1
    		B3 = Mode 'reads mode
    		B2 = ~ b3 'b2 is not equal to b3, we do not jump
    		GOTO Looped
    			
    '------------------------------------------------- -------------------------------------------------- -------------------------------------------------- ---------	
    'No Overlay
    Delete_Screen: 
    
    	c = 0
    	
        WData = 0: GOSUB Send 'tip top left of screen (0,0)
        c = 1
        FOR c = 1 TO 308 'on clears the screen with spaces (0B)
    	WData = $1700 + $0B: GOSUB Send '$1700: background disabled, white character not blinking
        NEXT c
        RETURN
    '------------------------------------------------- -------------------------------------------------- -------------------------------------------------- ---------    
    'display in overlay mode
    Display_mixed:
     
        WData = 0: GOSUB Send 'do not omit this line: position 0,0
        WData = $1780 + $6E: GOSUB Send 'flashing parable
        WData = $170B:        GOSUB Send 'space
        WData = $1700 + $11:  GOSUB Send 'F
        WData = $1700 + $06:  GOSUB Send '6	
        WData = $1700 + $0E:  GOSUB Send 'C	
        WData = $1700 + $1E:  GOSUB Send 'S
        WData = $1700 + $23:  GOSUB Send 'X
    
        WData = $170B:        GOSUB Send 'space
        WData = $170B:        GOSUB Send 'space
        WData = $170B:        GOSUB Send 'space
              
        WData = $1700 + $18:  GOSUB Send 'M   
        WData = $1700 + $0C:  GOSUB Send 'A
        WData = $1700 + $1D:  GOSUB Send 'R
        WData = $1700 + $1E:  GOSUB Send 'S
        WData = $1700 + $10:  GOSUB Send 'E 
        WData = $1700 + $14:  GOSUB Send 'I
        WData = $1700 + $17:  GOSUB Send 'L	
        WData = $1700 + $17:  GOSUB Send 'L
        WData = $1700 + $10:  GOSUB Send 'E	
        
        WData = $170B:        GOSUB Send 'space
        WData = $170B:        GOSUB Send 'space
        WData = $170B:        GOSUB Send 'space    
        
        WData = $1700 + $15:  GOSUB Send 'J   
        WData = $1700 + $19:  GOSUB Send 'N
        WData = $1700 + $02:  GOSUB Send '2
        WData = $1700 + $03:  GOSUB Send '3
        WData = $1700 + $1D:  GOSUB Send 'R 
        WData = $1700 + $13:  GOSUB Send 'H
      		
    	PAUSE 1000	 
    	RETURN
    '------------------------------------------------- -------------------------------------------------- -------------------------------------------------- ---------
    'display in page mode
    Display_page: 
    
    'First line in Max Zoom
      
        WData = 0:           GOSUB Send 'do not omit this line: position 0,0 Line 0
        WData = $1F0B:       GOSUB Send 'space
        WData = $1F00 + $11: GOSUB Send 'F with blue background
        WData = $1F00 + $06: GOSUB Send '6	
        WData = $1F00 + $0E: GOSUB Send 'C	
        WData = $1F00 + $1E: GOSUB Send 'S
        WData = $1F00 + $23: GOSUB Send 'X
    
    
        WData = $100:         GOSUB Send 'line 1
        WData = $170B:        GOSUB Send 'space
        WData = $170B:        GOSUB Send 'space
        WData = $1700 + $1A:  GOSUB Send 'O with black background
        WData = $1700 + $39:  GOSUB Send 'p
        WData = $1700 + $26:  GOSUB Send ':
        WData = $1700 + $15:  GOSUB Send 'J
        WData = $1700 + $1A:  GOSUB Send 'O
        WData = $1700 + $10:  GOSUB Send 'E
        WData = $1700 + $17:  GOSUB Send 'L
        WData = $170B:        GOSUB Send 'space
        WData = $170B:        GOSUB Send 'space
        WData = $170B:        GOSUB Send 'space
        WData = $170B:        GOSUB Send 'space
         
        WData = $1700 + $1C:  GOSUB Send 'Q
        WData = $1700 + $1F:  GOSUB Send 'T
        WData = $1700 + $13:  GOSUB Send 'H   
        WData = $1700 + $26:  GOSUB Send ':    
        WData = $1700 + $18:  GOSUB Send 'M   
        WData = $1700 + $0C:  GOSUB Send 'A
        WData = $1700 + $1D:  GOSUB Send 'R
        WData = $1700 + $1E:  GOSUB Send 'S
        WData = $1700 + $10:  GOSUB Send 'E 
        WData = $1700 + $14:  GOSUB Send 'I
        WData = $1700 + $17:  GOSUB Send 'L	
        WData = $1700 + $17:  GOSUB Send 'L
        WData = $1700 + $10:  GOSUB Send 'E
     
        WData = $200:         GOSUB Send 'line 2 
        WData = $1700 + $1E:  GOSUB Send 'S
        WData = $1700 + $1A:  GOSUB Send 'O 
        WData = $1700 + $19:  GOSUB Send 'N    
        WData = $1700 + $26:  GOSUB Send ': 
        WData = $1700 + $01:  GOSUB Send '1
        WData = $1700 + $04:  GOSUB Send '4    
        WData = $1700 + $05:  GOSUB Send '5
        WData = $1700 + $27:  GOSUB Send '. 
        WData = $1700 + $02:  GOSUB Send '2
        WData = $1700 + $02:  GOSUB Send '2    
        WData = $1700 + $05:  GOSUB Send '5
        WData = $1700 + $18:  GOSUB Send 'M 
        WData = $1700 + $13:  GOSUB Send 'H    
        WData = $1700 + $43:  GOSUB Send 'z
        WData = $170B:        GOSUB Send 'space    
        WData = $1700 + $38:  GOSUB Send 'o
        WData = $1700 + $3E:  GOSUB Send 'u      
        WData = $170B:        GOSUB Send 'space
        WData = $1700 + $01:  GOSUB Send '1
        WData = $1700 + $04:  GOSUB Send '4    
        WData = $1700 + $05:  GOSUB Send '5    
        WData = $1700 + $27:  GOSUB Send '. 
        WData = $1700 + $04:  GOSUB Send '4   
        WData = $1700 + $00:  GOSUB Send '0     
        WData = $1700 + $00:  GOSUB Send '0
        WData = $1700 + $18:  GOSUB Send 'M 
        WData = $1700 + $13:  GOSUB Send 'H    
        WData = $1700 + $43:  GOSUB Send 'z    
           
                                             
     'Color bars, 4 lines  
       
     FOR iCount = $0 TO $3
        WData = $300 + $100 * iCount: GOSUB Send 'to the beginning of line 3
        
        	
        WData = $170B:        GOSUB Send 'space
        WData = $170B:        GOSUB Send 'space
        
        WData = $1877:        GOSUB Send 'black
        WData = $1877:        GOSUB Send
        WData = $1877:        GOSUB Send
    
        WData = $1977:        GOSUB Send
        WData = $1977:        GOSUB Send
        WData = $1977:        GOSUB Send
    
        WData = $1A77:        GOSUB Send
        WData = $1A77:        GOSUB Send
        WData = $1A77:        GOSUB Send
    
        WData = $1B77:        GOSUB Send
        WData = $1B77:        GOSUB Send
        WData = $1B77:        GOSUB Send
    
        WData = $1C77:        GOSUB Send
        WData = $1C77:        GOSUB Send
        WData = $1C77:        GOSUB Send
    
        WData = $1D77:        GOSUB Send
        WData = $1D77:        GOSUB Send
        WData = $1D77:        GOSUB Send    
    
        WData = $1E77:        GOSUB Send
        WData = $1E77:        GOSUB Send
        WData = $1E77:        GOSUB Send    
    
        WData = $1F77:        GOSUB Send
        WData = $1F77:        GOSUB Send
        WData = $1F77:        GOSUB Send 'white
        NEXT iCount  
    
    	
    	WData = $700:         GOSUB Send
    	FOR iCount = $1 TO $8
        WData = $170B: GOSUB Send 'space
        NEXT iCount 
    	WData = $1700 + $5F:  GOSUB Send '*
    	WData = $1700 + $5F:  GOSUB Send '*
    	WData = $1700 + $5F:  GOSUB Send '*
    	WData = $170B:        GOSUB Send 'space
    	WData = $1780 + W1:   GOSUB Send '2 or 7
       	WData = $1780 + W2:   GOSUB Send '3 or 0
       	WData = $1780 + $2C:  GOSUB Send 'c
       	WData = $1780 + $36:  GOSUB Send 'm
       	WData = $170B:        GOSUB Send 'space
       	WData = $1700 + $5F:  GOSUB Send '*
    	WData = $1700 + $5F:  GOSUB Send '*
    	WData = $1700 + $5F:  GOSUB Send '*
       	
       
        PAUSE 1000	
    	
        RETURN
    '------------------------------------------------- -------------------------------------------------- -------------------------------------------------- ---------
    WasteTime: 'timer 2 clock cycles 
    	ASM
    	  nop
    	  nop
    	ENDASM
    	RETURN
    '------------------------------------------------- -------------------------------------------------- -------------------------------------------------- ---------
    StartCommunication: 'Start of transmission Fig 2 page 12 manual STV5730A
    	HIGH Clk: GOSUB WasteTime 'Clock to 1
    	LOW  Csn: GOSUB WasteTime 'Chip select to 0
    	LOW  Clk: GOSUB WasteTime 'Clock at 0
    	RETURN
    '------------------------------------------------- -------------------------------------------------- -------------------------------------------------- ---------
    StopCommunication: 'end of transmission 
    	HIGH Clk: GOSUB WasteTime 'Clock to 1
    	HIGH Csn: GOSUB WasteTime 'Chip select to 1
    	RETURN
    '------------------------------------------------- -------------------------------------------------- -------------------------------------------------- ---------
    SendOne: 'Send a bit 0
    	HIGH Sda: GOSUB WasteTime
    	LOW  Clk: GOSUB WasteTime
    	HIGH Clk: GOSUB WasteTime
    	RETURN
    '------------------------------------------------- -------------------------------------------------- -------------------------------------------------- ---------
    SendZero: 'sending a bit 1
    	LOW  Sda: GOSUB WasteTime
    	LOW  Clk: GOSUB WasteTime
    	HIGH Clk: GOSUB WasteTime
    	HIGH Sda: GOSUB WasteTime
    	RETURN
    '------------------------------------------------- -------------------------------------------------- -------------------------------------------------- ---------
    OutByte: 'send a 16 bit word
    	FOR Bit_Counter = 1 TO 16
        IF wData.15 = 1 THEN 'MSB first
        GOSUB SendOne
        ELSE
        GOSUB SendZero
        ENDIF
        WData = wData << 1
    	NEXT Bit_Counter
    	RETURN
    '------------------------------------------------- -------------------------------------------------- -------------------------------------------------- ---------
    Send:
    	GOSUB StartCommunication
    	GOSUB OutByte
    	GOSUB StopCommunication
    	RETURN
    '------------------------------------------------- -------------------------------------------------- -------------------------------------------------- ---------'** INITIALIZATION (see page 12 of the DATA SHEET STV5730)
    
    
    Init:
    
    
    	HIGH Clk: HIGH Sda: HIGH Csn
    	WData = $3000: GOSUB Send 'Init STV5730
    	WData = $3000: GOSUB Send
    	WData = $00DB: GOSUB Send
    	WData = $1000: GOSUB Send
    	RETURN
    '------------------------------------------------- -------------------------------------------------- -------------------------------------------------- ---------	
    'PAGE MODE INITIALIZATION
    Mode_page: 
    
    	WData = $00CC: GOSUB Send 'Registry initialization (tip at address 12)
    	WData = $150F: GOSUB Send 'Zoom 
    	WData = $1201: GOSUB Send 'Color 
    	WData = $1FC5: GOSUB Send 'Control
    	WData = $15A1: GOSUB Send 'Position (horizontal 33, Vertical 22)
    	WData = $193E: GOSUB Send 'Fashion 
    
    	WData = $00C0: GOSUB Send 'Set row attributes (tip to first line address)
        WData = $10C4: GOSUB Send '(vertical position = 4, characters with border, characters displayed, horizontal position = 0)
        WData = $10C4: GOSUB Send '(vertical position = 4, characters with border, characters displayed, horizontal position = 0)
        WData = $10C4: GOSUB Send '(vertical position = 4, characters with border, characters displayed, horizontal position = 0)
    	WData = $10C8: GOSUB Send
    	FOR iCount = 0 TO 2	
        WData = $10C0: GOSUB Send '(vertical position = 0, characters with border, characters displayed, horizontal position = 0)
    	NEXT iCount 'Same for the next 10 lines
        WData = $10C8
    	 
        GOSUB Delete_Screen
    	RETURN
    
    '------------------------------------------------- -------------------------------------------------- -------------------------------------------------- ---------
    Mode_mixed: 'INITIALIZATION IN JOINT MODE
    
    	WData = $00CC: GOSUB Send 'Registry initialization (tip at address 12)
    	WData = $1000: GOSUB Send 'Zoom (1pixel / dot - 1 pixel / line)
    	WData = $1204: GOSUB Send 'Color (red background, line, character background)
    	WData = $1FD4: GOSUB Send 'Control (mixed mode, character background controlled by BE, display on, color character by character attribute
    				'0.5s flashing, duty cycle 0.5, STV sync, PAL, external luminance level, normal full page mode 
    	WData = $15A1: GOSUB Send 'Position (horizontal 33, Vertical 22)
    	WData = $183E: GOSUB Send 'Mode (disconnected BAR, synch pulse detection, internal mute, 32-line mute time, re-inserted sync, 6dB video gain
    				'Color coder in use, video out2 = video in, video out2 low impedance, normal mode, no delay compensation,
    				'M sync with vertical sync
    
    	WData = $00C0: GOSUB Send 'Set row attributes (tip to first line address)
    	FOR iCount = 0 TO 10	
        WData = $10C4: GOSUB Send '(vertical position = 4, characters with border, characters displayed, horizontal position = 0)
    	NEXT iCount 'Same for the following lines
    	GOSUB Delete_screen
    	RETURN
    Best, Ed
    Last edited by Demon; - 16th June 2017 at 19:40. Reason: Code tags

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,516


    Did you find this post helpful? Yes | No

    Default Re: A little HELP!!

    Hi Ed,
    Don't you have two or three threads regarding this already, is there a need for yet a new one? And can you please use the appropriate code-tags when posting code. Doing so preserves the indentation of the code making it easier to read. Anyhow...

    Do you have the correct crystal frequency for NTSC clocking the STV5730A?

    I only took a brief look in the datasheet (and I don't have any experience with the chip) but it looks to me like PAL/NTCS is selected by bit 8 in the control register (0=NTSC, 1=PAL) in your code there are two places where it seems to set the control register (at least that's what the comments says) and both places have BIT 8 = 1 (ie PAL).

    In the Mode_Page subroutine
    Code:
    WData = $1FC5: GOSUB Send 'Control
    In the Mode_Mixed subroutine
    Code:
    WData = $1FD4: GOSUB Send
    If PAL/NTCS switch is the problem that's where you need to change the code.

    /Henrik.

    EDIT: I see you that you probably tried to use the code tags but got the syntax wrong so thumbs up for trying at least :-)

  3. #3
    Join Date
    Mar 2011
    Location
    Los Angeles, California
    Posts
    322


    Did you find this post helpful? Yes | No

    Default Re: A little HELP!!

    Thanks Henrik!
    I thought the syntax was to place "Code:" before doing a paste of the code? I tried to find your original syntax instructions and keep getting "invalid forum option". How do I expand the "$1FC5" and "$1FD4" to see the bit pattern?

  4. #4
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,516


    Did you find this post helpful? Yes | No

    Default Re: A little HELP!!

    Hi Ed,
    Use a calculator capable of displaying hex, decimal, binary (such as the one included in Windows) or, if you want an exercise, use a pen and a piece of paper.

    What clock frequency are you using for chip?

    Please see this link for the vBulletin syntax.

    /Henrik.

  5. #5
    Join Date
    Mar 2011
    Location
    Los Angeles, California
    Posts
    322


    Did you find this post helpful? Yes | No

    Default Re: A little HELP!!

    Hi Henrik!
    Thank you again! The xtal is 14.318. (NTSC) I have to go to the dentist today for a some surgery so I will look at the hex to binary after that. My guess is I am only looking at the last two digits, just the C5 in $1FC5?

  6. #6
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,516


    Did you find this post helpful? Yes | No

    Default Re: A little HELP!!

    No, the registers are 16 bits wide, bits are labeled 0-15 (as usual) and you're interested in bit 8 (ie the 9th bit) which would then be the least significant bit in the high byte of the 16-bit Word. But really, look at it at as one 16bit value, convert the hex value you have to binary and compart at against the datasheet.

    In fact, do that for "everything" and you might find something else that isn't right for your application - and you'll learn a lot.

    /Henrik.

  7. #7
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,588


    Did you find this post helpful? Yes | No

    Default Re: A little HELP!!

    Code: is inserted by the system.

    [ Code ] at start.
    [ / Code ] at end.

    without spaces
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  8. #8
    Join Date
    Mar 2011
    Location
    Los Angeles, California
    Posts
    322


    Did you find this post helpful? Yes | No

    Default Re: A little HELP!!

    Thank you! I forgot the brackets! Boy do I feel dumb! Back to the code, so I did a hex to binary and binary to hex and came up with $1FC5 should be $1085 and $1FD4 should be $1284. It did not make a change so it must be something else or I did not convert correctly?

  9. #9
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,516


    Did you find this post helpful? Yes | No

    Default Re: A little HELP!!

    No, that doesn't look correct to me.
    $1FC5 = 0001 1111 1100 0101
    $1085 = 0001 0000 1000 0101

    That's a lot more changes than one bit.

    /Henrik.

  10. #10
    Join Date
    Mar 2011
    Location
    Los Angeles, California
    Posts
    322


    Did you find this post helpful? Yes | No

    Default Re: A little HELP!!

    I probably tried to do too much at one time such as turn off the blinking, set it to mixed mode, etc.

  11. #11
    Join Date
    Mar 2011
    Location
    Los Angeles, California
    Posts
    322


    Did you find this post helpful? Yes | No

    Default Re: A little HELP!!

    Okay so I did just the one bit change making it $1EC5. It helped. the $1FD4 I made $1ED4. Some how the video with text is being placed below the sync level! I can see sync, burst, and the video appears to be below the sync pulse! The sync pulse should be a negative .3 volts while video is positive .7 volts. Maybe I have a bad chip? There is also a "Mode Register" and I thought it had a value of $00CC and I think I am looking at the wrong register?

  12. #12
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,516


    Did you find this post helpful? Yes | No

    Default Re: A little HELP!!

    Hi Ed,
    If you're talking about the line WData = $00CC: GOSUB Send it's a command that makes the address pointer in the chip point at address 12 (which apparently is the Zoom register and makes the pointer increment automatically for each data write following the command. The mode register is at address 16 so, as far as I can see, it is being set to either $183E or $193E depending on which of the two subroutines are being called.

    /Henrik.

  13. #13
    Join Date
    Mar 2011
    Location
    Los Angeles, California
    Posts
    322


    Did you find this post helpful? Yes | No

    Default Re: A little HELP!!

    Hi Henrik!
    Again thank you, thank you, thank you! Some settings do not make any sense to me. $183E for example sets M8 to a low impedance state while $193E sets M8 to a high impedance state. It would seem that M8 should be high impedance at all times. I did try to e-mail the author and the e-mail bounced. The first picture is of the video out. Note the bar at the bottom which is below the sync level and should be at the top. Second picture shows what a TV will display. The third photo shows the input video (color bars). Note nothing is below the sync level.
    Attached Images Attached Images    

  14. #14
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,516


    Did you find this post helpful? Yes | No

    Default Re: A little HELP!!

    I'm afraid I don't know how it's supposed to configured to do what you want and I don't have much experience with composite video signals. All I can do is read the datasheet....

    /Henrik.

  15. #15
    Join Date
    Mar 2011
    Location
    Los Angeles, California
    Posts
    322


    Did you find this post helpful? Yes | No

    Default Re: A little HELP!!

    Hi Henrik!
    Not a problem, at least you are not working with the new digital format of video signals! There are just a bunch of settings that are possible and why certain choices were made make absolutely no sense to me. For example, unless you have some type of noise problems, low impedance is rarely used. In the mode register there is an option to use the BAR pin and a CSYNC pin which suggests to me you can input your incoming video signal and use it as a reference for the sync pulses. The M7 bit appears to output the video in signal which to me would say it ignores any text insertion i.e. bypasses the function of the chip. Since I am also a ham radio operator (WB6NSN) the guy who wrote the program is also a ham (F6CSX) so I will try his e-mail address list on the international ham radio listing. Hopefully he knows English. I certainly do appreciate more than I can express my sincerest thanks for all your help. Just for informational purposes only, in the first picture, the three what look like bars is called color burst as is a reference signal to make sure the colors are correct. Just before the bars are the horizontal sync pulses which go down, across, and up much like a 3 sided rectangle. Below the sync pulses should only be the vertical sync pulses and it is showing the text video which should be above the horizontal sync pulse level. No idea why the video is looking like this or how it went negative. I am not giving up yet! Best, Ed

  16. #16


    Did you find this post helpful? Yes | No

    Default Re: A little HELP!!

    Hi, I have dug out some code I used for this chip, but it is PAL, you should be able to change the appropriate bit(s) to NTSC.

    It puts the word TEST. on 3rd line at right hand side of the screen.

    It also detects synchs and will auto switch mode as necessary, and when there is no incoming video it will display that No Synchs message on screen.

    I have modified the code from the original, it had a lot of debug stuff in it, I have not tested since although it should work, (it compiles OK) , I post to let you check the values in the code you have.

    I will try and test in the next few days when I get some video stuff resurected.

    Just a note it is much easier to put the values in as binary eg %0000000011001100 rather than have to work it out when debugging.

    Code:
    '****************************************************************
    '*  Name    : STV-SYNCHS RELEASE                          *
    '*  Author  : BOB LEGGETT                                       *
    '*  Notice  : Copyright (c) 2009                                *
    '*          : All Rights Reserved                               *
    '*  Date    : around 2009 or so rehashed now '17         *
    '*  Version : 1.0                                               *
    '*  Notes   :   VIDEO IDENT                                *
    '*          :                                                   *
    '****************************************************************
    
    
    
    '   WORKS USES SYNC FOR SWITCHING BETWEEN MIXED AND FULL TEXT MODE
    '   GOING FROM VID IN TO TEXT AND BACK TO VID IN
    
    @ device PIC16F628A,HS_OSC,BOD_ON,MCLR_ON,PWRT_ON 
    
            INCLUDE "ALLDIGITAL.pbp"
            
        define  OSC 4
        
         
    'TV CHIP CONNECTIONS
     
    
     
    '---------------------------------------------------------------
    
     '16f628a
     
    	  TVSDA     		VAR PORTB.1    '0     OUTPUT  pin 11 stv
     	CS0     		VAR PORTB.0 '0       OUTPUT pin 13 stv
    	TVSCL     		VAR PORTB.5    '0    OUTPUT  pin 12 stv
       SYNCH0          VAR PORTB.2 '1       'INPUT    to pin 7 stvchip
       HEARTBEAT        VAR PORTB.6     'OUTPUT 0  led
    '---------------------------------------------------------------
    
        ZOOMREG         CON %0000000011001100       ' 12 ZOOM REGISTER
        COLREG          CON %0000000011001101       ' 13 COLOUR REGISTER
        CONREG          CON %0000000011001110       ' 14 CONTROL REGISTER
        POSREG          CON %0000000011001111       ' 15 POSITION REGISTER 
        MODEREG         CON %0000000011010000       ' 16 MODE REGISTER
    
        
    	ICOUNT  		VAR BYTE
    	BITCOUNTER 	VAR BYTE
    	WDATA   		VAR WORD
    	CHARCOUNTER	VAR BYTE '  
    	LINECOUNTER	VAR BYTE '
    
    
         STVCHAR VAR BYTE
        ASCCHAR VAR BYTE
        CHARS VAR BYTE
        CHARS2 VAR BYTE
        TEMP    VAR BYTE 
        TEMP1   VAR BYTE
         COUNTER VAR BYTE
         PULSES VAR BYTE
        CURRENTMODE0 VAR BYTE
    
    '----------------------------------------------------------------     
    '    TOPLEFT          CON 0
    '    TOPMIDDLE       CON 5
    '    TOPRIGHT        CON 10
    '    BOTLEFT         CON 2560    '10*256
    '    BOTMIDDLE       CON 2565 '(10*256)+ 5
    '    BOTRIGHT        CON 2570 '(10*256)+ 10
    '---------------------------------------------------------------- 
    
        DATA @0,"TEST.",$FF,"NO SYNCHS RECEIVED",$FF   
    
    
    
    '---------------------------------------------------------------- 
    '628
      TRISB=%10011100
    '----------------------------------------------------------------     
    
    
        PAUSE 500
        
        HIGH HEARTBEAT
        
        
    	GOSUB Init
    	
        PAUSE 500
    	GOSUB Init
        
        CURRENTMODE0=255         ' FORCES TRYSYNCHS TO SET MODE FIRST TIME
    
    	
    Demo:
    
    CHARCOUNTER = 0
    	LINECOUNTER = 0
    '    CURRENTMODE0 = 0     '0 = MIXED 1 = TEXT
        gosub CLS
        GOSUB TRYSYNCHS      '==================================
    
    
        TEMP = 0
      
         
    
    LOOPER:
        GOSUB HEADER   ' LINE 3 RIGHT HAND SIDE TEST.
        IF CURRENTMODE0=1 THEN
        GOSUB NOVIDEO   ' DISPLAYS NO VIDEO IF NO INCOMING SYNCHS
        ENDIF
    
        
        GOSUB TRYSYNCHS       '===========================
        
    
        PAUSE 500            'I/2 SECOND DELAY
        TOGGLE HEARTBEAT      ' LED
        GOTO LOOPER          'DO IT FOREVER
      
    
    DISPLAYCHAR:   
    
        WDATA = %0001011100000000 + STVCHAR
        GOSUB SEND 
         RETURN
    SETLINE:    
    	WDATA = LINECOUNTER*256 + CHARCOUNTER
        GOSUB Send              'position cursor   
        RETURN
    
    
    
    WasteTime:        ' WORKS WITH LESS NOPS
    
    
    
        pauseus 20    ' was 20 nops
    
    	RETURN
    
    StartCommunication:
    	TVSCL = 1 'HIGH TVSCL 
        GOSUB WasteTime
    
        CS0 = 0 'LOW CS0
    
        GOSUB WasteTime
    	TVSCL = 0 'LOW TVSCL
        GOSUB WasteTime
    	RETURN
    
    StopCommunication:
    	TVSCL = 1 'HIGH TVSCL
        GOSUB WasteTime
        CS0 = 1 'HIGH CS0
    
        GOSUB WasteTime
    	RETURN
    
    SendOne:
    	TVSDA = 1 'HIGH TVSDA
        GOSUB WasteTime
    	TVSCL = 0 'LOW  TVSCL
        GOSUB WasteTime
    	TVSCL = 1 'HIGH TVSCL
        GOSUB WasteTime
    	RETURN
    
    SendZero:
    	TVSDA = 0 'LOW TVSDA
        GOSUB WasteTime
    	TVSCL = 0 ' LOW TVSCL
        GOSUB WasteTime
    	TVSCL = 1 'HIGH TVSCL
        GOSUB WasteTime
    	TVSDA = 1 'HIGH TVSDA
        GOSUB WasteTime
    	RETURN
    
    OutByte:
    	FOR BITCOUNTER = 1 TO 16
    	 IF WDATA.15 = 1 THEN
    	  GOSUB SendOne
    	 ELSE
    	  GOSUB SendZero
    	 ENDIF
    	 WDATA = WDATA << 1
    	NEXT BITCOUNTER
    	RETURN
    
    Send:
    	GOSUB StartCommunication
    	GOSUB OutByte
    	GOSUB StopCommunication
    	RETURN
    
    '-------------------------------------------------------------  
    
    Init:     '    PAUSE 50 added - seems to improve reliability of init
    
    	TVSCL = 1 'HIGH TVSCL
        TVSDA = 1 'HIGH TVSDA
        CS0 = 1 'HIGH CS0
     
    	WDATA = $3000  '%110000 00000000
        GOSUB Send ' Init STV5730
        PAUSE 50
    	WDATA = $3000
        GOSUB Send
        PAUSE 50
    	WDATA = $00DB  '%00000000 11011011
        GOSUB Send
        PAUSE 50
    	WDATA = $1000  '%00010000 00000000
        GOSUB Send
        PAUSE 50
    '-------------------------------------------------------------  
    	WDATA = %0000000011001100
        GOSUB Send ' Init registers (point to register 12)
        PAUSE 50
    '-------------------------------------------------------------      
    	WDATA = %0001000000000000   'NORMAL
    '  WDATA = %0001000011110000   '4 PIXELS HORIZ AND VERT
        GOSUB Send ' Zoom    ADDRESS 12
        PAUSE 50
    '-------------------------------------------------------------      
    	WDATA = %0001001000000000
    
    '    	WDATA = %0001001000000100
             GOSUB Send ' Color    ADDRESS 13
             PAUSE 50
    '--------------------------------------------------------
    
        WDATA=  %0001101111010100
                'CHANGE BIT 0 TO 1 FOR TEXT ONLY
        GOSUB Send ' Control    ADDRESS 14
    '-------------------------------------------------------------    
    	WDATA = %0001011111001111
        GOSUB Send ' Position    ADDRESS 15
    '------------------------------------------------------------- 
    
       
    	WDATA = %0001000100101110 '$183E BIT 11 CHANGED TO 0  M4 = 0
       
        GOSUB Send ' Mode    ADDRESS 16  %0001100000111110
    
    '------------------------------------------------------------- 
     
    	WDATA = $00C0   '%00000000 11000000
        GOSUB Send ' Set row attributes
         
    	FOR ICOUNT = 0 TO 10
    	 WDATA = $10C4 '%00010000 11000100
      	' WDATA =%0001000010000111
         GOSUB Send
    	NEXT ICOUNT
    	RETURN
     
    CLS: 
        'character=$0B       'SPACE
         TEMP1=0   ' LINECOUNTER
         TEMP =0    'CHARCOUNTER
    loop2:
        
    	WDATA = 0  ' LINECOUNTER*256 + CHARCOUNTER   ADDRESS
        GOSUB Send
        
    
    LOOP3:    '                :CHARACTERS        
    	WDATA = %0001011100001011  '     1011 0BH SPACECHARACTER
        GOSUB Send
    	TEMP = TEMP + 1
    	IF TEMP >= 28 THEN
        TEMP = 0
        TEMP1=TEMP1 + 1
    	ENDIF
    	IF TEMP1 >= 11 THEN SCREENBLANK
     	
        GOTO LOOP3
        
    SCREENBLANK:
    	RETURN
    
    GETSTVCHAR:                  'CONVERT ASCII TO STV
            STVCHAR =$7F   ' FORCES CLOCK PICTURE IF ERROR         
           LOOKDOWN ASCCHAR,["0123456789- ABCDEFGHIJKLMNOPQRSTUVWXYZ:./'abcdefghijklmnopqrstuvwxyz"],STVCHAR
                   RETURN 
    
    HEADER:
        LINECOUNTER=2       'SET START POSITION
        CHARCOUNTER=23      'SET CURSOR POSITION
        GOSUB SETLINE
        FOR CHARS2=0 TO 4
        READ CHARS2, ASCCHAR
        gosub GETSTVCHAR    'CONVERT ASCII TO STV
        GOSUB DISPLAYCHAR
        NEXT
        RETURN
        
    NOVIDEO:
        LINECOUNTER=5       'SET START POSITION
        CHARCOUNTER=4       'SET CURSOR POSITION
        GOSUB SETLINE
        FOR CHARS2=6 TO 23      ' FROM EEPROM DATA
        READ CHARS2, ASCCHAR
        gosub GETSTVCHAR    'CONVERT ASCII TO STV
        GOSUB DISPLAYCHAR
        NEXT
        RETURN
        
    TRYSYNCHS:
        
        PULSES=0
    
        COUNT SYNCH0,4,PULSES   '3MS SHOULD COUNT TO 2 OR 3
        IF PULSES > 0 THEN MIXED0
    FULL0:
    
        IF CURRENTMODE0=1 THEN RETURN
    
        WDATA=  %0000000011001110       'CONTROL REGISTER
        GOSUB SEND
        WDATA=  %0001101111010101
                'CHANGE BIT 0 TO 1 FOR TEXT ONLY       OTIGINAL
                
     '     WDATA=  %0001101111010100
                'CHANGE BIT 0 TO 1 FOR TEXT ONLY        
        GOSUB SEND
    
    STAYHERE02:
      
        CURRENTMODE0=1
            GOSUB CLS
    GOBACK0:
        RETURN
    
    
    MIXED0:
        IF CURRENTMODE0=0 THEN RETURN
        WDATA=  %0000000011001110       'CONTROL REGISTER
        GOSUB SEND
        WDATA=  %0001101111010100
        GOSUB SEND
    
    STAYHERE01:
    
        CURRENTMODE0=0
        GOSUB CLS
        RETURN
    Darrel Taylor ALLDIGITAL.pbp if you do not have it.

    Code:
    ;***************************************************************************
    ;*  Name    : ALLDIGITAL.pbp                                               *
    ;*  Author  : Darrel Taylor                                                *
    ;*  Notice  : Copyright (c) 2009                                           *
    ;*          : All Rights Reserved until Abused                             *
    ;*  Date    : 4/30/2009                                                    *
    ;*  Version : 1.5 (3/7/2011)                                               *
    ;*  Notes   : An INCLUDE file that will automatically enable               *
    ;*          : all DIGITAL Inputs multiplexed with the ADC or Comparators   *
    ;*          : Works with ANY PIC, using either PM or MPASM                 *
    ;***************************************************************************
    ;*  Useage  : INCLUDE "AllDigital.pbp"                                     *
    ;*          :   yup, that's it. Just include the file and it's All Digital *
    ;*          : Adding this line to your program will display the values     *
    ;*          :   used to achieve AllDigital ... (if using MPASM)            *
    ;*          :   DEFINE SHOWDIGITAL 1                                       *
    ;***************************************************************************
    ;*  Versions: 1.0 - Initial release                                        *
    ;* 5/6/2009 : 1.1 - Added Shared address SFR support for 18F87J50 family   *
    ;*          :       Thanks to mister_e                                     *
    ;* 5/9/2009 : 1.2 - Removed MPASM specific opcode (variable), for PM.exe   *
    ;*          :       Thanks to Tobias                                       *
    ;* 7/11/2009: 1.3 - Added ANSELA,ANSELB,ANSELD,ANSELE for the 16F72x series*
    ;* 7/19/2010: 1.4 - Added ANSEL0 and ANSEL1 for the 18F4431 series.        *
    ;*  3/7/2011: 1.5 - Update for latest chips from Microchip                 *
    ;***************************************************************************
    
    ;Check 18F45k80 ----
    ; Uses ANCONx with ANSEL0 and ANSEL1 as bit names
    ; other PIC's have ANSEL0 and ANSEL1
    
    ASM
    ;----[Module defaults]------------------------------------------------------
      #define SHOWDIGITALDEFAULT  0
      ifdef SHOWDIGITAL
    SHOWDIGITALRESULT = SHOWDIGITAL
      else
    SHOWDIGITALRESULT = SHOWDIGITALDEFAULT
      endif
      ifndef PM_USED
        ifndef ADLISTALL
          nolist
        endif
      endif
      
    ;----[Attempt to Set a registers Value]-------------------------------------
    SetReg  macro RegOut, Cin
        ifndef PM_USED
          ifndef ADLISTALL
            nolist
          endif
        endif
        
        ifdef RegOut
          ifndef PM_USED
            list
          endif
          MOVE?CB  Cin, RegOut
          if (SHOWDIGITALRESULT == 1)
            ifndef PM_USED
              messg RegOut = Cin
            endif
          endif
          ifndef PM_USED
            ifndef ADLISTALL
              nolist
            endif
          endif
        endif
      endm
      
    ;----[A/D Converter registers]----------------------------------------------
    HasANSEL = 0
      ifdef ANSEL
    HasANSEL = 1
        SetReg  ANSEL , 0             ; if chip has ANSEL's, clear them
      endif
      ifdef ANSEL0
        ifndef ANCON0
    HasANSEL = 1
            SetReg  ANSEL0, 0
        endif
      endif
      ifdef ANSEL1
        ifndef ANCON0
    HasANSEL = 1
          SetReg  ANSEL1, 0
        endif
      endif
      ifdef ANSELA
    HasANSEL = 1
        SetReg  ANSELA, 0
      endif
      ifdef ANSELB
    HasANSEL = 1
        SetReg  ANSELB, 0
      endif
      ifdef ANSELC
    HasANSEL = 1
        SetReg  ANSELC, 0
      endif
      ifdef ANSELD
    HasANSEL = 1
        SetReg  ANSELD, 0
      endif
      ifdef ANSELE
    HasANSEL = 1
        SetReg  ANSELE, 0
      endif
      ifdef ANSELF
    HasANSEL = 1
        SetReg  ANSELF, 0
      endif
      ifdef ANSELG
    HasANSEL = 1
        SetReg  ANSELG, 0
      endif
      ifdef ANSELH
    HasANSEL = 1
        SetReg  ANSELH, 0
      endif
      ifdef ANSELI
    HasANSEL = 1
        SetReg  ANSELI, 0
      endif
      ifdef ANSELJ
    HasANSEL = 1
        SetReg  ANSELJ, 0
      endif
      ifdef ANSELK
    HasANSEL = 1
        SetReg  ANSELK, 0
      endif
      if (HasANSEL == 0)
        ifdef ANCON0                  ; Several chips use ANCON0 and ANCON1
          ifdef ADSHR                 ; if chip has shared address SFR's
            MOVE?CT  1, WDTCON,ADSHR  ;   switch to shared address registers
            if (SHOWDIGITALRESULT == 1)
              messg WDTCON.4 = 1
            endif
          endif
          SetReg  ANCON0, 0xFF        ;  
          ifdef PCFG15                ;  0 = Analog with these bits
            SetReg  ANCON1, 0xFF
          else
            SetReg  ANCON1, 0x7F
          endif
          ifdef ADSHR                 ; if chip has shared address SFR's
            MOVE?CT  0, WDTCON,ADSHR  ;   put SFR's back to legacy
            if (SHOWDIGITALRESULT == 1)
              messg WDTCON.4 = 0
            endif
          endif
        else
          ifdef PCFG6                 ; Some chips use ADCON1 bits
            SetReg ADCON1, 0x7F       ;  the same way as ANCONx
          else
            ifdef PCFG3               ; if there's a PCFG3 bit
              ifdef ADCON2            ;  but has no ADCON2, more than 8 A/D's
                SetReg  ADCON1, 0x0F  ;   A/D cfg from table = 0x0F
              else
                SetReg  ADCON1, 7     ; most common, 8 or less A/D ch's
              endif
            else
              ifdef PCFG2
                ifdef ADCON1
                  SetReg  ADCON1, 7   ; A/D is 8-bit, 5 ch's
                endif
              else
                ifdef ADCON0          ; if there's an ADCON0
                  ifndef ADCON1       ;  but not an ADCON1
                    SetReg  ADCON0, 0 ;  A/D is 8-bit and ADS bits are in ADCON0
                  endif
                endif
              endif
            endif
          endif
        endif
      endif
        
    ;----[Comparators]----------------------------------------------------------
      ifdef CMCON
        ifdef CMEN0       ; 18F1230/1330
          ;SetReg CMCON, 0 ; default already
        else
          ifdef CM2
            SetReg CMCON, 7
          else
            ifdef PM_USED
              "ALLDIGITAL: CMCON value not found"
            else
              messg "ALLDIGITAL: CMCON value not found"
            endif
          endif
        endif
      endif
      
      ifdef CMCON0
        ifdef NOT_COUTEN            
          SetReg CMCON0, 0xF1       ; 10F204/206
        else
          ifdef CMCH
            SetReg CMCON0, 0        ; 12F609/615
          else
            ifdef CM2
              SetReg CMCON0, 7      ; 12F635/683, 
            else                    ; 16F636/639/684/688/913/914/916/917/946
              ifndef PM_USED
                "ALLDIGITAL: CMCON0 value not found"
              else  
                messg "ALLDIGITAL: CMCON0 value not found"
              endif  
            endif
          endif
        endif
      endif
      
      ifdef CM1CON0                 ; individual comparator controls
        ifdef NOT_C1OUTEN           
          SetReg CM1CON0, 0xF1      ; 12F510/506, 16F526
        else
    ;      SetReg CM1CON0, 0         ; these already default to 0 --------------
        endif                       ; 16F882/883/884/886/887/ 610/616
      endif                         ; 16F631/677/685/687/689/690
                                    
                                    ; these aren't 0, but default to OFF
                                    ; 18F24J11/25J11/26J11/44J11/45J11/46J11
                                    ; 18F24J50/25J50/26J50/44J50/45J50/46J50
      ifdef CM2CON0
        ifdef NOT_C2OUTEN            
          SetReg CM2CON0, 0xF1
        else
    ;      SetReg CM2CON0, 0         ; already default to 0 -----see above-
        endif
      endif
        
    ; CM1CON                      ; these aren't 0, but default to OFF
                                  ; 18F65J50/66J50/66J55/67J50/66J11/66J16/67J11
    ; CM2CON                      ; 18F85J50/86J50/86J55/87J50/86J11/86J16/87J11
    
      ifndef PM_USED
        list
      endif
    ENDASM

  17. #17
    Join Date
    Mar 2011
    Location
    Los Angeles, California
    Posts
    322


    Did you find this post helpful? Yes | No

    Default Re: A little HELP!!

    Thank you! Thank you! Thank you! It will be exciting to try it.

    Ed

  18. #18


    Did you find this post helpful? Yes | No

    Default Re: A little HELP!!

    Hi,

    I have compiled and programmed a 16f628a and it all works fine.

    Pics a bit fuzzy due slow shutter.

    Remember the code posted is the PAL version you need to change the bit(s) for NTSC.

    Cannot test on NTSC as no suitable equipment.


    Name:  STV-OVERLAY.JPG
Views: 1787
Size:  246.1 KBName:  STV-TEXTMODE.JPG
Views: 1794
Size:  275.8 KB

  19. #19
    Join Date
    Mar 2011
    Location
    Los Angeles, California
    Posts
    322


    Did you find this post helpful? Yes | No

    Default Re: A little HELP!!

    Wow! Looks Great! Would you know which bits to change? I ask since I was not successful with my previous program.

    Thanks, Ed

  20. #20


    Did you find this post helpful? Yes | No

    Default Re: A little HELP!!

    looks like it is bit 8 of control regester for NTSC



    Search for %0000000011001110

    Immediately below you will see gosub send, this points the chip to address 14

    the next instruction is the actual values that are to be sent
    change bit 8 to be a 0

    There are 3 places I think that need to be changed

    in label FULL0: and MIXED0: and INIT:

    FULL0:

    IF CURRENTMODE0=1 THEN RETURN

    WDATA= %0000000011001110 'CONTROL REGISTER
    GOSUB SEND
    WDATA= %0001101111010101 ' <<<<< change bit 8 to 0 (far right is bit zero)


    FULL0:

    IF CURRENTMODE0=1 THEN RETURN


    WDATA= %0000000011001110 'CONTROL REGISTER
    GOSUB SEND
    WDATA= %0001101111010101 ' <<<< change bit 8 to a 0 (far right is bit zero)


    In the init routine look for this

    WDATA= %0001101111010100 ' change bit 8 to a 0 (far right is bit zero)
    'CHANGE BIT 0 TO 1 FOR TEXT ONLY
    GOSUB Send ' Control ADDRESS 14


    I do not think anything else needs to be done - but I could be wrong.!!

    The init routine for the chip under certain circumstances will auto up the address, that is why there is no
    WDATA= %0000000011001110 'CONTROL REGISTER
    prior to it.

    Sorry cannot help much more on the settings.

  21. #21


    Did you find this post helpful? Yes | No

    Default Re: A little HELP!!

    Looks likely I can run a partial test on NTSC, I have found the appropriate crystal deep in the odd box, and I have the possible loan of a multi monitor, it is rather old but if it still works it will do NTSC.

    I have found the original picbasic files on the web, and that compiles fine for 16F628a. The only thing I have to change are the port numbers to suit my pic/sstv board, all operations will be unchanged.

    I do not have a NTSC source, so it would not be a full test, but if text appears, then that should at least prove the NTSC side is working.

    It will be a few days before I get the chance to do this.

    In the meantime please post if you get your board working on NTSC.

  22. #22
    Join Date
    Mar 2011
    Location
    Los Angeles, California
    Posts
    322


    Did you find this post helpful? Yes | No

    Default Re: A little HELP!!

    Hi Aerostar!
    I cannot tell how much I appreciate what you are doing! The same as you I have to make some port changes to accommodate wiring. I think I set the TRISB settings correctly and well as the register changes you recommended. This is probably going to sound strange and when I run the code it gets stuck (stops) at "Pause 500"! not sure why?
    Code:
     '****************************************************************
    '*  Name    : STV-SYNCHS RELEASE                          *
    '*  Author  : BOB LEGGETT                                       *
    '*  Notice  : Copyright (c) 2009                                *
    '*          : All Rights Reserved                               *
    '*  Date    : around 2009 or so rehashed now '17         *
    '*  Version : 1.0                                               *
    '*  Notes   :   VIDEO IDENT                                *
    '*          :                                                   *
    '****************************************************************
    
    '   WORKS USES SYNC FOR SWITCHING BETWEEN MIXED AND FULL TEXT MODE
    '   GOING FROM VID IN TO TEXT AND BACK TO VID IN
    
    INCLUDE "ALLDIGITAL.pbp"
            
    define  OSC 20
    
    #CONFIG
        __config _HS_OSC & _WDT_ON & _MCLRE_ON & _LVP_OFF & _CP_OFF
    #ENDCONFIG
    
            
    'TV CHIP CONNECTIONS
     
     
    '---------------------------------------------------------------
    
     '16f628a
     
     TVSDA     		VAR PORTB.4    '0     OUTPUT  pin 11 stv was b.1
     CS0     		VAR PORTB.6    '0     OUTPUT pin 13 stv was b.0
     TVSCL     		VAR PORTB.5    '0     OUTPUT  pin 12 stv was b.5
     SYNCH0         VAR PORTB.7    '1     'INPUT    to pin 7 stvchip was b.2
     HEARTBEAT      VAR PORTB.6           'OUTPUT 0  led was b.6
    '---------------------------------------------------------------
    
        ZOOMREG         CON %0000000011001100       ' 12 ZOOM REGISTER
        COLREG          CON %0000000011001101       ' 13 COLOUR REGISTER
        CONREG          CON %0000000011001110       ' 14 CONTROL REGISTER
        POSREG          CON %0000000011001111       ' 15 POSITION REGISTER 
        MODEREG         CON %0000000011010000       ' 16 MODE REGISTER
    
        
    	ICOUNT  		VAR BYTE
    	BITCOUNTER 	    VAR BYTE
    	WDATA   		VAR WORD
    	CHARCOUNTER	    VAR BYTE '  
    	LINECOUNTER	    VAR BYTE '
    
        STVCHAR         VAR BYTE
        ASCCHAR         VAR BYTE
        CHARS           VAR BYTE
        CHARS2          VAR BYTE
        TEMP            VAR BYTE 
        TEMP1           VAR BYTE
        COUNTER         VAR BYTE
        PULSES          VAR BYTE
        CURRENTMODE0    VAR BYTE
    
    '----------------------------------------------------------------     
    '    TOPLEFT         CON 0
    '    TOPMIDDLE       CON 5
    '    TOPRIGHT        CON 10
    '    BOTLEFT         CON 2560    '10*256
    '    BOTMIDDLE       CON 2565 '(10*256)+ 5
    '    BOTRIGHT        CON 2570 '(10*256)+ 10
    '---------------------------------------------------------------- 
    
        DATA @0,"TEST.",$FF,"NO SYNCHS RECEIVED",$FF   
    
    
    
    '---------------------------------------------------------------- 
    '628
      TRISB=%10000100
    '----------------------------------------------------------------     
    
    
        PAUSE 500
        
        HIGH HEARTBEAT
        
        
    	GOSUB Init
    	
        PAUSE 500
    	GOSUB Init
        
        CURRENTMODE0=255         ' FORCES TRYSYNCHS TO SET MODE FIRST TIME
    
    	
    Demo:
    
        CHARCOUNTER = 0
    	LINECOUNTER = 0
    '   CURRENTMODE0 = 0     '0 = MIXED 1 = TEXT
        gosub CLS
        GOSUB TRYSYNCHS      '==================================
    
    
        TEMP = 0
      
         
    
    LOOPER:
        GOSUB HEADER    ' LINE 3 RIGHT HAND SIDE TEST.
        IF CURRENTMODE0=1 THEN
        GOSUB NOVIDEO   ' DISPLAYS NO VIDEO IF NO INCOMING SYNCHS
        ENDIF
    
        
        GOSUB TRYSYNCHS       '===========================
        
    
        PAUSE 500            'I/2 SECOND DELAY
        TOGGLE HEARTBEAT      ' LED
        GOTO LOOPER          'DO IT FOREVER
      
    
    DISPLAYCHAR:   
    
        WDATA = %0001011100000000 + STVCHAR
        GOSUB SEND 
        RETURN
    SETLINE:    
    	WDATA = LINECOUNTER*256 + CHARCOUNTER
        GOSUB Send              'position cursor   
        RETURN
    
    
    
    WasteTime:        ' WORKS WITH LESS NOPS
    
    
    
        pauseus 20    ' was 20 nops
    
    	RETURN
    
    StartCommunication:
    	TVSCL = 1 'HIGH TVSCL 
        GOSUB WasteTime
    
        CS0 = 0 'LOW CS0
    
        GOSUB WasteTime
    	TVSCL = 0 'LOW TVSCL
        GOSUB WasteTime
    	RETURN
    
    StopCommunication:
    	TVSCL = 1 'HIGH TVSCL
        GOSUB WasteTime
        CS0 = 1 'HIGH CS0
    
        GOSUB WasteTime
    	RETURN
    
    SendOne:
    	TVSDA = 1 'HIGH TVSDA
        GOSUB WasteTime
    	TVSCL = 0 'LOW  TVSCL
        GOSUB WasteTime
    	TVSCL = 1 'HIGH TVSCL
        GOSUB WasteTime
    	RETURN
    
    SendZero:
    	TVSDA = 0 'LOW TVSDA
        GOSUB WasteTime
    	TVSCL = 0 ' LOW TVSCL
        GOSUB WasteTime
    	TVSCL = 1 'HIGH TVSCL
        GOSUB WasteTime
    	TVSDA = 1 'HIGH TVSDA
        GOSUB WasteTime
    	RETURN
    
    OutByte:
    	FOR   BITCOUNTER = 1 TO 16
        IF    WDATA.15 = 1 THEN
        GOSUB SendOne                       
        ELSE
        GOSUB SendZero
        ENDIF
              WDATA = WDATA << 1
    	NEXT  BITCOUNTER
    	RETURN
    
    Send:
    	GOSUB StartCommunication
    	GOSUB OutByte
    	GOSUB StopCommunication
    	RETURN
    
    '-------------------------------------------------------------  
    
    Init:     '    PAUSE 50 added - seems to improve reliability of init
    
    	TVSCL = 1 'HIGH TVSCL
        TVSDA = 1 'HIGH TVSDA
        CS0   = 1 'HIGH CS0
     
    	WDATA = $3000  '%110000 00000000
        GOSUB Send ' Init STV5730
        PAUSE 50
    	WDATA = $3000
        GOSUB Send
        PAUSE 50
    	WDATA = $00DB  '%00000000 11011011
        GOSUB Send
        PAUSE 50
    	WDATA = $1000  '%00010000 00000000
        GOSUB Send
        PAUSE 50
    '-------------------------------------------------------------  
    	WDATA = %0000000011001100
        GOSUB Send ' Init registers (point to register 12)
        PAUSE 50
    '-------------------------------------------------------------      
    	WDATA = %0001000000000000   'NORMAL
    '   WDATA = %0001000011110000   '4 PIXELS HORIZ AND VERT
        GOSUB Send ' Zoom    ADDRESS 12
        PAUSE 50
    '-------------------------------------------------------------      
    	WDATA = %0001001000000000
    
    '   WDATA = %0001001000000100
        GOSUB Send ' Color    ADDRESS 13
        PAUSE 50
    '--------------------------------------------------------
    
        WDATA=  %0001101011010100
                'CHANGE BIT 0 TO 1 FOR TEXT ONLY
        GOSUB Send ' Control    ADDRESS 14
    '-------------------------------------------------------------    
    	WDATA = %0001011111001111
        GOSUB Send ' Position    ADDRESS 15
    '------------------------------------------------------------- 
    
       
    	WDATA = %0001000100101110 '$183E BIT 11 CHANGED TO 0  M4 = 0
       
        GOSUB Send ' Mode    ADDRESS 16  %0001100000111110
    
    '------------------------------------------------------------- 
     
    	WDATA = $00C0   '%00000000 11000000
        GOSUB Send      ' Set row attributes
         
    	FOR ICOUNT = 0 TO 10
        WDATA = $10C4 '%00010000 11000100
                      ' WDATA =%0001000010000111
        GOSUB Send
    	NEXT ICOUNT
    	RETURN
     
    CLS: 
        'character=$0B       'SPACE
         TEMP1=0   ' LINECOUNTER
         TEMP =0    'CHARCOUNTER
    loop2:
        
    	WDATA = 0  ' LINECOUNTER*256 + CHARCOUNTER   ADDRESS
        GOSUB Send
        
    
    LOOP3:    '                :CHARACTERS        
    	WDATA = %0001011100001011  '     1011 0BH SPACECHARACTER
        GOSUB Send
    	TEMP = TEMP + 1
    	IF TEMP >= 28 THEN
        TEMP = 0
        TEMP1=TEMP1 + 1
    	ENDIF
    	IF TEMP1 >= 11 THEN SCREENBLANK
     	
        GOTO LOOP3
        
    SCREENBLANK:
    	RETURN
    
    GETSTVCHAR:                  'CONVERT ASCII TO STV
        STVCHAR =$7F   ' FORCES CLOCK PICTURE IF ERROR         
        LOOKDOWN ASCCHAR,["0123456789- ABCDEFGHIJKLMNOPQRSTUVWXYZ:./'abcdefghijklmnopqrstuvwxyz"],STVCHAR
        RETURN 
    
    HEADER:
        LINECOUNTER=2       'SET START POSITION
        CHARCOUNTER=23      'SET CURSOR POSITION
        GOSUB SETLINE
        FOR CHARS2=0 TO 4
        READ CHARS2, ASCCHAR
        gosub GETSTVCHAR    'CONVERT ASCII TO STV
        GOSUB DISPLAYCHAR
        NEXT
        RETURN
        
    NOVIDEO:
        LINECOUNTER=5       'SET START POSITION
        CHARCOUNTER=4       'SET CURSOR POSITION
        GOSUB SETLINE
        FOR CHARS2=6 TO 23      ' FROM EEPROM DATA
        READ CHARS2, ASCCHAR
        gosub GETSTVCHAR    'CONVERT ASCII TO STV
        GOSUB DISPLAYCHAR
        NEXT
        RETURN
        
    TRYSYNCHS:
        
        PULSES=0
    
        COUNT SYNCH0,4,PULSES   '3MS SHOULD COUNT TO 2 OR 3
        IF PULSES > 0 THEN MIXED0
    FULL0:
    
        IF CURRENTMODE0=1 THEN RETURN
    
        WDATA=  %0000000011001110       'CONTROL REGISTER
        GOSUB SEND
        WDATA=  %0001101011010101 ' was 0001101111010101
       'CHANGE BIT 0 TO 1 FOR TEXT ONLY       OTIGINAL
                
       'WDATA=  %0001101111010100
       'CHANGE BIT 0 TO 1 FOR TEXT ONLY        
        GOSUB SEND
    
    STAYHERE02:
      
        CURRENTMODE0=1
        GOSUB CLS
    GOBACK0:
        RETURN
    
    
    MIXED0:
        IF CURRENTMODE0=0 THEN RETURN
        WDATA=  %0000000011001110       'CONTROL REGISTER
        GOSUB SEND
        WDATA=  %0001101011010101  'was 0001101111010100
        GOSUB SEND
    
    STAYHERE01:
    
        CURRENTMODE0=0
        GOSUB CLS
        RETURN

    I hope I pasted the code correctly this time!!!

    Best, Ed

  23. #23


    Did you find this post helpful? Yes | No

    Default Re: A little HELP!!

    Have just glanced at your code, first thing I noticed was


    You have 2 declarations for Port B.6 this may well be your problem

    TVSDA VAR PORTB.4 '0 OUTPUT pin 11 stv was b.1
    CS0 VAR PORTB.6 '0 OUTPUT pin 13 stv was b.0 <<<<<<<<<<<<<<<<<<<<<<<<<
    TVSCL VAR PORTB.5 '0 OUTPUT pin 12 stv was b.5
    SYNCH0 VAR PORTB.7 '1 'INPUT to pin 7 stvchip was b.2
    HEARTBEAT VAR PORTB.6 'OUTPUT 0 led was b.6 <<<<<<<<<<<<<<<<<<<<<<<<<<<<


    I will have another look tomorrow as it is bedtime over here (UK) and I am tired.


    Thought.... as you are only using digital ports PORT B you do not need the include file.
    The file just makes all Analog ports digital - it works fine on 628a and others BUT may not work on newer chips, as I mostly use these or similar.
    Last edited by aerostar; - 23rd June 2017 at 00:20. Reason: Added info re Alldigital

  24. #24
    Join Date
    Mar 2011
    Location
    Los Angeles, California
    Posts
    322


    Did you find this post helpful? Yes | No

    Default Re: A little HELP!!

    I will try that a little later. Right now the program freezes right after the TRISB statement at the Pause 500. Comment out the Pause 500 at it stops at the High Heartbeat! I am so confused!

  25. #25


    Did you find this post helpful? Yes | No

    Default Re: A little HELP!!

    I have got the monitor that does NTSC, changing the appropriate bit 8 in the register 14 and with the 14.318 xtal in the STV board, I get a picture with readable text, see below.

    However the display is not in the correct place and there is no colour. Further investigation needed!!

    It sort of looks like the timing is wrong somewhere probably another setting needs to be changed.

    Name:  NTSC 1.jpg
Views: 1600
Size:  243.2 KB

  26. #26
    Join Date
    Mar 2011
    Location
    Los Angeles, California
    Posts
    322


    Did you find this post helpful? Yes | No

    Default Re: A little HELP!!

    Looks Great! I am still stuck with my program freezing right after the TRISB statement at the Pause 500. Comment out the Pause 500 at it stops at the High Heartbeat! I am so confused!

  27. #27


    Did you find this post helpful? Yes | No

    Default Re: A little HELP!!

    News

    I have NTSC display full colour and in the correct position. Problem was low voltage on my STV board, when that was fixed it worked straight away.

    Code attached
    Program your 628a with the hex code, if it works on your 628A then you have a compiler prob or something, if it does not work you may have a naff 628a.

    Also I compile with Picbasic Pro Ver 2.60C - I think you compile using MPLAB, not sure of your PB version, try compiling the 628a code with the PBP compiler.

    heartbeat led remarked out

    cmcon added in, but not needed as you are not using port A

    TRIS B changed to reflect your ports use.


    Code:
    '****************************************************************
    '*  Name    : STV-SYNCHS RELEASE                          *
    '*  Author  : BOB LEGGETT                                       *
    '*  Notice  : Copyright (c) 2009                                *
    '*          : All Rights Reserved                               *
    '*  Date    : around 2009 or so rehashed now '17         *
    '*  Version : 1.0                                               *
    '*  Notes   :   VIDEO IDENT                                *
    '*          :                                                   *
    '****************************************************************
    
    
    
    '   WORKS USES SYNC FOR SWITCHING BETWEEN MIXED AND FULL TEXT MODE
    '   GOING FROM VID IN TO TEXT AND BACK TO VID IN
    
    @ device PIC16f628a,HS_OSC,BOD_ON,MCLR_ON,PWRT_ON 
    
       
            
        define  OSC 20
        
         
    'TV CHIP CONNECTIONS
     
    
     
    '---------------------------------------------------------------
       '16f628a  ED definitions
     
     TVSDA     		VAR PORTB.4    '0     OUTPUT  pin 11 stv was b.1
     CS0     		VAR PORTB.6    '0     OUTPUT pin 13 stv was b.0
     TVSCL     		VAR PORTB.5    '0     OUTPUT  pin 12 stv was b.5
     SYNCH0         VAR PORTB.7    '1     'INPUT    to pin 7 stvchip was b.2
     'HEARTBEAT      VAR PORTB.6           'OUTPUT 0  led was b.6
    '--------------------------------------------------------------- 
    
    '16f628a 
          
    '	  TVSDA     		VAR PORTB.1    '0     OUTPUT  pin 11 stv
    ' 	CS0     		VAR PORTB.0 '0       OUTPUT pin 13 stv
    '	TVSCL     		VAR PORTB.5    '0    OUTPUT  pin 12 stv
    '   SYNCH0          VAR PORTB.2 '1       'INPUT    to pin 7 stvchip
    '   HEARTBEAT        VAR PORTB.6     'OUTPUT 0  led
    '---------------------------------------------------------------
    
        ZOOMREG         CON %0000000011001100       ' 12 ZOOM REGISTER
        COLREG          CON %0000000011001101       ' 13 COLOUR REGISTER
        CONREG          CON %0000000011001110       ' 14 CONTROL REGISTER
        POSREG          CON %0000000011001111       ' 15 POSITION REGISTER 
        MODEREG         CON %0000000011010000       ' 16 MODE REGISTER
    
        
          
    	ICOUNT  		VAR BYTE
    	BITCOUNTER 	VAR BYTE
    	WDATA   		VAR WORD
    	CHARCOUNTER	VAR BYTE '  
    	LINECOUNTER	VAR BYTE '
    
    
         STVCHAR VAR BYTE
        ASCCHAR VAR BYTE
        CHARS VAR BYTE
        CHARS2 VAR BYTE
        TEMP    VAR BYTE 
        TEMP1   VAR BYTE
         COUNTER VAR BYTE
         PULSES VAR BYTE
        CURRENTMODE0 VAR BYTE
    
    '----------------------------------------------------------------     
    '    TOPLEFT          CON 0
    '    TOPMIDDLE       CON 5
    '    TOPRIGHT        CON 10
    '    BOTLEFT         CON 2560    '10*256
    '    BOTMIDDLE       CON 2565 '(10*256)+ 5
    '    BOTRIGHT        CON 2570 '(10*256)+ 10
    '---------------------------------------------------------------- 
    
        DATA @0,"NTSC ",$FF,"NO SYNCHS RECEIVED",$FF   
    
    
    
    '---------------------------------------------------------------- 
    '628
    '  TRISB=%10011100
      TRISB = %10001111
      CMCON=7
    '----------------------------------------------------------------     
    
    
        PAUSE 500
        
    '    HIGH HEARTBEAT
        
        
    	GOSUB Init
    	
        PAUSE 500
    	GOSUB Init
        
        CURRENTMODE0=255         ' FORCES TRYSYNCHS TO SET MODE FIRST TIME
    
    	
    Demo:
    
    CHARCOUNTER = 0
    	LINECOUNTER = 0
    '    CURRENTMODE0 = 0     '0 = MIXED 1 = TEXT
        gosub CLS
        GOSUB TRYSYNCHS      '==================================
    
    
        TEMP = 0
      
         
    
    LOOPER:
        GOSUB HEADER   ' LINE 3 RIGHT HAND SIDE TEST.
        IF CURRENTMODE0=1 THEN
        GOSUB NOVIDEO   ' DISPLAYS NO VIDEO IF NO INCOMING SYNCHS
        ENDIF
    
        
        GOSUB TRYSYNCHS       '===========================
        
    
    '    PAUSE 500            'I/2 SECOND DELAY
    '    TOGGLE HEARTBEAT      ' LED
        GOTO LOOPER          'DO IT FOREVER
      
    
    DISPLAYCHAR:   
    
        WDATA = %0001011100000000 + STVCHAR
        GOSUB SEND 
         RETURN
    SETLINE:    
    	WDATA = LINECOUNTER*256 + CHARCOUNTER
        GOSUB Send              'position cursor   
        RETURN
    
    
    
    WasteTime:        ' WORKS WITH LESS NOPS
    
    
    
        pauseus 20    ' was 20 nops
    
    	RETURN
    
    StartCommunication:
    	TVSCL = 1 'HIGH TVSCL 
        GOSUB WasteTime
    
        CS0 = 0 'LOW CS0
    
        GOSUB WasteTime
    	TVSCL = 0 'LOW TVSCL
        GOSUB WasteTime
    	RETURN
    
    StopCommunication:
    	TVSCL = 1 'HIGH TVSCL
        GOSUB WasteTime
        CS0 = 1 'HIGH CS0
    
        GOSUB WasteTime
    	RETURN
    
    SendOne:
    	TVSDA = 1 'HIGH TVSDA
        GOSUB WasteTime
    	TVSCL = 0 'LOW  TVSCL
        GOSUB WasteTime
    	TVSCL = 1 'HIGH TVSCL
        GOSUB WasteTime
    	RETURN
    
    SendZero:
    	TVSDA = 0 'LOW TVSDA
        GOSUB WasteTime
    	TVSCL = 0 ' LOW TVSCL
        GOSUB WasteTime
    	TVSCL = 1 'HIGH TVSCL
        GOSUB WasteTime
    	TVSDA = 1 'HIGH TVSDA
        GOSUB WasteTime
    	RETURN
    
    OutByte:
    	FOR BITCOUNTER = 1 TO 16
    	 IF WDATA.15 = 1 THEN
    	  GOSUB SendOne
    	 ELSE
    	  GOSUB SendZero
    	 ENDIF
    	 WDATA = WDATA << 1
    	NEXT BITCOUNTER
    	RETURN
    
    Send:
    	GOSUB StartCommunication
    	GOSUB OutByte
    	GOSUB StopCommunication
    	RETURN
    
    '-------------------------------------------------------------  
    
    Init:     '    PAUSE 50 added - seems to improve reliability of init
    
    	TVSCL = 1 'HIGH TVSCL
        TVSDA = 1 'HIGH TVSDA
        CS0 = 1 'HIGH CS0
     
    	WDATA = $3000  '%110000 00000000
        GOSUB Send ' Init STV5730
        PAUSE 50
    	WDATA = $3000
        GOSUB Send
        PAUSE 50
    	WDATA = $00DB  '%00000000 11011011
        GOSUB Send
        PAUSE 50
    	WDATA = $1000  '%00010000 00000000
        GOSUB Send
        PAUSE 50
    '-------------------------------------------------------------  
    	WDATA = %0000000011001100
        GOSUB Send ' Init registers (point to register 12)
        PAUSE 50
    '-------------------------------------------------------------      
    	WDATA = %0001000000000000   'NORMAL
    '  WDATA = %0001000011110000   '4 PIXELS HORIZ AND VERT
        GOSUB Send ' Zoom    ADDRESS 12
        PAUSE 50
    '-------------------------------------------------------------      
    	WDATA = %0001001000000000
    
    '    	WDATA = %0001001000000100
             GOSUB Send ' Color    ADDRESS 13
             PAUSE 50
    '--------------------------------------------------------
                
     
         WDATA=  %0001101011010100    'BIT 8 = 0 FOR NTSC
    
     
         
                'CHANGE BIT 0 TO 1 FOR TEXT ONLY
        GOSUB Send ' Control    ADDRESS 14
    '-------------------------------------------------------------    
    	WDATA = %0001011111001111
        GOSUB Send ' Position    ADDRESS 15
    '------------------------------------------------------------- 
    
       
    	WDATA = %0001000000101110 '$183E BIT 11 CHANGED TO 0  M4 = 0
           GOSUB Send ' Mode    ADDRESS 16  %0001100000111110
    
    '------------------------------------------------------------- 
     
    	WDATA = $00C0   '%00000000 11000000
        GOSUB Send ' Set row attributes
         
    	FOR ICOUNT = 0 TO 10
    	 WDATA = $10C4 '%00010000 11000100
      	' WDATA =%0001000010000111
         GOSUB Send
    	NEXT ICOUNT
    	RETURN
     
    CLS: 
        'character=$0B       'SPACE
         TEMP1=0   ' LINECOUNTER
         TEMP =0    'CHARCOUNTER
    loop2:
        
    	WDATA = 0  ' LINECOUNTER*256 + CHARCOUNTER   ADDRESS
        GOSUB Send
        
    
    LOOP3:    '                :CHARACTERS        
    	WDATA = %0001011100001011  '     1011 0BH SPACECHARACTER
        GOSUB Send
    	TEMP = TEMP + 1
    	IF TEMP >= 28 THEN
        TEMP = 0
        TEMP1=TEMP1 + 1
    	ENDIF
    	IF TEMP1 >= 11 THEN SCREENBLANK
     	
        GOTO LOOP3
        
    SCREENBLANK:
    	RETURN
    
    GETSTVCHAR:                  'CONVERT ASCII TO STV
            STVCHAR =$7F   ' FORCES CLOCK PICTURE IF ERROR         
           LOOKDOWN ASCCHAR,["0123456789- ABCDEFGHIJKLMNOPQRSTUVWXYZ:./'abcdefghijklmnopqrstuvwxyz"],STVCHAR
                   RETURN 
    
    HEADER:
        LINECOUNTER=2       'SET START POSITION
        CHARCOUNTER=23      'SET CURSOR POSITION
        GOSUB SETLINE
        FOR CHARS2=0 TO 4
        READ CHARS2, ASCCHAR
        gosub GETSTVCHAR    'CONVERT ASCII TO STV
        GOSUB DISPLAYCHAR
        NEXT
        RETURN
        
    NOVIDEO:
        LINECOUNTER=5       'SET START POSITION
        CHARCOUNTER=4       'SET CURSOR POSITION
        GOSUB SETLINE
        FOR CHARS2=6 TO 23      ' FROM EEPROM DATA
        READ CHARS2, ASCCHAR
        gosub GETSTVCHAR    'CONVERT ASCII TO STV
        GOSUB DISPLAYCHAR
        NEXT
        RETURN
        
    TRYSYNCHS:
        
        PULSES=0
    
        COUNT SYNCH0,4,PULSES   '3MS SHOULD COUNT TO 2 OR 3
        IF PULSES > 0 THEN MIXED0
    FULL0:
    
        IF CURRENTMODE0=1 THEN RETURN
    
        WDATA=  %0000000011001110       'CONTROL REGISTER
        GOSUB SEND
        WDATA=  %0001101011010101   'NTSC
    
        
        
    '        WDATA=  %0001101011010101   'NTSC     BIT 8 = 0
                'CHANGE BIT 0 TO 1 FOR TEXT ONLY       OTIGINAL
                
     '     WDATA=  %0001101111010100
                'CHANGE BIT 0 TO 1 FOR TEXT ONLY        
        GOSUB SEND
    
    STAYHERE02:
      
        CURRENTMODE0=1
            GOSUB CLS
    GOBACK0:
        RETURN
    
    
    MIXED0:
        IF CURRENTMODE0=0 THEN RETURN
        WDATA=  %0000000011001110       'CONTROL REGISTER
        GOSUB SEND
        WDATA=  %0001100111010100    'ntsc
        
        
        
    '    WDATA=  %0001101011010100     'NTSC   BIT 8 = 0
        GOSUB SEND
    
    STAYHERE01:
    
        CURRENTMODE0=0
        GOSUB CLS
        RETURN
    HEX code for programmer compiled from above code

    Code:
    :100000006C28B400841780048413FA30A6000030F2
    :10001000A7005120A00AA50AA201A30100083405E7
    :10002000A600640000083405A7002606270534064C
    :100030000319A20A0319A30A2708A600A403031997
    :10004000A5030319A00B11282208672883161C1486
    :100050001A0883169B0A6728A301A200FF30A20793
    :10006000031CA307031C67280330A100E6303A20D5
    :100070002E28A101FC3EA000A109031C4528FF3049
    :100080000000A00703184028A0076400A10F3F2824
    :1000900008000310A00DA10DFF3E031849282008F9
    :1000A00067281030A800A101A001A70CA60C031C12
    :1000B0005F282208A00723080318230FA107A10C1B
    :1000C000A00CA50CA40CA80B5528240867288313A2
    :1000D000031383126400080083168F308600831296
    :1000E00007309F000130A300F4302D20DE200130C6
    :1000F000A300F4302D20DE20FF30C200BE01C40179
    :100100002C21CE21C701A12164004208013C031D1E
    :100110008A28B721CE21832800304607BA0017303D
    :100120000318013EBB00DA2008004408A600A7011E
    :10013000A2010130A3005120B8002508B9003E08F3
    :100140003807BA0039080318013EBB00DA2008005E
    :100150001430392008008616A8200613A82086121D
    :10016000A82008008616A8200617A8200800061652
    :10017000A8208612A8208616A82008000612A8200B
    :100180008612A8208616A8200616A820080001308E
    :10019000BD00640011303D020318D9286400BB1F64
    :1001A000D328B720D428BE200310BA0DBB0DBD0F35
    :1001B000C9280800AB20C720B22008008616061602
    :1001C0000617BA013030BB00DA2032302C20BA01D9
    :1001D0003030BB00DA2032302C20DB30BA00BB01DB
    :1001E000DA2032302C20BA011030BB00DA20323055
    :1001F0002C20CC30BA00BB01DA2032302C20BA01DE
    :100200001030BB00DA2032302C20BA011230BB0093
    :10021000DA2032302C20D430BA001A30BB00DA2079
    :10022000CF30BA001730BB00DA202E30BA001030C1
    :10023000BB00DA20C030BA00BB01DA20C301640081
    :100240000B30430203182B29C430BA001030BB0016
    :10025000DA20C30F1F290800C801C701BA01BB017A
    :10026000DA200B30BA001730BB00DA20C70A64006E
    :100270001C304702031C3E29C701C80A64000B302A
    :10028000480203184429312908007F30C600FF3096
    :10029000A200A20A2208433C031CA02955213C02CB
    :1002A000031D49292208C600A02901308A0022081E
    :1002B0005C3E03188A0A82003034313432343334DD
    :1002C0003434353436343734383439342D342034FA
    :1002D000413442344334443445344634473448345A
    :1002E00049344A344B344C344D344E344F3450340A
    :1002F00051345234533454345534563457345834BA
    :1003000059345A343A342E342F3427346134623419
    :1003100063346434653466346734683469346A3409
    :100320006B346C346D346E346F34703471347234B9
    :1003300073347434753476347734783479347A3469
    :1003400008000230C4001730BE009520C0016400D0
    :10035000053040020318B629400883169B0083121B
    :100360002620BC0045218C20C00FA729080005309D
    :10037000C4000430BE0095200630C0006400183070
    :1003800040020318CD29400883169B0083122620C3
    :10039000BC0045218C20C00FBE290800C5010430D7
    :1003A000A200A3010630840080300120C500640053
    :1003B000013045020318EF2964004208013C031D87
    :1003C000E2290800CE30BA00BB01DA20D530BA00ED
    :1003D0001A30BB00DA200130C2002C210800640072
    :1003E0004208003C031DF5290800CE30BA00BB01CD
    :1003F000DA20D430BA001930BB00DA20C2012C2137
    :020400000800F2
    :02400E00663F0B
    :104200004E005400530043002000FF004E004F00BA
    :104210002000530059004E00430048005300200086
    :104220005200450043004500490056004500440047
    :02423000FF008D
    :00000001FF
    Name:  NTSC 2.jpg
Views: 1589
Size:  228.5 KB

  28. #28
    Join Date
    Mar 2011
    Location
    Los Angeles, California
    Posts
    322


    Did you find this post helpful? Yes | No

    Default Re: A little HELP!!

    Hi Aerostar!
    Thank you, Thank you, Thank you! I do not know how to save your hex code to a file? Second the statement "@ device PIC16f628a,HS_OSC,BOD_ON,MCLR_ON,PWRT_ON" does not allow me to compile the program, had to change it to a config. I am using Micro Code Studio Plus 5.0.0.5 PBPX 3.1.0.4 and MPLAB IDE V8.92. I did try 4 different 16F628A's and end up with the same results. I do have pin 4 of the 16F628A tied to +5v through a 4.7k resistor as i understand this to be the MCLR for the 16F628A. I believe our code is identical except for the config statement as I added the config to your code so it would compile. Not sure what else to change, maybe if you have time you can compile my version and see if it will work? I did order some more STV5730's which should be here any day now.

    Code:
    '****************************************************************
    '*  Name    : STV-SYNCHS RELEASE                          *
    '*  Author  : BOB LEGGETT                                       *
    '*  Notice  : Copyright (c) 2009                                *
    '*          : All Rights Reserved                               *
    '*  Date    : around 2009 or so rehashed now '17         *
    '*  Version : 1.0                                               *
    '*  Notes   :   VIDEO IDENT                                *
    '*          :                                                   *
    '****************************************************************
    
    
    
    '   WORKS USES SYNC FOR SWITCHING BETWEEN MIXED AND FULL TEXT MODE
    '   GOING FROM VID IN TO TEXT AND BACK TO VID IN
    
    ' @ device PIC16f628a,HS_OSC,BOD_ON,MCLR_ON,PWRT_ON 
    #CONFIG
        __config _HS_OSC & _WDT_ON & _MCLRE_ON & _LVP_OFF & _CP_OFF
    #ENDCONFIG
       
            
        define  OSC 20
        
         
    'TV CHIP CONNECTIONS
     
    
     
    '---------------------------------------------------------------
       '16f628a  ED definitions
     
     TVSDA     		VAR PORTB.4    '0     OUTPUT  pin 11 stv was b.1
     CS0     		VAR PORTB.6    '0     OUTPUT pin 13 stv was b.0
     TVSCL     		VAR PORTB.5    '0     OUTPUT  pin 12 stv was b.5
     SYNCH0         VAR PORTB.7    '1     INPUT    to pin 7 stvchip was b.2
     'HEARTBEAT      VAR PORTB.6          OUTPUT 0  led was b.6
    '--------------------------------------------------------------- 
    
    '16f628a 
          
    '	TVSDA     		VAR PORTB.1    '0    OUTPUT  pin 11 stv
    ' 	CS0     		VAR PORTB.0    '0    OUTPUT pin 13 stv
    '	TVSCL     		VAR PORTB.5    '0    OUTPUT  pin 12 stv
    '   SYNCH0          VAR PORTB.2    '1    INPUT    to pin 7 stvchip
    '   HEARTBEAT       VAR PORTB.6    '     OUTPUT 0  led
    '---------------------------------------------------------------
    
        ZOOMREG         CON %0000000011001100       ' 12 ZOOM REGISTER
        COLREG          CON %0000000011001101       ' 13 COLOUR REGISTER
        CONREG          CON %0000000011001110       ' 14 CONTROL REGISTER
        POSREG          CON %0000000011001111       ' 15 POSITION REGISTER 
        MODEREG         CON %0000000011010000       ' 16 MODE REGISTER
    
        
          
    	ICOUNT  		VAR BYTE
    	BITCOUNTER 	VAR BYTE
    	WDATA   		VAR WORD
    	CHARCOUNTER	VAR BYTE '  
    	LINECOUNTER	VAR BYTE '
    
    
         STVCHAR VAR BYTE
        ASCCHAR VAR BYTE
        CHARS VAR BYTE
        CHARS2 VAR BYTE
        TEMP    VAR BYTE 
        TEMP1   VAR BYTE
         COUNTER VAR BYTE
         PULSES VAR BYTE
        CURRENTMODE0 VAR BYTE
    
    '----------------------------------------------------------------     
    '    TOPLEFT          CON 0
    '    TOPMIDDLE       CON 5
    '    TOPRIGHT        CON 10
    '    BOTLEFT         CON 2560    '10*256
    '    BOTMIDDLE       CON 2565 '(10*256)+ 5
    '    BOTRIGHT        CON 2570 '(10*256)+ 10
    '---------------------------------------------------------------- 
    
        DATA @0,"NTSC ",$FF,"NO SYNCHS RECEIVED",$FF   
    
    
    
    '---------------------------------------------------------------- 
    '628
    '  TRISB=%10011100
      TRISB = %10001111
      CMCON=7
    '----------------------------------------------------------------     
    
    
        PAUSE 500
        
    '    HIGH HEARTBEAT
        
        
    	GOSUB Init
    	
        PAUSE 500
    	GOSUB Init
        
        CURRENTMODE0=255         ' FORCES TRYSYNCHS TO SET MODE FIRST TIME
    
    	
    Demo:
    
    CHARCOUNTER = 0
    	LINECOUNTER = 0
    '    CURRENTMODE0 = 0     '0 = MIXED 1 = TEXT
        gosub CLS
        GOSUB TRYSYNCHS      '==================================
    
    
        TEMP = 0
      
         
    
    LOOPER:
        GOSUB HEADER   ' LINE 3 RIGHT HAND SIDE TEST.
        IF CURRENTMODE0=1 THEN
        GOSUB NOVIDEO   ' DISPLAYS NO VIDEO IF NO INCOMING SYNCHS
        ENDIF
    
        
        GOSUB TRYSYNCHS       '===========================
        
    
    '    PAUSE 500            'I/2 SECOND DELAY
    '    TOGGLE HEARTBEAT      ' LED
        GOTO LOOPER          'DO IT FOREVER
      
    
    DISPLAYCHAR:   
    
        WDATA = %0001011100000000 + STVCHAR
        GOSUB SEND 
         RETURN
    SETLINE:    
    	WDATA = LINECOUNTER*256 + CHARCOUNTER
        GOSUB Send              'position cursor   
        RETURN
    
    
    
    WasteTime:        ' WORKS WITH LESS NOPS
    
    
    
        pauseus 20    ' was 20 nops
    
    	RETURN
    
    StartCommunication:
    	TVSCL = 1 'HIGH TVSCL 
        GOSUB WasteTime
    
        CS0 = 0 'LOW CS0
    
        GOSUB WasteTime
    	TVSCL = 0 'LOW TVSCL
        GOSUB WasteTime
    	RETURN
    
    StopCommunication:
    	TVSCL = 1 'HIGH TVSCL
        GOSUB WasteTime
        CS0 = 1 'HIGH CS0
    
        GOSUB WasteTime
    	RETURN
    
    SendOne:
    	TVSDA = 1 'HIGH TVSDA
        GOSUB WasteTime
    	TVSCL = 0 'LOW  TVSCL
        GOSUB WasteTime
    	TVSCL = 1 'HIGH TVSCL
        GOSUB WasteTime
    	RETURN
    
    SendZero:
    	TVSDA = 0 'LOW TVSDA
        GOSUB WasteTime
    	TVSCL = 0 ' LOW TVSCL
        GOSUB WasteTime
    	TVSCL = 1 'HIGH TVSCL
        GOSUB WasteTime
    	TVSDA = 1 'HIGH TVSDA
        GOSUB WasteTime
    	RETURN
    
    OutByte:
    	FOR BITCOUNTER = 1 TO 16
    	 IF WDATA.15 = 1 THEN
    	  GOSUB SendOne
    	 ELSE
    	  GOSUB SendZero
    	 ENDIF
    	 WDATA = WDATA << 1
    	NEXT BITCOUNTER
    	RETURN
    
    Send:
    	GOSUB StartCommunication
    	GOSUB OutByte
    	GOSUB StopCommunication
    	RETURN
    
    '-------------------------------------------------------------  
    
    Init:     '    PAUSE 50 added - seems to improve reliability of init
    
    	TVSCL = 1 'HIGH TVSCL
        TVSDA = 1 'HIGH TVSDA
        CS0 = 1 'HIGH CS0
     
    	WDATA = $3000  '%110000 00000000
        GOSUB Send ' Init STV5730
        PAUSE 50
    	WDATA = $3000
        GOSUB Send
        PAUSE 50
    	WDATA = $00DB  '%00000000 11011011
        GOSUB Send
        PAUSE 50
    	WDATA = $1000  '%00010000 00000000
        GOSUB Send
        PAUSE 50
    '-------------------------------------------------------------  
    	WDATA = %0000000011001100
        GOSUB Send ' Init registers (point to register 12)
        PAUSE 50
    '-------------------------------------------------------------      
    	WDATA = %0001000000000000   'NORMAL
    '  WDATA = %0001000011110000   '4 PIXELS HORIZ AND VERT
        GOSUB Send ' Zoom    ADDRESS 12
        PAUSE 50
    '-------------------------------------------------------------      
    	WDATA = %0001001000000000
    
    '    	WDATA = %0001001000000100
             GOSUB Send ' Color    ADDRESS 13
             PAUSE 50
    '--------------------------------------------------------
                
     
         WDATA=  %0001101011010100    'BIT 8 = 0 FOR NTSC
    
     
         
                'CHANGE BIT 0 TO 1 FOR TEXT ONLY
        GOSUB Send ' Control    ADDRESS 14
    '-------------------------------------------------------------    
    	WDATA = %0001011111001111
        GOSUB Send ' Position    ADDRESS 15
    '------------------------------------------------------------- 
    
       
    	WDATA = %0001000000101110 '$183E BIT 11 CHANGED TO 0  M4 = 0
           GOSUB Send ' Mode    ADDRESS 16  %0001100000111110
    
    '------------------------------------------------------------- 
     
    	WDATA = $00C0   '%00000000 11000000
        GOSUB Send ' Set row attributes
         
    	FOR ICOUNT = 0 TO 10
    	 WDATA = $10C4 '%00010000 11000100
      	' WDATA =%0001000010000111
         GOSUB Send
    	NEXT ICOUNT
    	RETURN
     
    CLS: 
        'character=$0B       'SPACE
         TEMP1=0   ' LINECOUNTER
         TEMP =0    'CHARCOUNTER
    loop2:
        
    	WDATA = 0  ' LINECOUNTER*256 + CHARCOUNTER   ADDRESS
        GOSUB Send
        
    
    LOOP3:    '                :CHARACTERS        
    	WDATA = %0001011100001011  '     1011 0BH SPACECHARACTER
        GOSUB Send
    	TEMP = TEMP + 1
    	IF TEMP >= 28 THEN
        TEMP = 0
        TEMP1=TEMP1 + 1
    	ENDIF
    	IF TEMP1 >= 11 THEN SCREENBLANK
     	
        GOTO LOOP3
        
    SCREENBLANK:
    	RETURN
    
    GETSTVCHAR:                  'CONVERT ASCII TO STV
            STVCHAR =$7F   ' FORCES CLOCK PICTURE IF ERROR         
           LOOKDOWN ASCCHAR,["0123456789- ABCDEFGHIJKLMNOPQRSTUVWXYZ:./'abcdefghijklmnopqrstuvwxyz"],STVCHAR
                   RETURN 
    
    HEADER:
        LINECOUNTER=2       'SET START POSITION
        CHARCOUNTER=23      'SET CURSOR POSITION
        GOSUB SETLINE
        FOR CHARS2=0 TO 4
        READ CHARS2, ASCCHAR
        gosub GETSTVCHAR    'CONVERT ASCII TO STV
        GOSUB DISPLAYCHAR
        NEXT
        RETURN
        
    NOVIDEO:
        LINECOUNTER=5       'SET START POSITION
        CHARCOUNTER=4       'SET CURSOR POSITION
        GOSUB SETLINE
        FOR CHARS2=6 TO 23      ' FROM EEPROM DATA
        READ CHARS2, ASCCHAR
        gosub GETSTVCHAR    'CONVERT ASCII TO STV
        GOSUB DISPLAYCHAR
        NEXT
        RETURN
        
    TRYSYNCHS:
        
        PULSES=0
    
        COUNT SYNCH0,4,PULSES   '3MS SHOULD COUNT TO 2 OR 3
        IF PULSES > 0 THEN MIXED0
    FULL0:
    
        IF CURRENTMODE0=1 THEN RETURN
    
        WDATA=  %0000000011001110       'CONTROL REGISTER
        GOSUB SEND
        WDATA=  %0001101011010101   'NTSC
    
        
        
    '        WDATA=  %0001101011010101   'NTSC     BIT 8 = 0
                'CHANGE BIT 0 TO 1 FOR TEXT ONLY       OTIGINAL
                
     '     WDATA=  %0001101111010100
                'CHANGE BIT 0 TO 1 FOR TEXT ONLY        
        GOSUB SEND
    
    STAYHERE02:
      
        CURRENTMODE0=1
            GOSUB CLS
    GOBACK0:
        RETURN
    
    
    MIXED0:
        IF CURRENTMODE0=0 THEN RETURN
        WDATA=  %0000000011001110       'CONTROL REGISTER
        GOSUB SEND
        WDATA=  %0001100111010100    'ntsc
        
        
        
    '    WDATA=  %0001101011010100     'NTSC   BIT 8 = 0
        GOSUB SEND
    
    STAYHERE01:
    
        CURRENTMODE0=0
        GOSUB CLS
        RETURN
    Many thanks, Ed

    P.S. If you wish to e-mail me files my e-mail is [email protected]

  29. #29


    Did you find this post helpful? Yes | No

    Default Re: A little HELP!!

    You use highlite text, copy and paste as you would in word processing.

    To save the hex code ,put mouse at top left of hexcode, the pointer will change to something that looks like a capital I,the vertical part should just touch the left side of the colon on the top line, single left mouse click, use the slide bar on the right of the hex code to scroll down to the bottom of the code, move the mouse pounter to the last character, so the vertical part of the I just touches the right hand side of the F, hold the shift button down and then single left mouse click that will highlite the code, then Control C that will copy all the highlited text, now run notepad, right click on blank area and select paste, the hex code will appear, now save this as whatever name you wish with the extension as .hex. You can then load it into your programmer.

    I will look at trying your code tomorrow sometime.

    I would suggest you edit and mask your email as it will get picked up by the spam bots - write it as edcannady at earthlink dot net

  30. #30
    Join Date
    Mar 2011
    Location
    Los Angeles, California
    Posts
    322


    Did you find this post helpful? Yes | No

    Default Re: A little HELP!!

    Hi Aerostar!
    Your hex code works (sort of). If there is no video then I get a blue screen with "NTSC" and NO SYNCHS RECEIVED"!
    If I input a video source then only the video input source displays with no text.

    Thank you for the e-mail recommendation, I get a ton of spam as it is!

    My code will not compile with the statement "@ device PIC16f628a,HS_OSC,BOD_ON,MCLR_ON,PWRT_ON"
    The 16F628A data sheet shows they made changes from MCLR TO MCLRE, ETC.
    I had to switch to #CONFIG and I believe it is completely wrong as the results when I change this cause things to go "spiritual" (technical term ).

  31. #31


    Did you find this post helpful? Yes | No

    Default Re: A little HELP!!

    Quote Originally Posted by Ramius View Post
    Hi Aerostar!
    Your hex code works (sort of). If there is no video then I get a blue screen with "NTSC" and NO SYNCHS RECEIVED"!
    If I input a video source then only the video input source displays with no text.


    My code will not compile with the statement "@ device PIC16f628a,HS_OSC,BOD_ON,MCLR_ON,PWRT_ON"
    The 16F628A data sheet shows they made changes from MCLR TO MCLRE, ETC.
    I had to switch to #CONFIG and I believe it is completely wrong as the results when I change this cause things to go "spiritual" (technical term ).
    I will try and find a NTSC source to check the operation, I did connect a Pal video source to see what would happen, and it showed a black and white picture with the text overlaid.

    "@ device PIC16f628a,HS_OSC,BOD_ON,MCLR_ON,PWRT_ON" is for the earlier versions of PBP, before 3, I looked at the 16f628a .inc file (PBP260C) and it says mclr, if I compile with mclre it errors.

    Further to follow in due time.

  32. #32
    Join Date
    Mar 2011
    Location
    Los Angeles, California
    Posts
    322


    Did you find this post helpful? Yes | No

    Default Re: A little HELP!!

    Thank you! I really appreciate all that you are doing. If there is something I can do please ask.

    Best, Ed

  33. #33
    Join Date
    Mar 2011
    Location
    Los Angeles, California
    Posts
    322


    Did you find this post helpful? Yes | No

    Default Re: A little HELP!!

    Hi Aerostar!
    Okay so the code works (sort of)! If I give the STV5730 an NTSC source I only get the video from the source. Remove the source and I get the Blue screen with the "NTSC No Synchs Received message"!
    How can I get the text to overlay the incoming video?

    Thanks, Ed

  34. #34


    Did you find this post helpful? Yes | No

    Default Re: A little HELP!!

    Quote Originally Posted by Ramius View Post
    Hi Aerostar!
    Okay so the code works (sort of)! If I give the STV5730 an NTSC source I only get the video from the source. Remove the source and I get the Blue screen with the "NTSC No Synchs Received message"!
    How can I get the text to overlay the incoming video?

    Thanks, Ed
    See post 31--- I am sorting out an NTSC source to test under your conditions !!!!!

  35. #35


    Did you find this post helpful? Yes | No

    Default Re: A little HELP!!

    Here is code, hex file and other files made by PBP3 , Microchip assembler, tested working with my NTSC source.

    I used a second STV NTSC board as the video source (top board in picture) , connected that output to the input of the original board board (bottom board in picture), and it switches back and forth OK.

    Top BNC is video input, bottom BNC is video output on the boards. Micros are 628a pics

    With no input to the bottom board, you see the NTSC. and the No synchs message, with NTSC input from the top board, bottom BNC, NTSC. is overlayed on the incoming video, my top board board puts out NTSC VIDEO SOURCE.

    Compiled (with help of friend) PBP 3.1.0.1, mplab 8.92 MCS version 5.00.5 and programmed with pickit 2 v2.61 programmer. this I think matches your software setup - your programmer unknown.

    Name:  overlay.jpg
Views: 1547
Size:  223.8 KBName:  Test setup.jpg
Views: 1552
Size:  292.0 KB
    Attached Files Attached Files

  36. #36
    Join Date
    Mar 2011
    Location
    Los Angeles, California
    Posts
    322


    Did you find this post helpful? Yes | No

    Default Re: A little HELP!!

    WOW! That really looks really great! Thank you for the files too! My programmer is a PICSTART PLUS and that should not make any difference. Two questions, how did you wire your STV5730A? Second question, have you tried to have the text be a color? Again, what a great job!!!

    Ed

  37. #37


    Did you find this post helpful? Yes | No

    Default Re: A little HELP!!

    Quote Originally Posted by Ramius View Post
    WOW! That really looks really great! Thank you for the files too! My programmer is a PICSTART PLUS and that should not make any difference. Two questions, how did you wire your STV5730A? Second question, have you tried to have the text be a color? Again, what a great job!!!

    Ed
    And to prove it really does work - see below - wobbly camera as it was my phone and had to have the other hand to make the connection to the top board at the same time.



    Part of the PCB lay out was on the net way back 2003 or earlier, done with the free version of Protel as was then, I modified it to fit what I wanted and had the boards made as it was a commercial job. The text was only used as white but should be able to change using the color register I think.

    If I get chance I will see if I still have the board layout - it will take a day or more - have to dig in to old backups etc and when I get the time.

  38. #38
    Join Date
    Mar 2011
    Location
    Los Angeles, California
    Posts
    322


    Did you find this post helpful? Yes | No

    Default Re: A little HELP!!

    It looks really great! Fantastic job! Just the schematic would be fine, just want to check the values of the components used for the STV5730A.

    Best, Ed

  39. #39


    Did you find this post helpful? Yes | No

    Default Re: A little HELP!!

    From the depths of the old files I found this -


    Name:  vcgsch.gif
Views: 1597
Size:  17.9 KB

    On the STV PDF, it shows Circuitry around pins 5 and 6 I incorporated this, but I see the schematic above does not, I think as long as you have a good smoothed 5 volt power supply with good decoupling caps, there should not be a problem. However he does not show decoupling caps on his 9-12V DC circuit, 100N/220N should be in parallel with his 47uF caps and be close to the regulator.

    On my board R3 (3k3) not fitted, My board, and the program you have uses CSYNC to work out the switching of modes, from what I remember I found odd problems using the MUTE, but cannot remember exactly what ! I think it did not always change the level when it should have or took a while to change.

    Different coloured characters, It is in
    DISPLAYCHAR:

    WDATA = %0001011100000000 + STVCHAR

    Bits 10,9, and 8 internal ram buffer, page 7 of my PDF, according to the STV data control the colour of the character.

    You will have to try that when you get your system running correctly

  40. #40
    Join Date
    Mar 2011
    Location
    Los Angeles, California
    Posts
    322


    Did you find this post helpful? Yes | No

    Default Re: A little HELP!!

    Again my greatest thanks! I just received three new STV5730A's so I will build the boards with the same component values you are using. Again, Thank you!

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts