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 write transaction to write multiple registers at once #4

Open
toyoshim opened this issue Jul 27, 2016 · 1 comment
Open

I2C write transaction to write multiple registers at once #4

toyoshim opened this issue Jul 27, 2016 · 1 comment

Comments

@toyoshim
Copy link
Owner

originally proposed by @opmregisters.

In the professional use-case, it's important to control all channels at the same time as possible. But I2C isn't enough fast even for pretending it.

Probably, one possible and reasonable solution for this is to allow bulk a kind of transfer. Now PSG and SCC ends accept 2Bytes write only, first byte is register and the second byte is data. But probably, it should allow 2n Bytes write, 2Nth byte is N+1th register and 2N+1 byte is N+1th data, and reflects all N write operations at once.

It may be hard in terms of CPU performance restriction, but worth considering.

@toyoshim
Copy link
Owner Author

toyoshim commented Aug 7, 2016

Another approach:

  1. write 1 to 0xfe, a special register "shadow registers control". this operation copies all register values to shadow registers
  2. while the register is set to 1, all register writes for other normal are stored into shadow registers
  3. write 0 to 0xfe, reflect all values wrote to shadow registers

Application will set 1 to 0xfe on starting vsync period, and do register write operations as usual, then set 0 to 0xfe on ending vsync period.

It's hard to say which is better in terms of minimizing i2c bus traffic. The first one will minimize the total message size, but transaction happens at once. The second one still update registers on the go, but it effectively utilize the bus throughput.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant