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

I2C switch is not initialized by MCU #33

Open
roman-dvorak opened this issue May 10, 2024 · 0 comments
Open

I2C switch is not initialized by MCU #33

roman-dvorak opened this issue May 10, 2024 · 0 comments

Comments

@roman-dvorak
Copy link
Member

I2C switch je ve výchozím stavu přepnutý tak, že je průhledný ze strany MCU. Při interakci s I2C komponentami z počítače (USB) je nutné si switch přepnout.

Firmware by si měl sám, alespoň při startu, tento i2c přepínač přenastavit.

V obsluze i2c přepínače z počítače mám tento kód s komentáři:

        if usb_direction:
            # Do usb se to prepne tak, ze bit[0] a bit[2] mají rozdilne hodnoty, bit[1] a bit[3] jsou read-only
            self.ftdi.write_byte_data(self.addr_switch, 0x01, 0b011)
        else:
            # I2C do ATMEGA se to prepne tak, ze bit[0] a bit[2] maji stejne hodnoty hodnoty
            self.ftdi.write_byte_data(self.addr_switch, 0x01, 0b0000)

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

No branches or pull requests

1 participant