Sony DVP-SR320 Tray locking fix

Thread Starter

R!f@@

Joined Apr 2, 2009
9,918


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 ?


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.


I wonder why.


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


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.
 

Attachments

Last edited:

Thread Starter

R!f@@

Joined Apr 2, 2009
9,918
What do u think?

Rich (BB code):
;******************************************************************************
;                                                                             
;    Filename:      DVP-SR320 Eject code                                       
;    Date:          5 jan 2013                                                        
;    File Version:  V1.0                                                          
;                                                                             
;    Author:        Rifaa-ath Raxei                                                          
;    Company:       Vialogic Pvt Ltd.                                                          
;                                                                             
; -------------------------------------------------------------------------------                                                                         
     LIST      P=12F629              ; list directive to define processor
     #INCLUDE <P12F629.INC>          ; processor specific variable definitions
;
;
    __CONFIG   _CP_OFF & _CPD_OFF & _BODEN_OFF & _MCLRE_OFF & _WDT_OFF & _PWRTE_ON & _INTRC_OSC_NOCLKOUT 
; Variable
        Equates
SwDb    equ 1                        ; Switch debounce counter
Delay    equ 1                        ; Delay Counter
;
        errorlevel -302
        errorlevel +302
;    
;Reset Vector
           ORG        0x00
        bsf        STATUS,RP0            ; Bank 1
        call    3FFh    
        movwf    OSCCAL
; Initialize
        movlw    b'001111'
        movwf    TRISIO
        bcf        STATUS,RP0            ; Bank 0
;
        clrf    GPIO                ; Clear the ports
;
; MAIN
        btfsc    GPIO,GP1              ; At power up, check to see if tray is Out
        goto     CloseTray            ; close the tray
        goto    SwScan
;
SwScan
        btfsc   GPIO,GP3            ; look for eject button press
        goto    SwScan                ; if not Keep scanning
        movlw    .13                
        movwf    SwDb    
        clrf    Delay
Dn_dly    incfsz  Delay,f
        goto    Dn_dly
        btfsc   GPIO,GP3
        goto    SwScan        
        decfsz    SwDb,f
        goto    Dn_dly
OpenTray
        bcf        GPIO,GP5            ; clear port
        bsf        GPIO,GP4            ; Open cmd
        btfsc    GPIO,GP0            ; Check from Tray out signal
        goto    OpenTray            ; In not keep the command
        bcf     GPIO,GP4            ; if out, stop motor
        return
CloseTray
        bcf        GPIO,GP4            
        bsf        GPIO,GP5            ; Closes tray
        btfsc    GPIO,GP1            ; check for Tray In signal
        goto    CloseTray            ; if not, keep the in command
        bcf        GPIO,GP5            ; if in, stop the motor.
        return
;


end
 
Last edited by a moderator:

nerdegutta

Joined Dec 15, 2009
2,684
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.
 

GopherT

Joined Nov 23, 2012
8,009
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?
 

GopherT

Joined Nov 23, 2012
8,009
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.
 

Thread Starter

R!f@@

Joined Apr 2, 2009
9,918
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:

Rich (BB code):
;******************************************************************************
;                                                                             
;    Filename:      DVP-SR320 Eject code                                       
;    Date:           11 jan 2013                                                        
;    File Version:  V1.1                                                          
;                                                                             
;    Author:        Rifaa-ath Raxei                                                          
;    Company:       Vialogic Pvt Ltd.                                                          
;                                                                             
; -------------------------------------------------------------------------------    
; Port Assignments
; GP0 Tray out signal, active low
; GP1 Tray in signal, active low        
; GP2 Not used
; GP3 Eject Button    
; GP4 Tray eject command
; GP5 Tray close command
; 
; IK resistoe to Vcc on GP0, GP1 & GP3. 
; GP5,4 is the outputs.
;---------------------------------------------------------------------------------                                                                     
     LIST      P=12F629              ; list directive to define processor
     #INCLUDE <P12F629.INC>          ; processor specific variable definitions
;
;
    __CONFIG   _CP_OFF & _CPD_OFF & _BODEN_OFF & _MCLRE_OFF & _WDT_OFF & _PWRTE_ON & _INTRC_OSC_NOCLKOUT 
     errorlevel -302
     errorlevel +302
; Variable
    cblock 0x20
    d1                                ; Debouce counters
    d2
    endc

; Defines
 #define   Ej_button    GPIO,3              ; PB active low on GP3
 #define   In_S        GPIO,1                     ; Active Low input Tray in signal
 #define   Out_S        GPIO,0                   ; Active Low input Tray out Signal
 #define   Tr_in        GPIO,5                     ; Active high output Tray close signal
 #define   Tr_out        GPIO,4                   ; Active hige output Tray Eject signalS

;Reset Vector
           ORG        0x0000
        nop
        nop
        nop
        nop                            ; Nop's to get past interrupt
        nop
        nop
        nop

;Osc caiberation
        bsf        STATUS,RP0                      ; Bank 1
        call    3FFh                                    ; Get the cal value
        movwf    OSCCAL                          ; calibrate
        bcf        STATUS,RP0                      ; Bank 0

; Initialize
        clrf    GPIO                ; Init GPIO
        movlw   07h                    ; (0x07) Set GP<2:0> to (turning off comparator)
        movwf   CMCON                ; Digital IO    
        bsf        STATUS,RP0            ; Bank 1
        movlw    b'001111'            ; Bit value to set GP <5:4> as Outputs & rest as Inputs
        movwf    TRISIO                ; set port
        bcf        STATUS,RP0            ; Bank 0
; Closing tray at power up
        clrf    GPIO                ; Clear the ports
        bsf        Tr_in                ; Power up Tray close, active high.
Close_Tray        
        btfsc    In_S                ; check port for tray close signal
        goto    Close_Tray            ; continue if not cloed
; Eject buttonn scanning

Loop    
        btfsc    Ej_button            ; scanning for eject press
        goto       Loop                ; continue to scan untill pressed.
        call    Delay                ; if pressed goto debounce

TrOut    bsf        Tr_out                ; Eject tray
        btfsc    Out_S                ; check for tray out
        goto    TrOut                ; or if not continue    
        goto    Loop                ; if out go back to button scan
;Switch debounce

Delay                                ;0.05ms, 49993 cycles
        movlw    0x0E
        movwf    d1
        movlw    0x28
        movwf    d2

Delay_0
        decfsz    d1, f
        goto    $+2
        decfsz    d2, f
        goto    Delay_0
                                    ; 3 Cycles
        goto     $+1
        nop
                                    ; 4 Cycles includeing call
        returm
        end
 
Last edited by a moderator:

GopherT

Joined Nov 23, 2012
8,009
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
 

vrainom

Joined Sep 8, 2011
126
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?

Rich (BB code):
Start:
Definitions and initialize mcu
If tray is open go to close_tray

scan_eject:
if eject_button is not pressed loop

if tray is open go to close_tray

open_tray:
simulate stop button signal
3 second delay
set motor_open output
if not fully open loop
clear motor_open output
go to debounce

close_tray:
set motor_close output
if not fully closed loop
clear motor_close output

debounce:
if eject_button is still pressed loop
1ms delay
go to scan_eject

end
 
Top