Sony DVP-SR320 Tray locking fix

Discussion in 'General Electronics Chat' started by R!f@@, Jan 3, 2013.

  1. R!f@@

    Thread Starter AAC Fanatic!

    Apr 2, 2009
    8,754
    760
    [​IMG]

    The title is for a reason. I wanted everyone to see the thread via google search.

    Model is as said DVP-SR320. click to see how many people are having the issue.

    I got two of these fakes last month.

    Went through a lot and Sony does not acknowledge the model , WTF ?[​IMG]

    It is made in china and is like for USD 80.00 or even less.

    I could not get any info on the model and the recommended unlocking methods does not work for these models.
    [​IMG]

    I wonder why. [​IMG]

    So if any one wanna gimme any remote key combo, make sure it works for you. Or else just do not bother.

    The Player locks the tray ( child lock or something ) after a certain brown out. I think. The TV text says "Locked" when the eject button is pressed. The tray won't come out.
    All other functions works. Even the USB.

    So I believe it's a firmware issue. I cannot update with what I don't have.
    And I needed to find a solution of some kind.


    My Idea [​IMG]

    To add a little circuit so the tray can be ejected normally.
    I have gone through all the details and came up with this partial schematic (attached). It is not complete cause I need to know if the control circuit will work or not.

    The control I chose is a 12F629 for reasons I have plenty.
    Code is yet to write.
    The motor driver I chose is LB1641. Which I believe is easy to get, since these comes in many hifi's eject CD tray eject machs. It is a bidirectional Brushed motor driver which only needs just 2 input to control.

    Circuit connection details.

    JP1
    Pin 1 (from GP3) goes to the already installed eject button in the player ( details will be shown after completion). The button traces will be cut and one pin will be grounded. And the other is the wire connection.
    Thus it will provide an Active low input to GP3. I believe I needs capacitor at the GP3 ( will add when updated)

    Pin 2 & 3 are the connection to the Tray / loader position sensor switch.
    It is a small SPDT switch, which outputs tray position. OUT or IN.
    Connection order can be revered if needed so I did not label it.

    The switch has the Pole line grounded and the other two to send the signal.
    * When the tray is OUT completely one out is grounded while the other is open.
    * When the Tray is IN and the lens mach. goes up and holds the disc in the Play position the other OUT goes to ground.

    During any mid way both out is open ( not grounded ).

    Due to this reason and to minimize connection and economies the comp count I chose this, since the power will be taken from the on board PSU 5V & 12V line.

    In short the JP1's pin 2 & 3 provides the limits or motor stopping signal.
    The truth table is given in the driver data but I will high light on it.

    The PIC out, GP4 & 5, is the control which goes to the LB1641. I believe a direct connection won't be problem.

    Any 00 or 11 on GP4 & 5 will brake the motor or stop it.
    0 1 condition will drive the motor in one direction and 1 0, the other way.

    The inactive output should be either 00 or 11.

    Coding.

    I am going to code this in Assembly since I am familiar with it.
    I posted this cause I would need help from the coders lurking here :p

    Guys correct me if I am wrong.

    I am laying out the basic of the program block by block.

    After Reset Vector
    1. At program start, Close the tray if OUT. ( at Power ON )

    2. looks for close tray signal. If received stop motor.

    3. Wait loop, key scan, output 00.

    4. Eject Key pressed. look for Tray position signal, if IN then eject tray.

    5. Look for Tray position, wait until Out signal is received. When Rx stop motor (00). Key scan.

    6. Eject Key pressed. look for Tray position signal, if OUT signal is active then close the Tray, look for closed signal.

    7. Key scan.

    I will be writing the code according to this.

    I need to improve this.

    Ideas are needed.
     
    Last edited: Jan 9, 2013
  2. R!f@@

    Thread Starter AAC Fanatic!

    Apr 2, 2009
    8,754
    760
    What do u think?

    Code ( (Unknown Language)):
    1.  
    2. ;******************************************************************************
    3. ;                                                                            
    4. ;    Filename:      DVP-SR320 Eject code                                      
    5. ;    Date:          5 jan 2013                                                        
    6. ;    File Version:  V1.0                                                          
    7. ;                                                                            
    8. ;    Author:        Rifaa-ath Raxei                                                          
    9. ;    Company:       Vialogic Pvt Ltd.                                                          
    10. ;                                                                            
    11. ; -------------------------------------------------------------------------------                                                                        
    12.      LIST      P=12F629              ; list directive to define processor
    13.      #INCLUDE <P12F629.INC>          ; processor specific variable definitions
    14. ;
    15. ;
    16.     __CONFIG   _CP_OFF & _CPD_OFF & _BODEN_OFF & _MCLRE_OFF & _WDT_OFF & _PWRTE_ON & _INTRC_OSC_NOCLKOUT
    17. ; Variable
    18.         Equates
    19. SwDb    equ 1                        ; Switch debounce counter
    20. Delay    equ 1                        ; Delay Counter
    21. ;
    22.         errorlevel -302
    23.         errorlevel +302
    24. ;    
    25. ;Reset Vector
    26.            ORG        0x00
    27.         bsf        STATUS,RP0            ; Bank 1
    28.         call    3FFh    
    29.         movwf    OSCCAL
    30. ; Initialize
    31.         movlw    b'001111'
    32.         movwf    TRISIO
    33.         bcf        STATUS,RP0            ; Bank 0
    34. ;
    35.         clrf    GPIO                ; Clear the ports
    36. ;
    37. ; MAIN
    38.         btfsc    GPIO,GP1              ; At power up, check to see if tray is Out
    39.         goto     CloseTray            ; close the tray
    40.         goto    SwScan
    41. ;
    42. SwScan
    43.         btfsc   GPIO,GP3            ; look for eject button press
    44.         goto    SwScan                ; if not Keep scanning
    45.         movlw    .13                
    46.         movwf    SwDb    
    47.         clrf    Delay
    48. Dn_dly    incfsz  Delay,f
    49.         goto    Dn_dly
    50.         btfsc   GPIO,GP3
    51.         goto    SwScan        
    52.         decfsz    SwDb,f
    53.         goto    Dn_dly
    54. OpenTray
    55.         bcf        GPIO,GP5            ; clear port
    56.         bsf        GPIO,GP4            ; Open cmd
    57.         btfsc    GPIO,GP0            ; Check from Tray out signal
    58.         goto    OpenTray            ; In not keep the command
    59.         bcf     GPIO,GP4            ; if out, stop motor
    60.         return
    61. CloseTray
    62.         bcf        GPIO,GP4            
    63.         bsf        GPIO,GP5            ; Closes tray
    64.         btfsc    GPIO,GP1            ; check for Tray In signal
    65.         goto    CloseTray            ; if not, keep the in command
    66.         bcf        GPIO,GP5            ; if in, stop the motor.
    67.         return
    68. ;
    69.  
    70.  
    71. end
    72.  
     
    Last edited by a moderator: Jan 9, 2013
  3. nerdegutta

    Moderator

    Dec 15, 2009
    2,517
    785
    Hi.

    I'm not into assembler, but...

    Perhaps I missed it, but how does the program know how long the motor should run. Is there a sensor?

    Try to make a flow chart of what you want.
     
    R!f@@ likes this.
  4. GopherT

    AAC Fanatic!

    Nov 23, 2012
    6,061
    3,830
    You need to clarify routines entered with GOTO statements vs. CALL /RETURN commands. It looks like you get to OPENTRAY and CLOSETRAY with goto commands but you have RETURN at the end of these sections. Encountering a randomly placed return command can cause your next executed program line to jump anywhere or start from the beginning (albeit with some variables already set). Also, you have a CALL 3FFx early on but not nearly that many program lines. What did you want this to do?
     
    R!f@@ likes this.
  5. GopherT

    AAC Fanatic!

    Nov 23, 2012
    6,061
    3,830
    Also, your delay may not be long enough to allow door to open/close (if that was the goal). Better notes on each program line would help.
     
  6. R!f@@

    Thread Starter AAC Fanatic!

    Apr 2, 2009
    8,754
    760
    OK..I am still learning. Lemme at the code again.

    will update ASAP
     
  7. R!f@@

    Thread Starter AAC Fanatic!

    Apr 2, 2009
    8,754
    760
    I did a flow chart but am a bit confused

    I have change the code but am fighting how to change the loop for continued button press.
    I managed to write to closing the tray once after an eject :confused:

    Code ( (Unknown Language)):
    1.  
    2. ;******************************************************************************
    3. ;                                                                            
    4. ;    Filename:      DVP-SR320 Eject code                                      
    5. ;    Date:           11 jan 2013                                                        
    6. ;    File Version:  V1.1                                                          
    7. ;                                                                            
    8. ;    Author:        Rifaa-ath Raxei                                                          
    9. ;    Company:       Vialogic Pvt Ltd.                                                          
    10. ;                                                                            
    11. ; -------------------------------------------------------------------------------    
    12. ; Port Assignments
    13. ; GP0 Tray out signal, active low
    14. ; GP1 Tray in signal, active low        
    15. ; GP2 Not used
    16. ; GP3 Eject Button    
    17. ; GP4 Tray eject command
    18. ; GP5 Tray close command
    19. ;
    20. ; IK resistoe to Vcc on GP0, GP1 & GP3.
    21. ; GP5,4 is the outputs.
    22. ;---------------------------------------------------------------------------------                                                                    
    23.      LIST      P=12F629              ; list directive to define processor
    24.      #INCLUDE <P12F629.INC>          ; processor specific variable definitions
    25. ;
    26. ;
    27.     __CONFIG   _CP_OFF & _CPD_OFF & _BODEN_OFF & _MCLRE_OFF & _WDT_OFF & _PWRTE_ON & _INTRC_OSC_NOCLKOUT
    28.      errorlevel -302
    29.      errorlevel +302
    30. ; Variable
    31.     cblock 0x20
    32.     d1                                ; Debouce counters
    33.     d2
    34.     endc
    35.  
    36. ; Defines
    37.  #define   Ej_button    GPIO,3              ; PB active low on GP3
    38.  #define   In_S        GPIO,1                     ; Active Low input Tray in signal
    39.  #define   Out_S        GPIO,0                   ; Active Low input Tray out Signal
    40.  #define   Tr_in        GPIO,5                     ; Active high output Tray close signal
    41.  #define   Tr_out        GPIO,4                   ; Active hige output Tray Eject signalS
    42.  
    43. ;Reset Vector
    44.            ORG        0x0000
    45.         nop
    46.         nop
    47.         nop
    48.         nop                            ; Nop's to get past interrupt
    49.         nop
    50.         nop
    51.         nop
    52.  
    53. ;Osc caiberation
    54.         bsf        STATUS,RP0                      ; Bank 1
    55.         call    3FFh                                    ; Get the cal value
    56.         movwf    OSCCAL                          ; calibrate
    57.         bcf        STATUS,RP0                      ; Bank 0
    58.  
    59. ; Initialize
    60.         clrf    GPIO                ; Init GPIO
    61.         movlw   07h                    ; (0x07) Set GP<2:0> to (turning off comparator)
    62.         movwf   CMCON                ; Digital IO    
    63.         bsf        STATUS,RP0            ; Bank 1
    64.         movlw    b'001111'            ; Bit value to set GP <5:4> as Outputs & rest as Inputs
    65.         movwf    TRISIO                ; set port
    66.         bcf        STATUS,RP0            ; Bank 0
    67. ; Closing tray at power up
    68.         clrf    GPIO                ; Clear the ports
    69.         bsf        Tr_in                ; Power up Tray close, active high.
    70. Close_Tray        
    71.         btfsc    In_S                ; check port for tray close signal
    72.         goto    Close_Tray            ; continue if not cloed
    73. ; Eject buttonn scanning
    74.  
    75. Loop    
    76.         btfsc    Ej_button            ; scanning for eject press
    77.         goto       Loop                ; continue to scan untill pressed.
    78.         call    Delay                ; if pressed goto debounce
    79.  
    80. TrOut    bsf        Tr_out                ; Eject tray
    81.         btfsc    Out_S                ; check for tray out
    82.         goto    TrOut                ; or if not continue    
    83.         goto    Loop                ; if out go back to button scan
    84. ;Switch debounce
    85.  
    86. Delay                                ;0.05ms, 49993 cycles
    87.         movlw    0x0E
    88.         movwf    d1
    89.         movlw    0x28
    90.         movwf    d2
    91.  
    92. Delay_0
    93.         decfsz    d1, f
    94.         goto    $+2
    95.         decfsz    d2, f
    96.         goto    Delay_0
    97.                                     ; 3 Cycles
    98.         goto     $+1
    99.         nop
    100.                                     ; 4 Cycles includeing call
    101.         returm
    102.         end
    103.  
     
    Last edited by a moderator: Jan 12, 2013
  8. nerdegutta

    Moderator

    Dec 15, 2009
    2,517
    785
    What does the flowchart look like?
     
  9. R!f@@

    Thread Starter AAC Fanatic!

    Apr 2, 2009
    8,754
    760
    It's on piece of paper.
    I will upload it after drawing it in Corel

    @ Bertus

    Where is tag button. Is it next to "Quote" button.
     
  10. bertus

    Administrator

    Apr 5, 2008
    15,648
    2,348
    R!f@@ likes this.
  11. R!f@@

    Thread Starter AAC Fanatic!

    Apr 2, 2009
    8,754
    760
    Flow chart attached
     
  12. GopherT

    AAC Fanatic!

    Nov 23, 2012
    6,061
    3,830
    To wait for a button press, one option is using the lines...

    Btfss gpio, 1
    Goto $-1

    The btfss is used to check if the button is pressed. The dollar sign in the goto statement is understood by the microchip compiler, as "current line number minus one". This way, the program will just sit and wait until the button is pressed and immediately move on once a press is detected. You may have to modify to btfsc if the connection under test is normally HI
     
    R!f@@ likes this.
  13. vrainom

    Member

    Sep 8, 2011
    109
    19
    Hi R!f@@, I must say I admire your willingness to solve this kind of problems. I'm not sure this particular dvd is worthy of the effort as I've read elsewhere that they tend to die in less than three months of use but anyway.

    How about this pseudocode?

    Code ( (Unknown Language)):
    1.  
    2. Start:
    3. Definitions and initialize mcu
    4. If tray is open go to close_tray
    5.  
    6. scan_eject:
    7. if eject_button is not pressed loop
    8.  
    9. if tray is open go to close_tray
    10.  
    11. open_tray:
    12. simulate stop button signal
    13. 3 second delay
    14. set motor_open output
    15. if not fully open loop
    16. clear motor_open output
    17. go to debounce
    18.  
    19. close_tray:
    20. set motor_close output
    21. if not fully closed loop
    22. clear motor_close output
    23.  
    24. debounce:
    25. if eject_button is still pressed loop
    26. 1ms delay
    27. go to scan_eject
    28.  
    29. end
    30.  
     
    R!f@@ likes this.
Loading...