bduke
Posts: 10
Joined: Wed Nov 22, 2017 7:21 pm

CAMERA_0_UNICAM_PORT definition

Sat Dec 09, 2017 4:09 am

Hi,

I'd like to confirm my understanding about the camera pinout and device tree setup. Please note that I am using a CM3 with a custom IMX219 sensor, not the standard Pi camera PCB. The instructions posted here: https://www.raspberrypi.org/documentati ... -camera.md are great. My application has some hardware differences, however, and I want to make sure my pinmux is correct.

I have the camera sensor data/clock lines connected to the CAM0 pins on the SOC. I have a GPIO (CAMERA_0_SHUTDOWN) going to the camera reset line. I also have CAMERA_0_UNICAM_PORT set to zero.

I am assuming that CAMERA_0_UNICAM_PORT indicates which data/clock pins should be used for this camera. So, if I set UNICAM_PORT to zero, the driver will use CAM0_DN0/CAM0_CP/CAM0_CN/CAM0_DP1/CAM0_DN1 for this camera. Is this correct?

(Example pinmux, note I've been forcing the reset pin "on" to keep the camera out of reset for testing)

Code: Select all

   pins_cm3 {
      pin_config {
        // Omitted defaults for brevity...     
        [email protected]  { function = "input";  termination = "pull_up";    }; // CAMERA 0 I2C0 SDA
        [email protected]  { function = "input";  termination = "pull_up";    }; // CAMERA 0 I2C0 SCL
        [email protected]  { function = "output"; termination = "no_pulling"; }; // CAMERA 0 LED
        [email protected]  { function = "output"; termination = "no_pulling"; polarity = "active_high"; startup_state = "active";}; // CAMERA 0 SHUTDOWN
        //other omitted for brevity
              }; // pin_config

      pin_defines {
        //Omitted for brevity...
        
        [email protected]_CAMERAS {
          type = "internal";
          number = <1>;
        };
        [email protected]_0_LED {
          type = "internal";
          number = <5>;
        };
        [email protected]_0_SHUTDOWN {
          type = "internal";
          number = <13>;
        };
        [email protected]_0_UNICAM_PORT {
          type = "internal";
          number = <0>;
        };
        [email protected]_0_I2C_PORT {
          type = "internal";
          number = <0>;
        };
        [email protected]_0_SDA_PIN {
          type = "internal";
          number = <0>;
        };
        [email protected]_0_SCL_PIN {
          type = "internal";
          number = <1>;
        };
      }; // pin_defines

    }; // pins_cm3

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5203
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: CAMERA_0_UNICAM_PORT definition

Sat Dec 09, 2017 7:44 am

Yes, camera_N_unicam_port sets up which set of clock and data pins are used for the csi data.
It is a little quirky that the default defines CAM1 socket as camera 0, but that's due to a copy/paste from the standard Pis where they only have one camera connector and it is unicam 1.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

bduke
Posts: 10
Joined: Wed Nov 22, 2017 7:21 pm

Re: CAMERA_0_UNICAM_PORT definition

Mon Dec 11, 2017 5:13 am

Thanks for answering the question. It's helping my troubleshooting efforts. I understand the CAMERA0,CAMERA1 confusion, but your answer helps to clarify it. The UNIPORT setting is really the key to making sure you're using the correct pins.

Return to “Camera board”

Who is online

Users browsing this forum: No registered users and 7 guests