A little HELP!!


Closed Thread
Results 1 to 40 of 77

Thread: A little HELP!!

Hybrid View

  1. #1
    Join Date
    Oct 2014
    Posts
    2


    Did you find this post helpful? Yes | No

    Default Re: A little HELP!!

    Hi Ed,

    Seems like you are making some progress on this project. I was tempted to purchase some chips from the supplier, but now think will wait a while longer to see how your results conclude. I was a little concerned given how long these devices have been EOL about them being actually genuine. So will be an interesting story to hear how you finally progress & about any discoveries you make along the way.

    Certainly aerostar has proven the code for usage on the NTSC video standard with real life testing of his original prototype boards.

    Mike.

  2. #2


    Did you find this post helpful? Yes | No

    Default Re: A little HELP!!

    The chips as far as I know were never cloned, so I would say UTsource are genuine. It is a specialised IC and were used by cctv companies and video equipment manufacturers. In the UK they are still being used in the Amateur radio fraternity. It is a long time since EOL, but they are still very useful.

    If you go here http://dunstabledownsradioclub.org and choose TV Streams, GB3TZ in beacon mode (when not being used) the display is done using the STV chip, controlled by a Pic micro - (done in assembler, not by me) , the Pic also controls the repeater logic.

    My involvement in these chips - way back in 2003ish was to insert time overlay in cctv systems which did not have their own OSD, and using MSF or GPS to provide accurate time.

  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!!

    Hi All!
    When I purchased the chips the fact that they were offering large quantities at a discount suggested they were still being manufactured. Okay back to the code stuff. In the beginning of the code there are "con" statements and yet there does not seem to be any reference to these statements. Why are these statements part of the code? "NTSC." appears on the screen with or without a video reference. I wish to get to the point where I can place text such as STBRPM (Starboard RPM) and PORTRPM (Port RPM with a variable of 4 digits following the text while there is a video input signal from a camera. How can this be done? Maybe I could start with something simple such as moving the "NTSC." from the right side of the screen to the left? Again my greatest thanks!

    Ed

  4. #4


    Did you find this post helpful? Yes | No

    Default Re: A little HELP!!

    Some "Con" statements left over from debug etc code that was stripped out as I said somewhere earlier, and were also used as memory jogger.

    NTSC. will appear as this program always sends on screen refresh regardless of whether there is video input or not, it is down to you what you wish to be displayed with or without incoming video, it was for video repeater ident.


    This is the part you need to understand about placing text on screen

    HEADER:
    LINECOUNTER=2 'SET START POSITION ********* line 3 from top (0-2 = 3!)
    CHARCOUNTER=23 'SET CURSOR POSITION***********Character position start 23rd from left
    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

    with regards to getting your RPMs on screen the DIG command would probably help,

    so if you had a reading of 2400 as rpm in a word byte RPM, I THINK (following is UNTESTED)

    ASCCHAR = RPM DIG 1
    This gives a value of 2, and as it happens the character matrix in the chip will display 2 as if you look at the table the numbers come first

    then
    GOSUB DISPLAYCHAR

    then

    ASCCHAR = RPM DIG 2
    This gives a value of 4

    and so on to dig 4, you could make a loop to do this.

    Not quite sure what happens if the value is below 1000, but you could easily check that prior to doing DIG 4 and put a blank there instead, skipping the DIG 4.

  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!!

    Thank you and I am feeling incredibly stupid right now, even after 4 Excedrin's! I think I understand part of this, "RPM" is the variable where the RPM reading is stored? "DIG" is the number of digits to be displayed? So RPM DIG 4 would display 4 digits? Where do you inset the "ASCCHAR = RPM DIG 4? I think this line goes after "GOSUB SETLINE"? Then how do you display "RPM" in front of the reading? Please excuse what seems to be basic, simple questions and once I stop having brain craps things should get better!

    Ed

  6. #6


    Did you find this post helpful? Yes | No

    Default Re: A little HELP!!

    Quote Originally Posted by Ramius View Post
    Thank you and I am feeling incredibly stupid right now, even after 4 Excedrin's! I think I understand part of this, "RPM" is the variable where the RPM reading is stored? "DIG" is the number of digits to be displayed? So RPM DIG 4 would display 4 digits? Where do you inset the "ASCCHAR = RPM DIG 4? I think this line goes after "GOSUB SETLINE"? Then how do you display "RPM" in front of the reading? Please excuse what seems to be basic, simple questions and once I stop having brain craps things should get better!

    Ed
    If I asked you what the 2nd digit was of 2400 (normal reading left to right) you would immediately tell me 4 - congratulations you have just done a DIG 2,

    RPM is a variable name suggested where you would store the reading from whatever interface you have on the motors.


    DIG X just gives you the value of the single digit starting from the left hand side.

    so if as I said above your RPM was 2400

    DIG 4 would return 0 ie the last digit of 2400.

    DIG 2 would return 4 ie the second digit


    You set the line where you want the data to be shown
    set the cursor where you want the first character of your data to start



    For "RPM" in front

    ASCCHAR="R"
    GOSUB GETSTVCHAR 'CONVERT ASCII TO STV
    GOSUB DISPLAYCHAR

    repeat the above 3 lines for "P", "M" and " "


    now use the RPM word variable where you have stored your reading (RPM for instance)

    ASCCHAR = RPM DIG 1
    This gives a value of 2, and as it happens the character matrix in the chip will display 2 as if you look at the table the numbers come first

    then
    GOSUB DISPLAYCHAR

    then

    ASCCHAR = RPM DIG 2
    This gives a value of 4
    GOSUB DISPLAYCHAR


    ASCCHAR = RPM DIG 3
    This gives a value of 0
    GOSUB DISPLAYCHAR

    ASCCHAR = RPM DIG 4
    This gives a value of 0
    GOSUB DISPLAYCHAR


    so on the screen at the line you have selected starting at the position you have selected, you would have RPM 2400

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


    Did you find this post helpful? Yes | No

    Default Re: A little HELP!!

    Hi!
    My code does not work!! NTSC. no longer displays which is understandable. The code complies and when I run it nothing is displayed! Must have missed something basic?

    Code:
    
    '****************************************************************
    '*  Name    : NTSC-1                                            *
    '*  Author  : Ed Cannady                                        *
    '*  Notice  : Copyright (c) 2017                                *
    '*          : All Rights Reserved                               *
    '*  Date    : 06-30-17                                          *
    '*  Version : 1.0                                               *
    '*  Notes   : VIDEO IDENT                                       *
    '*          : WITH GREAT HELP FROM AEROSTAR                     *
    '****************************************************************
    
    ' WORKS USES SYNC FOR SWITCHING BETWEEN MIXED AND FULL TEXT MODE
    ' GOING FROM VID IN TO TEXT AND BACK TO VID IN
     
    #CONFIG
    
        __config _HS_OSC & _WDT_ON & _MCLRE_ON & _LVP_OFF & _CP_OFF
        
    #ENDCONFIG
               
    define  OSC 20
       
    '---------------------------------------------------------------
    '16f628a  ED definitions
     
        TVSDA        VAR PORTB.4    '0     OUTPUT to pin 11 of stv chip 
        CS0     	 VAR PORTB.6    '0     OUTPUT to pin 13 of stv chip 
        TVSCL     	 VAR PORTB.5    '0     OUTPUT to pin 12 of stv chip 
        SYNCH0       VAR PORTB.7    '1     INPUT  to pin 7  of stv chip 
    '--------------------------------------------------------------- 
    
        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
        PRPM         VAR WORD
    
    '----------------------------------------------------------------     
    '    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   
     
        TRISB = %10001111
    
    '----------------------------------------------------------------     
    
        PAUSE 500
        
    	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:
        PRPM = 6789
        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 = %0001010000000000 + STVCHAR
    
    '               11 10 9 8  7654 3210
    ' WDATA = %0001 0  1  1 1  0000 0000 + STVCHAR
    
    ' bit 11 = character background 0 = disabled 1 = enabled       
    
    ' bit 10 = red
    ' bit 09 = green
    ' bit 08 = blue
    
    ' 000 = black
    ' 001 = blue
    ' 010 = green
    ' 011 = cyan
    ' 100 = red
    ' 101 = magenta
    ' 110 = yellow
    ' 111 = white
        
    ' bit 7 = blink 1=enable 0=disable    
        
        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=12      'SET START POSITION
        CHARCOUNTER=1       'SET CURSOR POSITION
        GOSUB SETLINE
    '    FOR CHARS2=0 TO 4
    '    READ CHARS2, ASCCHAR
        ASCCHAR = "P"
        gosub GETSTVCHAR    'CONVERT ASCII TO STV
        GOSUB DISPLAYCHAR    
        ASCCHAR = "R"
        gosub GETSTVCHAR    'CONVERT ASCII TO STV
        GOSUB DISPLAYCHAR    
        ASCCHAR = "P"
        gosub GETSTVCHAR    'CONVERT ASCII TO STV
        GOSUB DISPLAYCHAR    
        ASCCHAR = "M"
        gosub GETSTVCHAR    'CONVERT ASCII TO STV
        GOSUB DISPLAYCHAR    
        ASCCHAR = PRPM DIG 1
        GOSUB DISPLAYCHAR    
        ASCCHAR = PRPM DIG 2
        GOSUB DISPLAYCHAR   
        ASCCHAR = PRPM DIG 3
        GOSUB DISPLAYCHAR    
        ASCCHAR = PRPM DIG 4
        GOSUB DISPLAYCHAR  
    '   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
    '   CHANGE BIT 0 TO 1 FOR TEXT ONLY  ORIGINAL
                
    '   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=  %0001101011010100
        GOSUB SEND
    
    STAYHERE01:
    
        CURRENTMODE0=0
        GOSUB CLS
        RETURN

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