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

Feature request for bootloader (if it possible) #12

Open
mizuapo opened this issue Nov 12, 2019 · 3 comments
Open

Feature request for bootloader (if it possible) #12

mizuapo opened this issue Nov 12, 2019 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@mizuapo
Copy link

mizuapo commented Nov 12, 2019

Dear Gustavo,

It is a very good feature, thank you! I have a new feature request:

I will make more than one attiny85 module (but i don't know how many pieces, about 3-4 variety but summary about 30 attiny85 module per board), but i don't want a make fix i2c slave address for the bootloader. So, my question: is it possible that the bootloader check the free i2c slave address, and if got it a free address reserve it? (the currently range is ok)

Summary:

  • attiny85 power on
  • Started the bootloader
  • Bootloader firstly runs an "i2cdetect" and search an free i2c address
  • if found it then reserved it, and then more works as i2c slave.
  • and the currently processing running.

Thank You,
Gabor

@casanovg
Copy link
Owner

casanovg commented Jan 24, 2020

Hi Gabor!

Sorry for the delay in answering ...

I will take a look, I think it is possible but with a high memory usage cost by the bootloader. As you may have noticed, the current Timonel Tiny85 I2C driver is "slave" only. That means that, as I recall, it would have no way to check the bus available addresses. According to the I2C protocol, a "slave" can only answer when its address is placed on the bus by the "master" or upon a master's I2C general call.

A possible solution would be adding I2C "master" capabilities to the driver, and run that way to find the first available address spot and assign it to itself. As I mentioned before, that will surely take a significant amount of memory out of the user application space.

Another approach could be using a master-slave solution combination (if you have control over your master I2C driver) by using a generall call and some sort of slave randomly delayed answer. This way the master would be responsible for accounting what slave addresses are already taken and dispatching the free ones in order of slaves' replies. This last solution would take less "slave" memory but it would have two drawbacks: a) it wouldn't be an I2C-standard solution, and b) the slave wouldn't be completely independent. It would depend on the master's driver implementation to assign its address.

What do you think?

@casanovg casanovg added the enhancement New feature or request label Jan 24, 2020
@casanovg casanovg self-assigned this Jan 24, 2020
@Bradleyking4
Copy link

would it be possible to store the I2c Address in EEPROM? and program that before soldering?

@casanovg
Copy link
Owner

casanovg commented Jan 28, 2020

would it be possible to store the I2c Address in EEPROM? and program that before soldering?

Hi! Yes, that is possible, but the OP is asking for some sort of "bootloader address auto-provisioning" once the chip is connected to the I2C bus. Is yours' a different requirement than the OP?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants