-
Notifications
You must be signed in to change notification settings - Fork 19
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
What is writeConfigSparkFun #18
Comments
Hi @alberk8 ,
Each key slot on this device must be configured properly to allow certain features. Both the keyType and the slotConfig for each slot must be programmed before the config is locked. We are setting up the slot to work as we want for our examples to work. You can read more about all the available settings for each key slot on page 20 of the datasheet here: SlotConfig Bits for slots begin at byte 20 of the EEPROM (aka part of the config zone). KeyConfig Bits for slots begin at byte 96 of the EEPROM. Each bit within each settings byte all work together to get the desired functionality to work. Unfortunately, that leads to quite a bit of jumping around the datasheet and double-checking. Also, you can't really test your settings until the config is locked, so that means if you get them incorrect, then that IC is no longer functional. So, unfortunately, until you gain lots of experience with this IC, it means that it is fairly difficult to avoid bricking at least one or two ICs during new configuration experimenting. If you are interested in setting up the IC to do other features outside of our examples, then I'd like to suggest you reach out to the forum to see if there are any other users doing something similar. Hope this helps, |
Thank you for the reply. What I don't understand for example is SlotConfig, where the (20 is divided by 4) |
There is a lot of information about address encoding on page 58 of the datasheet (section 9.1.4). But basically, the slots/blocks/word-offsets are designed in a way that makes it efficient to create the actual word address you need to send. (Specifically, the fact that data is accessed on a 4 byte word boundary). Without going into all the actual steps needed to create the necessary param2 address, you can simply take the desired address and drop the least significant two bits. (This can be accomplished by dividing by 4). Note, address encoding is different for the config/otp zones vs the data zone. Because we are working within the config zone for these writes, we are able to divide by four and the address byte is "scooted" over (dropping least sig two bits) to indicate the necessary block and offset: Byte 20 is B0001 0100. divide by 4 and you get: B0000 0101 Bits [4:3] are our block: 0 Byte 96 is B0110 0000 divide by 4 and you get: B 0001 1000 Bits [4:3] are our block: 3 Hope this helps! |
Thank you. This is a fantastic and clear explanation. |
The specs says writing/reading is 4 or 32 bytes. when writing to the 4 bytes operation (slot config). which of the 2 bytes are of significant (the 2 MSB or 2 LSB) ?. |
Can someone explain to me what this does and where is the document.
SparkFun_ATECCX08a_Arduino_Library/src/SparkFun_ATECCX08a_Arduino_Library.cpp
Line 1054 in 155ccbc
The text was updated successfully, but these errors were encountered: