Hi Folks,
I've been trying to get a couple single channel data loggers working in a project. I am using DPlib v3.1 on the F28027.
I have two nets that have values put on them by DPLib ADC macros that vary the net values between 0 and ~0.09.
the DPL_ISR task runs at 21666khz , the singal to be sampled has a frequency of 50 Hz and the data log buffers are 150 words long.
I have set the two single channel data loggers up identically and according to the documentation.
#include <stdint.h>
#include "Settings.h"
#include "DPlib.h"
#include "DataLogging.h"
#include "IQMathLib.h"
#include "MacroNets.h"
#include "SQmath.h"
#define DLOG_SIZE 150 /* Sets size of data buffers. */
#define PRESCALAR 2.88f /* PreScalar = f_SMPL / (f_SIN * DLOG_SIZE). */
#define TRIGGER_LVL 0.07f
#pragma DATA_SECTION(DBUFF1, "DLOG_BUFF");
volatile int16_t DBUFF1[DLOG_SIZE] = {0};
#pragma DATA_SECTION(DBUFF2, "DLOG_BUFF");
volatile int16_t DBUFF2[DLOG_SIZE] = {0};
void initDataLoggers (void) {
uint16_t i = 0;
DLOG_1ch_OutputBuff1 = DBUFF1; /* Initialise first data logger. */
DLOG_1ch_TrigVal1 = _IQ24(TRIGGER_LVL);
DLOG_1ch_PreScalar1 = _SQ0(PRESCALAR);
DLOG_1ch_Size1 = DLOG_SIZE;
for (i = 0; i < DLOG_SIZE; i++)
DBUFF1[i] = 0;
DLOG_1ch_OutputBuff2 = DBUFF2; /* Initialise second data logger. */
DLOG_1ch_TrigVal2 = _IQ24(TRIGGER_LVL);
DLOG_1ch_PreScalar2 = _SQ0(PRESCALAR);
DLOG_1ch_Size2 = DLOG_SIZE;
for (i = 0; i < DLOG_SIZE; i++)
DBUFF2[i] = 0;
}
void connectDataLoggers (void) {
/* Connect the nets to be logged to data logger input terminals. */
DLOG_1ch_Input1 = &acNets.vRefNet;
DLOG_1ch_Input2 = &acNets.vFdbkNet;
}
Then in the main() the logger C functions are called as shown:
//... initPwm();/* Initialise PWMs (incl. SOCs). */ initAdc();/* Initialise the ADCs macros */ initDataLoggers();/* Initialise the data loggers. */ DPL_Init();/* Initialise the used macros with the DPL ASM ISR */ //...
And I have added the init macro call to DPL_Init() and the run-time macro to DPL_ISR()
However, even though I have verified that the nets do rise to values over 0.07 (the trigger level), no data is ever added into the data logger data buffers.... Have I configured the loggers incorrectly?? Am I using them incorrectly?
Thanks