Closed LaZsolt closed 2 years ago
is this why I'm getting 12bit default adc on projects
Hey @LaZsolt ! This will be a breaking change, right? (10bt analg read by default) I'll then release an intermediate version before, and then another one with this as v2. Do you mind adding a small example sketch to switch between analogRead resolutions?
This will be a breaking change, right?
Yes, but as @jayzakk mentioned in https://github.com/dbuezas/lgt8fx/issues/41 the aduino default is 10 bits for backward compatibility with AVR based boards.
I think not necessary any example sketch, because it is a normal Arduino analog API extended function for those boards which have 12 bits ADC. Documentation: https://www.arduino.cc/en/Reference.AnalogReadResolution
It may be unpleasant for those users who will be upgrading dbuezas/lgt8fx core.
Gotcha. I'll make a release without, and then merge this one and move to v2 following semver
But this request is not mainly about AnalogReadResolution.
In this line below, because of the bitmask of pin
variable, only 8 analog inputs reachable. (A0 - A7)
https://github.com/dbuezas/lgt8fx/blob/97e273aa27bd71ec168c2fa569a567edd3600abe/lgt8f/cores/lgt8f/wiring_analog.c#L147
With my correction more inputs will be readable: PIN_A8, PIN_A9, PIN_A10, PIN_A11, IVREF, AGND, DACO, 1/5 AVCC, 4/5 AVCC
Oh, so this is not breaking change then. Should i merge now?
This pull request is two in one.
1st - expanding ADMUX pin select bitmask from 0x07 to 0x1F
2nd - changing the default resolution of analogRead()
to 10 bits for Arduino compatibity reason.
AnalogReadResolution(12);
. (At least in the setup function.)I think it's acceptable. If you think the same then you should merge it.
Oh got it. Then Ill hold it a bit and very soon make 2 releases. The first without and the second with (and that will be v2.0.0)
So this is the problem says why my A8 pin of wavgat board reject at build ? Arduino : 1.8.15 (Linux), Carte : "LGT8F328, Default (64), Internal, 32 MHz, 328P-LQFP32 (e.g. MiniEVB nano-style and WAVGAT)"
'A8' was not declared in this scope
@navr32 In LGT8F328P-LQF32 the A8, A9 and A11 analog inputs not connected to any pins. That's why not declared. I assume the A8 name is wrong on the WAVGAT board. The real name coud be A6.
Hi LaZolt ! You assume very well ! I just come to test it and this is A6 so simple ...very annoying i haven't think to this..many thanks.
Close this request, because https://github.com/dbuezas/lgt8fx/pull/217 include the solution.