Hello!

I am getting odd samples from TSC_ADC, definitely I am missing something. 
Can you help me to figure out what I am missing, please?

I am using a beagle bone black industrial by element14, debian 8.6, code 
composer studio v7, and this header 
<https://github.com/lore4/TSCADCss/blob/master/sys_tscadcss.h>. Sampling is 
done in this <https://hastebin.com/rucoludive.cs> code, which send data to 
an ARM task counterpart which displays values on stdout. 
The aim is to understand how to sample via TSC_ADC. :)

Currently, I am sampling a channel (i.e. inp = AIN6 = 1.6V, double checked 
with multimeter and oscilloscope) via TSC_ADC. This channel is sampled in 
single-ended mode and in differential mode (i.e. inm = AIN0 = GND ADC ). 
In order to do that, I am using 2 steps of TSC_ADC (i.e. from STEP1 and 
STEP2): the first step has differential mode enabled (i.e. STEP1 ), while 
the other step has single-ended mode enabled (i.e. STEP2). All steps 
averaging is set to 4 (i.e. 16 samples).

The resulting samples expressed as decimals are about:
- 1600 from STEP1;
- 1950 from STEP2.

These samples should be converted as 1.6V, but they do not by using official 
"formula" 
<http://processors.wiki.ti.com/index.php/AM335x_ADC_Driver's_Guide#Formula_Used_for_Calculation>.
 
For example, 1.6 / 4095 * 1.8 = 3640.

What I am doing wrong? : \

In order to enable the sampling, the following setps are done in such order 
in this <https://hastebin.com/rucoludive.cs> code: CTRL register is set to 
6, STEP1 & STEP2 Averaging is set to 4, STEP 1 Diff_CNTRL is set to 1, 
STEP1 & STEP2 SEL_INP_SWC_3_0 is set to 6, STEP1 SEL_INM_SWC_3_0 is set to 
0, STEPENABLE register is set to 6, and CTRL register is set to 7.

Best regards,
Lorenzo

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/18c64141-de14-4553-b0de-1726b5e4c995%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to