Hi everyone, I’m testing an Arducam Mega with the Pi Pico SDK example over SPI, and I’m running into a strange issue. I can’t seem to set more than one parameter per image. For example, if I set saturation and then a Negative Effect, only the last one I set gets applied. The other one is basically ignored. Is it necessary, when communicating over SPI and writing through the registers, to write to all the registers at once for the settings to take effect? I’m wondering if I’m supposed to batch the register writes somehow.
Thanks for the details. Based on how the Arducam is designed, it’s actually not possible to set all the parameters at once. That’s not a limitation of your SPI code specifically, it’s how the parameter handling works on the device side. So the behavior you’re seeing, where only the last parameter takes effect, matches that design logic.
Okay, that makes sense. So just to confirm, I shouldn’t be trying to write a big block of registers in one go? Because I was starting to think my register addressing was wrong or I was missing some commit/write-enable step. The Pi Pico example doesn’t really make that clear.
Right, don’t try to push them all in one shot. The parameters need to be set in multiple steps instead. Go through each parameter one at a time and configure it carefully before moving to the next one. That step-by-step approach avoids conflicts and gives you accurate configuration. The key point is: when you attempt multiple parameters at once, only the last one you set is used.
Got it, that helps a lot. I have a follow-up though. I need to configure Autofocus, JPEG quality, and image resolution on the Mega. Is there a recommended order for these? Should Autofocus be done before resolution, or JPEG quality first, or something like that? I also hooked up an Analog Discovery to look at the SPI lines, and I noticed the camera’s response bytes vary when I set parameters, and also inside the wait_idle function. Is there any documentation on what those different response bytes mean?
From the program logic side, there’s no required order. Nothing needs to be configured first before the others. You just need to start the camera first, and after that you can configure the parameters. So no pre-configuration is required for autofocus, JPEG quality, or resolution before setting the others.
So just to be clear: start the camera, then set each parameter individually in separate steps, and I don’t have to worry about which parameter comes first? Also, any pointer on the response bytes I’m seeing on the SPI bus? Some of them look like status or ACK values, but they’re inconsistent, which is why I was asking about documentation.
Correct. Start the camera first, then configure the parameters one at a time in separate steps, and the order between autofocus, JPEG quality, and resolution doesn’t matter from a logic standpoint. Regarding the SPI response bytes, those varying responses you’re seeing while setting parameters and in wait_idle are part of the device’s internal status/acknowledgement behavior during those operations, so they won’t always look the same. The main takeaway for now is to keep parameter writes separate and sequential, and to initialize the camera before configuring anything. If you capture a specific byte sequence you’d like me to look at, feel free to post it here.