17.4.15 Sequencers
When the list record is triggered, a sequence of microcommands is executed for this record. The microcommands are called sequences and are divided into two types: DCS (data collection or acquisition sequence) and MS (math sequence). The acquisition and math sequences are executed in the order shown in Figure 17-8 and Figure 17-9.
There are two hardware predefined sequences: to make ADC conversion (DATASEQ bits =
0 in the ITCLSxSEQ register) and to run CVD (DATASEQ bits =
1 in the ITCLSxSEQ register). Also, the custom sequences commands
can be programmed (initialized) by the software in the register’s arrays. One array (16
of ITCSDATACMDx command registers) is dedicated for the acquisition sequences, and
another array (16 of ITCSMATHCMDx command registers) contains the math sequences. These
arrays can be split to store several sequences. For the acquisition commands, they are
defined by SPLITx[1:0] bits in the ITCSDATAMAP register, and for the math commands, they
are defined by SPLITx[1:0] bits in the ITCSMATHMAP register. The SPLITx[1:0] bits allow
dividing all commands in the arrays into a few sequences, as shown in Table 17-2.
| Sequencies | Command registers and control SPLIT bits in ITCSDATAMAP and ITCSMATHMAP registers | |||
|---|---|---|---|---|
| 0-3 | 4-7 | 8-11 | 12-15 | |
| SPLIT0[1:0] | SPLIT1[1:0] | SPLIT2[1:0] | SPLIT3[1:0] | |
| One 16 steps sequence (registers: 0-15) | 0 | 0 | 0 | 0 |
| Two 8 steps sequences (registers: 0-7 and 8-15) | 2 | 2 | 2 | 2 |
| One 8 step and two 4 steps sequences (registers: 0-7, 8-11 and 12-15) | 2 | 2 | 3 | 3 |
| Four 4 steps sequences (registers: 0-3, 4-7, 8-11 and 12-15) | 3 | 3 | 3 | 3 |
When the acquisition commands array is split into a few sequencies, the commands in each sequence should be assigned to a sequence number set in the DATASEQ[2:0] bits of the ITCLSxSEQ register. The user can select any unique sequence number from 4 to 7 to identify the sequence. The acquisition sequence number settings example is shown in The Acquisition Sequence Number Assignments.
The Acquisition Sequence Number Assignments
// Split all commands in 3 sequences
ITCSDATAMAPbits.SPLIT0 = 2;
ITCSDATAMAPbits.SPLIT1 = 2;
ITCSDATAMAPbits.SPLIT2 = 3;
ITCSDATAMAPbits.SPLIT3 = 3;
// List 0 will be processed by sequence number 5
ITCLS0SEQbits.DATASEQ = 5;
// Assign first 8 steps sequence to number 5 to be processed by list 0
ITCSDATAMAPbits.DATASEQ0 = 5;
ITCSDATAMAPbits.DATASEQ1 = 5;
// List 1 will be processed by sequence number 6
ITCLS1SEQbits.DATASEQ = 6;
// Assign second 4 steps sequence to number 6 to be processed by list 1
ITCSDATAMAPbits.DATASEQ2 = 6;
// List 2 will be processed by sequence number 7
ITCLS2SEQbits.DATASEQ = 7;
// Assign third 4 steps sequence to number 7 to be processed by list 2
ITCSDATAMAPbits.DATASEQ3 = 7;
When the math commands array is split into a few sequences, the commands in each sequence should be assigned to a sequence number set in the MSEQ[3:0] bits of the ITCSDATACMDx command register. The user can select any unique sequence number from 4 to 7 to identify the sequence.
The math sequence number settings example is shown in Math Sequence Number Assignments. In this example, the acquisition commands are configured to execute two 8 step math sequences number 5 and 6.
Math Sequence Number Assignments
// Split all commands in 2 sequences
ITCSMATHMAPbits.SPLIT0 = 2;
ITCSMATHMAPbits.SPLIT1 = 2;
ITCSMATHMAPbits.SPLIT2 = 2;
ITCSMATHMAPbits.SPLIT3 = 2;
// First 8 steps sequence is 5
ITCSMATHMAPbits.MATHSEQ0 = 5;
ITCSMATHMAPbits.MATHSEQ1 = 5;
// Second 8 steps sequence is 6
ITCSMATHMAPbits.MATHSEQ2 = 6;
ITCSMATHMAPbits.MATHSEQ3 = 6;
// This data acquisition command will execute the math sequence 5
ITCSDATACMD0bits.MSEQ = 5;
ITCSDATACMD0bits.MSTART = 1;
// This data acquisition command will execute the math sequence 6
ITCSDATACMD1bits.MSEQ = 6;
ITCSDATACMD1bits.MSTART = 1;
ITCSDATACMD1bits.END = 1;
