Trying to clone JVC camera controller

Hello everyone I'm working to make a clone on a JVC RM-LP55 camera control unit.

This device talks to studio camera's via a serial connection.

Below is a screenshot of a logic analyzer with the controller telling the camera to turn on color bars.

The controller starts the conversation by sending a value of 0x83 and the camera returns a value of 0xA0 I'm assuming this is a handshake or a ready command. The controller then sends 3 values over the wire 0x41 0x00 0x41 then the camera responds with 0xA0. I'm assuming this the "I got it response"

The controller then sends a 0x83 again then the camera responds with a 0xA0 then the controller sends the values 0x40 0x0A 0x4A and the camera reply's 0xF2 and then the camera will show color bars.

If this command sent again color bars will turn off.

I am having trouble talking to the camera because the serial commands need specific timing between listening and replying.

I can get the camera to reply to the first 0x83 with 0xA0 but for past that I'm stumped.

My code needs to send the 0x83 then wait for the reply of 0xA0 send the 3 values and wait for reply of 0xA0 and so on.

I have tries making the code wait for the 0xA0 reply from the camera with both IF statements and while serial. available statements and both seem to send the the values before the camera finishes the reply of 0xA0.

    if (buttonState == HIGH ){
    
    Serial1.write(0x83);
    
    
    while (Serial1.available() == 0xA0)
    Serial1.write(0x41);
    Serial1.write(0x00);
    Serial1.write(0x41);
}

As a secondary problem I need the ability to only let the code run once per button press right now it will rapidly send the code over and over until the button is released.

The end goal is to make this device wirelessly controlled with a esp32 or alike device to control the camera by wireless.

Any input would be great! Thanks.

while (Serial1.available() == 0xA0)

As long as there are 160 characters available in the serial buffer, only repeat

Serial1.write(0x41);

If Serial1 is a HardwareSerial, unless you modified the Serial buffer in the HardwareSerial class, that will never contain 160 bytes; default is 64 bytes. So the first 0x41 will never be written.

But you did not post your full code or indicate which board you're using, so we will never know for sure what Serial1 is.

Regarding the single run on a button press, chect the StateChangeDetection example in the IDE; you want to react when the button becomes pressed, not when it is pressed.

@sterretje I think it is time to change that 15 in your sig, seen you around for years.

Just sayin’.

a7

@alto777,

Yeah, it's now around 20.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.