Default ADC configuration by Linux drivers

@RobertCNelson I found BB-ADC-00A0.dts in

debian@beaglebone:/opt/source/bb.org-overlays/src/arm$

So if I wanted it to average 4 reads on channels 0, 1, 2 then I would change the line

ti,chan-step-avg = <16 16 16 16 16 16 16 16>;

to

ti,chan-step-avg = <4 4 4 16 16 16 16 16>;

save; make; sudo make install?

Also, the file is a little confusing. The one you referenced above has these lines…

Configure one or more (up to 8) steps for the adc to execute:


		// For each step, the channel to sample.
		//	range: 0 .. 7
		ti,adc-channels = <0 1 2 3 4 5 6 7>;

The ADC has 8 analog channels but the ability to have 16 steps.

So does ti,adc-channels = <0 1 2 3 4 5 6 7> just set up the 8 analog channels or is it relating a channel to 8 steps. For example, if I wanted to assign analog channel 1 to steps 0, 5 and 10 ( I don’t but bare with me) how would that be done? And if I only want three steps to execute, how is that done in this file?

1 Like

Correct!

1 Like

that just set’s up which of the ‘8’ channels are exported… When this driver was written, 3-4 channels could be a touchscreen (thus another driver), the rest could be used as general purpose adc.

for example here: src/arm/overlays/BB-BONE-LCD4-01-00A1.dts · v5.10.x-ti-unified · BeagleBoard.org / BeagleBoard-DeviceTrees · GitLab 4 for touchscreen, 4 for adc…

Regards,

Thank you. That’s a very good example.

Can you recommend a very good primer or other source to help me understand the syntax for building the dts files, how I turn them into actual running overlays and how I then use the results? I keep putting off learning this and I think I need to now. Google doesn’t bring back a good, unified primer on this. Any recommendations?