Skip to content

Update core_esp8266_wiring_analog.c #443

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

Merged
merged 1 commit into from
Jun 26, 2015
Merged

Update core_esp8266_wiring_analog.c #443

merged 1 commit into from
Jun 26, 2015

Conversation

Testato
Copy link
Contributor

@Testato Testato commented Jun 18, 2015

analogRead bugfix discussed here:
#338

@Testato Testato mentioned this pull request Jun 18, 2015
@me-no-dev
Copy link
Collaborator

Maybe here is the place to actually use analogReference and make it switch between vdd and tout.
And even if it does nothing, analogReference should stay for compatibility, and good point on the missing arguments!

@me-no-dev
Copy link
Collaborator

Also to point out, system_get_vdd33 does return a good clean analog reading of the TOUT pin. The fact that you needed to change it needs resolving, because changing it here will break it for me, so needs to e made to work properly in a different way.

@Testato
Copy link
Contributor Author

Testato commented Jun 23, 2015

@me-no-dev but, like i described befoure the TOUT can be used for only one think, VDD mesaurement OR analogRead. The way for choose this is changing and uploading the init bin file whit the right value on it (33 for analogread and 255 for VddRead).
But this core actually do not support this function.
So if on the ESPboard is uploaded from factory the init bin file whit the AnalogRead function active, we cannot use system_get_vdd33.

My pullrequest is only for analogRead problem, and it work. Only after the init bin file uploading function added to this core we can have a good readVdd function.

For the analogReference also is there two way that we can choose, whitout the argument it is unusefull, so what you prefer ? I prefer have an error during compilation instead of a good compilation but no clear/working analogReference function.

@igrr is it very difficult adding the init bin file uploading ? this is the real solution and we can create a final version of core_esp8266_wiring_analog.c file.
we can create two version of init bin file, and when the user use analogRead, or system_get_vdd33 the correct init bin file will be uploaded

@Testato
Copy link
Contributor Author

Testato commented Jun 23, 2015

@me-no-dev
you write: "system_get_vdd33 does return a good clean analog reading of the TOUT pin"

This is a common error, the official SDK documentation is clear, the system_get_vdd33 does NOT return the analog read on TOUT.
system_get_vdd33 must return the value on power pin 3 and 4, and in this case the TOUT pin 17 must be floating
I posted the official API explanation of system_get_vdd33 and system_adc_read

@Links2004
Copy link
Collaborator

will this not work for the init bin problem?
1803f30#diff-3776add87f5c7f96ac02b7fbfef5305aR204

@Testato
Copy link
Contributor Author

Testato commented Jun 24, 2015

This is good, so igrr start to work on probkem :-)
If you look at 107th byte you have what i writed many more. This byte is at 33, so the Tout pin will be used ONLY for analog read.
We need another PHY setting whit 255, and Tout pin floating, for the vdd supply read.

But for now the init bin file is not uploaded, so we must wait fir this to work

@igrr
Copy link
Member

igrr commented Jun 24, 2015

With the change in 1803f30 it is not necessary to upload the init bin file. Init data is created in code and passed directly to PHY init function. What you have in flash no longer matters.

@Testato
Copy link
Contributor Author

Testato commented Jun 24, 2015

ok this is very good.
So for the analogread vs vddread how we can pass the 33/255 value to vdd33_const ? (107th byte of PHY init function)

igrr added a commit that referenced this pull request Jun 24, 2015
igrr added a commit that referenced this pull request Jun 26, 2015
Update core_esp8266_wiring_analog.c
@igrr igrr merged commit ab9b8e3 into esp8266:esp8266-sdk-1.0 Jun 26, 2015
igrr added a commit that referenced this pull request Oct 29, 2015
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

Successfully merging this pull request may close these issues.

4 participants