Arduino Shield: some commands do not work

Ask software engineering and SDK questions for developers working on Mac OS X, Windows or Linux.
  • Author
  • Message
Offline

madmage

  • Posts: 4
  • Joined: Fri Feb 23, 2018 1:17 pm
  • Real Name: Daniele Calisi

Arduino Shield: some commands do not work

PostFri Mar 02, 2018 11:26 am

Hello everyone.
I have a Blackmagic Micro 4k, an Arduino Shield and an Assistant to see the output of the camera.
I tried some commands with the arduino shield and I succeed in changing White Balance, exposure (I see the values changing in the Assistant), tally white/red, etc. but I do not succeed in changing video mode (Page 20 of Blackmagic_3G-SDI_Arduino_Shield_Manual.pdf). I send the following command:

Code: Select all
    int8_t v[5] = { 25, 0, 5, 0, 0 };
  sdiCameraControl.writeCommandInt8(1, 1, 0, 0, v);


I expect the video mode to be changed into: 25fps, regular frame rate, 2k of size, not interlaced and YUV, but the settings in the video assist remain unchanged (2160p24). What am I doing wrong?
I also used different settings (e.g., changing only the fps with { 25, 0, 6, 0, 0 }) with no luck.
Offline
User avatar

Baz

  • Posts: 502
  • Joined: Wed Aug 22, 2012 5:06 am
  • Location: Sydney, Australia

Re: Arduino Shield: some commands do not work

PostSat Mar 03, 2018 12:52 am

I think it needs to power cycle after the change is commanded (a reboot).
Baz

MISC
U/S Express, SmartviewDuo, SmartScopeDuo, Teranex 2D, Web Pres, 5/7 Vid Assists
VIDEOHUB
Smart 12x12
12x24
72x144
HYPERDECK
Studio, Shuttle, Studio Mini
ATEM
2me4K, 2me, TVS, TVS HD, CamConvs, StudioConvs, Studio Cams, Micro Studio Cam
Offline
User avatar

Xtreemtec

  • Posts: 2625
  • Joined: Wed Jan 02, 2013 11:48 am
  • Location: The Netherlands

Re: Arduino Shield: some commands do not work

PostSat Mar 03, 2018 2:29 pm

Also i have the idea that you did not PAD it to 8 commands.. The protocol works in blocks of 4 data bytes.
Not sure if you need to do that with the Shield or the shield fix this on it's own.
Daniel Wittenaar .:: Xtreemtec Media Productions ::. -= www.xtreemtec.nl =-
4K OBV, ATEM TVS HD, 1M/E 4K, 2M/E Broadcast Studio 4K, Hyperdeck Studio Mini, SONY FS7 4K, Ursa Broadcast 4K
Offline

Kristian Lam

Blackmagic Design

  • Posts: 601
  • Joined: Tue Aug 21, 2012 1:11 pm

Re: Arduino Shield: some commands do not work

PostMon Mar 05, 2018 6:43 am

madmage wrote:Hello everyone.
I have a Blackmagic Micro 4k, an Arduino Shield and an Assistant to see the output of the camera.
I tried some commands with the arduino shield and I succeed in changing White Balance, exposure (I see the values changing in the Assistant), tally white/red, etc. but I do not succeed in changing video mode (Page 20 of Blackmagic_3G-SDI_Arduino_Shield_Manual.pdf). I send the following command:

Code: Select all
    int8_t v[5] = { 25, 0, 5, 0, 0 };
  sdiCameraControl.writeCommandInt8(1, 1, 0, 0, v);


I expect the video mode to be changed into: 25fps, regular frame rate, 2k of size, not interlaced and YUV, but the settings in the video assist remain unchanged (2160p24). What am I doing wrong?


Firstly, the camera has no 2k format support so that will fail. You need to pick a format that is supported by the camera.

I also used different settings (e.g., changing only the fps with { 25, 0, 6, 0, 0 }) with no luck.


Does this code work for you?

Code: Select all
#include <BMDSDIControl.h>

const int shieldAddress = 0x6E;
BMD_SDITallyControl_I2C sdiTallyControl(shieldAddress);
BMD_SDICameraControl_I2C sdiCameraControl(shieldAddress);

void setup()
{
sdiCameraControl.begin(); // initialize camera control
sdiCameraControl.setOverride(true); // enable camera control override

int8_t settings[] =
{
   25, // Frame rate 50
  0, // M-Rate Regular
  6, // Dimensions UHD
  0, // Progressive
  0 // Color Space YUV
  };


sdiCameraControl.writeCommandInt8(
1, // Camera 1
1, // Catergory Video
0, // Param Video Mode
0, // Operation: Assign Value
settings
);

 
sdiCameraControl.writeCommandInt16
  (
    1, // Camera 1
    1, // Catergory Video
    2, // Param Manual White Balance
    0, // Operation: Assign Value
    5600 // 5600K
  );

}


void loop()
{
}
Offline

Kristian Lam

Blackmagic Design

  • Posts: 601
  • Joined: Tue Aug 21, 2012 1:11 pm

Re: Arduino Shield: some commands do not work

PostMon Mar 05, 2018 6:44 am

Baz wrote:I think it needs to power cycle after the change is commanded (a reboot).
Baz


Hi Baz,

Not necessary. When a command that necessitates a reboot is required, the camera will do it automatically.
Offline

madmage

  • Posts: 4
  • Joined: Fri Feb 23, 2018 1:17 pm
  • Real Name: Daniele Calisi

Re: Arduino Shield: some commands do not work

PostMon Mar 12, 2018 9:31 am

Thanks Kristian Lam for your answer,
I tried your code (and I also did many other tests). If I start the camera with 2160p24 (set by Video Assist) and I run your code, it does not work (i.e., nothing changes), but I found out that if I set the video mode to 2160p25 and then I start your code, the mode changes, but to 2160p24!
I am also able to set 1080p24 with { 24, 0, 3, 0, 0 }, but the same happens also with { 25, 0, 3, 0, 0 } and { 22, 0, 3, 0, 0 }. On the other hand, if I set the resolution to 1080 (with this code or with Video Assist), I am able to set (with the shield) to 2160p24, whatever I put on the first parameter (I tried 0, 1, 2, 3, 22, 30, 40, 24, 25, etc.).
In the code you sent, you put a 25 and say it set the frame rate to 50, so my question is: the first parameter is the exact frame rate I want (i.e., 24 for 24fps, 25 for 25fps... but in this case, what should I say if I want 29.97? Just setting M-rate would transform 30 in 29.97?) or is a code (i.e., 1 for 24fps, 2 for 25fps, etc.)? In the latter case, what are the codes (I do not have any mention on them in my Arduino Shield Manual)?
Offline

madmage

  • Posts: 4
  • Joined: Fri Feb 23, 2018 1:17 pm
  • Real Name: Daniele Calisi

Re: Arduino Shield: some commands do not work

PostWed Mar 14, 2018 7:56 am

Up!

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 0 guests