-
Notifications
You must be signed in to change notification settings - Fork 33
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
Wrong register values for Mic Bias #41
Comments
I don't think it is worth changing for the AIC3212, but I would typically use enums here. This allows coders to quickly look up the enum from the function's input argument, and ensures that only the correct range of values are used. With #defines, it is difficult to search for which define to use, unless you go off an example.
to
then in the function...
then in the function:
I think this is much cleaner. |
We've only ever used the full bias voltage (2.2v?), so these other voltage values have never ended up being an issue. It's good to get them correct, but it's not yet been revealed as a problem die to always using the full voltage. I agree that an enum send better. Someone else did the initial code where #define was used instead of enum. Enum seems better. Chip |
Value for 1.7V mic bias is not offset to the correct bits
Here is the register for Mic Bias (AIC3206), showing bias voltage as bits D5-D4. For example, to set Mic Bias to 1.7V, we need
TYMPAN_MIC_BIAS_POWER_ON | 0b0001 0000
0b0100 0001
instead of 0b0101 0000aic_writeAddress(TYMPAN_MIC_BIAS_REG, TYMPAN_MIC_BIAS_POWER_ON | TYMPAN_MIC_BIAS_OUTPUT_VOLTAGE_1_7); // power up mic bias
So I believe the way it is now, if you select 1.25V that's fine. But if you select 1.7, 2.5V, or the power supply, then you actually get 1.7V, with bit-0 set (which is reserved)
@chipaudette perhaps you can double-check this, then I will branch off to make these corrections. Does this mesh with the behavior you've seen?
The text was updated successfully, but these errors were encountered: