Close

Remote functionality

A project log for Marantz PM7200 wifi amplifier control

Adding wifi control to a 2004 Marantz PM7200 stereo amplifier

florisFloris 11/27/2024 at 20:430 Comments

The RC-5 protocol

The Marantz amplifier has a remote included (one that has fallen apart like an old Nokia phone I don't know how many times, but still going strong!), an RC8000PM.

Marantz RC8000PM remote
Marantz RC8000PM remote

I hooked that one up to LIRC on my Raspberry Pi a long time ago and according to the configuration file out of the LIRC database (thanks Hans de Jonge!), it uses the RC-5 protocol, built up as a 14 bit command like in the table below. See Wikipedia for the protocol details.

STARTFIELDCONTROLSYSTEM ADDRESSCOMMAND
Bits11156

As I already got the used values from LIRC config: shouldn't be too hard!

I tried to figure out the schematic and at least found out the remote in and out are connected to the same pins. So, if I measure the output when I trigger it with a remote and mirror the output back to it, that should be all! Unfortunately, I didn't have a scope to check the signal, nor did I want to drag the 14kg amp to a local hackerspace to connect it over there.

So, I just assumed, that the remote input/output connectors would use the same RC-5 protocol. So I programmed that on a PIO of a Raspberry Pi Pico W, based on the Raspberry Pi Manchester encoding pio example, connected it to either of the remote connectors on the back (they were wired similar anyway!) and tried it out by sending a mute command to the amplifier and... nothing happened.

Assuming I just made an error I checked the code until it ended up like below, still, nothing though.

 start:
    OUT null, 32           [1]  ; empty OSR before new pull, add delay to finish last bit
    PULL block      side 0      ; set to 0 and (externally) wait for next word
    OUT Y, 5                    ; the amount of data bits, store from OSR in Y

.wrap_target
    get_bit:
        JMP Y-- start
        OUT X, 1                ; Always shift out one bit from OSR to X, so we can branch on it
        JMP !X do_0            
    do_1:
        nop         side 0 [3]  ; Low for 4 cycles (3 delay, +1 for nop)
        JMP get_bit side 1      ; High for 1 cycle. 'get_bit' takes another 3 cycles

    do_0:
        nop         side 1 [3]  ; Output high for 4 cycles
        nop         side 0      ; Output low for 1 cycle
.wrap

At this point I gave up for a bit and tried finding more information on the RC5 protocol and got to a page on San Bergmans his SB-Projects site. It confirmed the 14 bit command from Wikipedia, but added a bit of information regarding the carrier signal. So, instead of sending a constant on-pulse, it sends a burst of 32 short pulses according to the image below, depending on whether it is a 1 or a 0.

Initially I falsely assumed, each bit was sent in one cycle (38kHz for the Marantz given that is uses a GP1U28XP (refdes 7403 in the service manual)), but instead, 1 carrier pulse was sent each cycle.  On top of that, the pulse/pause ratio was supposed to be 1/3-1/4 to save power. But that wasn't part of my PIO-program!

RC-5 carrier signal
RC-5 carrier signal

Thinking (in hindsight also incorrectly) that was the problem, I got to programming again and came up with the following, which, spoiler alert, also did nothing. I do want to check if it works like intended when I get my hands on a scope though. So far, it is still untested.

; Transmit one bit every 8 cycles. a '0' is encoded as a high-low sequence
; (each part lasting half a bit period, or 4 cycles) and a '1' is encoded as a
; low-high sequence.
;
; Side-set bit 0 must be mapped to the GPIO used for TX.
; The program starts at the public label 'start'.

.define public RPU 1                    ; ratio pulse
.define public RPA 3                    ; ratio pause
.define public PL (RPU+RPA)             ; pulse length, RPU+RPA
.define public CC 32                    ; cycles

start:
    OUT null, 32        side 0          ; empty OSR before new pull, add delay to finish last bit
    PULL block          side 0          ; set to 0 and (externally) wait for next word
    OUT Y, 5            side 0          ; the amount of data bits, store from OSR in Y

.wrap_target
    get_bit:
        JMP Y-- new_bit side 0 [PL-4]   ; if not 0, get next bit
        JMP start       side 0
    new_bit:
        OUT X, 1        side 0          ; Always shift out one bit from OSR to X, so we can branch on it
        JMP !X do_0     side 0          ;

    ; logic 1 starts with 32 silence, then 32 pulses
    do_1:
        SET X, (CC-3)   side 0 [PL-1]   ; Prepare X, first silence
    loop10:
        JMP X-- loop10  side 0 [PL-1]   ; 30x silence
        SET X, (CC-1)   side 0 [PL-1]   ; Prepare X, last silence
    loop11:
        nop             side 1 [RPU-1]  ; Start of next pulse
        JMP X-- loop11  side 0 [RPA-1]  ; Low part of pulses
        JMP get_bit     side 1          ; Start of last pulse
    
    ; logic 0 starts with 32 pulses, then 32 silence
    do_0:
        SET X, (CC-2)   side 1 [RPU-1]  ; Prepare X, start first pulse
    loop01:
        nop             side 0 [RPA-1]  ; Low part of pulses
        JMP X-- loop01  side 1 [RPU-1]  ; Start of next pulse
        SET X, (CC-2)   side 0 [RPA-1]  ; Prepare X again, finish last pulse
    loop00:
        JMP X-- loop00  side 0 [PL-1]   ; 31x silence
        nop             side 0          ; Start of last silence
.wrap

 After that, I figured out that I was wrong again, I think. As said, the amplifier uses the GP1U28XP, see block diagram below, which already removes the carrier signal and makes a nice RC-5 signal out of it. So, all of the work on adding the carrier signal to my PIO for nothing (apart from a good learning experience though).

GP1U28XP (refdes 7403) block diagram
GP1U28XP (refdes 7403) block diagram

Then I also figured out that as the carrier signal is processed by the IR receiver, my frequency was completely off. So instead of 1 bit each cycle, it was 1 bit each 64 cycles. Which meant my initial code was 64x too fast.

I called it an evening, to continue later.

PCB oddities

Some time later. when I installed the replacement power switch 1201 and the microswitch-assembly (see previous log), I found something peculiar. As the remote I/O connectors are physically placed on the power board that I was soldering to, I noticed that a diode was placed on the bottom side at the remote I/O connectors.

That was odd, as all components were on the top side (single sided boards, no internal layers, with traces on 1 side only, impressive!). Furthermore, one trace seemed damaged.

Bottom side of the remote I/O connector
Bottom side of the remote I/O connector

After some bleeping and measuring with a multimeter, I came up with the implemented circuit of the picture below.

Remote IO connector circuit comparison (service manual on the left, measurement on the right)
Remote IO connector circuit comparison (service manual on the left, measurement on the right)

So it seems the input and output were not connected together after all! According to the schematics they were, but add a later design point, a trace was cut and a diode added.

An assumption from my side is that it could be that this amplifier-series was one of the first featuring the remote I/O connectors and they missed an edge case which could mess up the signals to the IC. For example when more than 2 systems were hooked up together, all in range of the remote? I'm not entirely sure. But when looking at the current (November 2024) line up of Marantz amplifiers, for example the model 60n, the remote IO connectors are still featured on the back. I would assume that they still use the exact same protocol, to have them backwards compatible with each other. They did add an extra switch for selecting internal or external source of the remote signal on newer models though...

Conclusion

So, in conclusion for the next time I'm trying my luck:

Discussions