DSCSAM_ADSetSettings
This function configures the A/D channel(current,low & high), scan settings, A/D Trigger, A/D reference, oversampling/averaging, A/D single ended and A/D differential ended.
Name
Description
Sedi
0-1; 0 = single-ended, 1 = differential (Elton, Stevie & Jethro)
Lowch
low channel, 0-5(Single ended) [Elton, Stevie, Jethro & Ziggy]
low channel, 0-2(Differential ended) [Elton, Stevie & Jethro]
Highch
high channel, 0-5(Single ended) [Elton, Stevie, Jethro & Ziggy]
high channel, 0-2(Differential ended) [Elton, Stevie & Jethro]
Currentch
channel number 0-5 for current conversion
ScanEnable
0 = sample,
1 = scan
Adtrig
00 = software initiated A/D conversion
01 = external GPIO pin is used to trigger A/D conversion
Adsel
0 = A/D circuit 0,
1 = A/D circuit 1
Adref
00 = external reference (set to 3.3V)
01 = internal bandgap reference
Adtag
0 = upper 4 bits of 16-bit value = 0000
1 = upper 4 bits of 16-bit value contain A/D channel number
Adchset
ADCHSET = 0: Selects channel number for current conversion
ADCHSET = 1: Selects high/low channel number
Adres
00 = No oversampling, A/D resolution = 12 bits
01 = A/D resolution = 14 bits
10 = A/D resolution = 15 bits
11 = A/D resolution = 16 bits
Adsamples
Number of samples to be accumulated
1, 2, 4, 8, 16, 32, 64, 128, 256, 512 and 1024
Return Value
Error code or 0.
Last updated
Was this helpful?