Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Full shutdown and powerup sequences for MiniscopeV4 Python480 sensor #333

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

aacuevas
Copy link
Collaborator

This is built on top of the PassthroughTweaks branch included in #332, must only be merged after that PR is merged

Adds full powerdown and powerup sequences for python480. Tests need to be done to see if they improve reliability or image quality or if there is any noticeable performance hit at initialization.

Some custom tweaks to the init sequence are possible, they might have an effect.

Resolves #331

aacuevas and others added 7 commits October 13, 2024 03:58
- I2C access using new addressing and initialization
- Set a I2C speed of 80KHz, arbitraty but proven to work
- Tweaked initialization delays
- Use the specific serializer enum for serializer addresses
- Use the DS90UB9x static method to set i2c speed
- Use the DS90UB9x static methos for serdes link initialization
@aacuevas aacuevas requested a review from jonnew October 15, 2024 03:35
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageConfiguration xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Packages>
<Package id="AForge" version="2.2.5" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aacuevas this was probably because you were messing around with the Video package in your bonsai installation, right? I don't think we need these dependencies in our local bonsai used to test this package.


//disable clock mgmt 2
WriteCameraRegister(atMega, 34, 0x0000); // Disable logic blocks
WriteCameraRegister(atMega, 32, 0x7004); // Disable logic clock
Copy link
Member

@jonnew jonnew Oct 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This always throws, indicating that the last line has somehow broken the back channel link or that the python no interacting with the bit-banged i2c to SPI translator correctly.

//enable clock mgmt 1
WriteCameraRegister(atMega, 2, 0x0000); // Set Monochrome sensor
WriteCameraRegister(atMega, 8, 0x0000); // Release PLL soft reset
WriteCameraRegister(atMega, 16, 0x0003); // Enable PLL
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If i remove lines 266-268 so I can get to this point, then this always throws.

Copy link
Member

@jonnew jonnew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, these changes don't work. There a couple points where back channel communication is somehow corrupted (even with a lock established by presence of purple LED). If we make these changes, it should be with @aacuevas having access to a miniscope because I dont have the bandwidth to change things, unless they are very well described.

@jonnew
Copy link
Member

jonnew commented Oct 17, 2024

Lets convert this to a draft for the time being.

@jonnew jonnew marked this pull request as draft October 17, 2024 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Miniscope initialization might be incomplete
2 participants