3. You will get the EOA interrupt. Write a 03h to BADR3+4, read 20 samples from FIFO, and then
write another 03h to BADR3+4.
Total number of samples is greater than 512, but less than 1024
1. Before you start the acquisition, write the total number of samples to the residual counter, an 87h to
BADR3+4 ( INTE, EOA_INT_SEL, and FIFO_HALF FULL enabled), and a 67h to BADR1+4Ch
(INTE and PCINTE enabled).
2. Start the acquisition
3. The first interrupt you get will be the FIFO_HALF FULL interrupt. Read 512 samples from FIFO
and clear the INT bit ( bit 6, BADR3+4).
4. The second interrupt you get will be the EOA interrupt. First clear the EOA_INT_SEL bit (bit 2
BADR3+4). Then read the total number of samples, less 512 from FIFO. Do not try to read the
entire residual count on the EOA interrupt. You already retrieved 512 of the residual on the
FIFO_HALF FULL interrupt in step 3. The last thing you should do in your interrupt service routine
is to clear the INT bit (bit 6, BADR3+4) and disable interrupts by writing a 0 to the INTE bit (bit 7,
BADR3+4).
EXAMPLE: 1000 total samples
1. Before you start the acquisition, write a 1000 to the residual counter, an 87h to BADR3+4, and a 67h
to BADR1+4Ch.
2. Start the acquisition
3. You will get a FIFO_HALF FULL interrupt. Read 512 samples from FIFO and write an 87h to
BADR3+4
4. You will get the EOA interrupt. Write a 03h to BADR3+4, read 488 samples from FIFO, and then
write another 03h to BADR3+4.
Total number of samples is greater than 1024
1. Before you start the acquisition, write the residual number of samples to the residual counter, an 83h
to BADR3+4 (INTE and FIFO_HALF FULL enabled), and a 67h to BADR1+4Ch (INTE and
PCINTE enabled). The residual number of samples is the remainder of the total number of samples
divided by 512.
2. Start the acquisition.
3. The first interrupt you get will be the FIFO_HALF FULL interrupt. Read 512 samples from FIFO
and clear the INT bit ( bit 6, BADR3+4).
4. Depending on the total number of samples, you will get some number of FIFO_HALF FULL
interrupts. For all but the second to last one, repeat step 3. On the second to last one, at the very end
of your interrupt service routine, you must enable the EOA_INT_SEL bit by writing a 1 to bit two of
BADR3+4. Be sure to enable EOA_SEL_INT after you have read the FIFO because the next
FIFO_HALF FULL is what triggers the residual counter to start counting.
5. After the second to last interrupt, the next interrupt you get will be a FIFO_HALF FULL interrupt.
Read 512 samples from FIFO and clear the INT bit ( bit 6, BADR3+4).
6. The next interrupt after that will be the EOA interrupt. First clear the EOA_INT_SEL bit (bit 2
BADR3+4). Then read the residual count from FIFO. The last thing you should do in your interrupt
service routine is to clear the INT bit (bit 6, BADR3+4) and disable interrupts by writing a 0 to the
INTE bit (bit 7, BADR3+4).
EXAMPLE: 1537 total samples
1. Before you start the acquisition, write a 1 to the residual counter (1537 / 512 = 3, a remainder of 1),
an 83h to BADR3+4, and a 67h to BADR1+4Ch.
30
Содержание PCIM-DAS1602/16
Страница 4: ...This page is blank ...
Страница 48: ...For your notes 44 ...