Hi,
I used the Project Zero example as a base for my project. The Sensor controller unit is supposed sample the sensor with 1 kHz. If it´s memory is full it hands over the buffer to the main CPU.
The sensor data should the be send out via bluetooth.
The integration of the sensor controller unit makes some problems.
I followed the intructions in : http://software-dl.ti.com/lprf/simplelink_academy/modules/sc_01_project_from_scratch/sc_01_project_from_scratch.html#bonus-tasks-1-ndash-integrate-with-ble
static void ProjectZero_init(void) { /***************** Initialize the SCIF Driver (added)**********/ //Marked for long term tests // Initialize the SCIF operating system abstraction layer scifOsalInit(); scifOsalRegisterCtrlReadyCallback(scCtrlReadyCallback); scifOsalRegisterTaskAlertCallback(scTaskAlertCallback); // Initialize the SCIF driver scifInit(&scifDriverSetup); // Set the Sensor Controller task tick interval uint32_t N = 1000; // 1kHz RTC --> Not sure about it! // Enable RTC ticks, with N Hz tick interval scifStartRtcTicksNow(0x00010000 / N); // Start the "ReadCap" Sensor Controller task: Sensor Controller starts to measure scifStartTasksNbl(1 << SCIF_READ_CAP_TASK_ID); /**********************************************************/ }
/****************************SCIF Driver Callback Functions (added)***********************************/// Marked for long term tests // SCIF driver callback: Task control interface ready (non-blocking task control operation completed) static void scCtrlReadyCallback(void) { // Notify application `Control READY` is active ProjectZero_enqueueMsg(APP_MSG_SC_CTRL_READY, NULL); } // scCtrlReadyCallback
static void scTaskAlertCallback(void) { // Notify application `Task ALERT` is active ProjectZero_enqueueMsg(APP_MSG_SC_TASK_ALERT, NULL); } // scTaskAlertCallback
static void processTaskAlert(void) { // Clear the ALERT interrupt source scifClearAlertIntSource(); //... Access Sensor Controller task data structures here ... for whole array // For each available output buffer ... while (scifGetTaskIoStructAvailCount(SCIF_READ_CAP_TASK_ID, SCIF_STRUCT_OUTPUT) > 0) { SCIF_READ_CAP_OUTPUT_T* pOutput = scifGetTaskStruct( SCIF_READ_CAP_TASK_ID, SCIF_STRUCT_OUTPUT); for (int n = 0; n < SCIF_READ_CAP_BUFFER_SIZE; n++) { DATA_ARRAY[n] = pOutput->tdcBuffer[n]; } //Hand the buffer back to the Sensor Controller scifHandoffTaskStruct(SCIF_READ_CAP_TASK_ID, SCIF_STRUCT_OUTPUT); } // Acknowledge the ALERT event scifAckAlertEvents(); } // processTaskAlert
What is missing? Where could be the error?
I have no idea anymore what to test. I already tried a hardware and software interrupt, but it didn't solve the error.