Hi
Can you please show me an example of how to import a Sensor Controller Studio example into CCS with Freertos or without RTOS.
Kind Regards
David
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi
Can you please show me an example of how to import a Sensor Controller Studio example into CCS with Freertos or without RTOS.
Kind Regards
David
When you generate code from Sensor Controller Studio one of the files is called scif_how_to_use.html. This describe how the Sensor Controller image should be integrated with the application code running on the CM4F.
Also see dev.ti.com/.../node
Hi Ter
Yes I have found those but both use you Ti-RTOS I asked if you have an example that either uses freertos or no rtos.
Regards
David
scif_how_to_use.html is not OS dependent.
When setting up a new project, select:
DPL and OSAL is covered in the Sensor Controller help.
Hi
I have now setup the project here is the code on SCS samples every 100ms ADC all tested and working with SCS
// Select ADC input
//adcSelectGpioInput(AUXIO_A_SENSOR_OUTPUT);
// Enable the ADC
adcEnableSync(ADC_REF_FIXED, ADC_SAMPLE_TIME_2P7_US, ADC_TRIGGER_AUX_TIMER0);
// Start ADC trigger timer at 20 kHz (50 us)
timer0Start(TIMER0_MODE_PERIODICAL, 20000, 0);
for(U16 n = 0; n < CHANNEL_COUNT; n++){
// Select ADC input
adcSelectGpioInput(cfg.pAuxioASensorOutput[n]);
// Wait for the next ADC sample and store it
adcReadFifo(output.pSamples[n]);
}
// Stop the ADC trigger and flush the ADC FIFO
timer0Stop();
adcFlushFifo();
// Disable the ADC
adcDisable();
// Signalize that the task has been completed
fwGenAlertInterrupt();
here is the outline of the code in CCS
#include "scif.h"
// SCIF driver callback: Task control interface ready (non-blocking task control operation completed)
void scCtrlReadyCallback(void) {
}
// SCIF driver callback: Sensor Controller task code has generated an alert interrupt
void scTaskAlertCallback(void)
{
scifClearAlertIntSource();
GPIO_toggle(GPIO_LED_0);
scifAckAlertEvents();
int main(void)
{
// Initialize the SCIF operating system abstraction layer
scifOsalInit();
// Initialize the SCIF operating system abstraction layer
scifOsalRegisterCtrlReadyCallback(scCtrlReadyCallback);
scifOsalRegisterTaskAlertCallback(scTaskAlertCallback);
// Initialize the SCIF driver
scifInit(&scifDriverSetup);
// Start the "ADC Sampler" Sensor Controller task
scifStartTasksNbl(1 << SCIF_ADC_SAMPLER_TASK_ID);
}
all compiles without error, but the scTaskAlertCallback routine never gets called can you please assist
Regards
David
Please select insert->code and 'c' when you post code since it's difficult to read code that is not formatted.
I assume that the Sensor Controller code works as intended when you are using the task testing within SmartRF Studio?
Yes the sensor code does work as intended with Smart Controller Sensor (not SmartRF Studio)?
// Select ADC input
//adcSelectGpioInput(AUXIO_A_SENSOR_OUTPUT);
// Enable the ADC
adcEnableSync(ADC_REF_FIXED, ADC_SAMPLE_TIME_2P7_US, ADC_TRIGGER_AUX_TIMER0);
// Start ADC trigger timer at 20 kHz (50 us)
timer0Start(TIMER0_MODE_PERIODICAL, 20000, 0);
for(U16 n = 0; n < CHANNEL_COUNT; n++){
// Select ADC input
adcSelectGpioInput(cfg.pAuxioASensorOutput[n]);
// Wait for the next ADC sample and store it
adcReadFifo(output.pSamples[n]);
}
// Stop the ADC trigger and flush the ADC FIFO
timer0Stop();
adcFlushFifo();
// Disable the ADC
adcDisable();
// Signalize that the task has been completed
fwGenAlertInterrupt();
Here is an outline of the relevant code from CCS
#include "scif.h"
// SCIF driver callback: Task control interface ready (non-blocking task control operation completed)
void scCtrlReadyCallback(void) {
}
// SCIF driver callback: Sensor Controller task code has generated an alert interrupt
void scTaskAlertCallback(void)
{
scifClearAlertIntSource();
GPIO_toggle(GPIO_LED_0);
scifAckAlertEvents();
int main(void)
{
// Initialize the SCIF operating system abstraction layer
scifOsalInit();
// Initialize the SCIF operating system abstraction layer
scifOsalRegisterCtrlReadyCallback(scCtrlReadyCallback);
scifOsalRegisterTaskAlertCallback(scTaskAlertCallback);
// Initialize the SCIF driver
scifInit(&scifDriverSetup);
// Start the "ADC Sampler" Sensor Controller task
scifStartTasksNbl(1 << SCIF_ADC_SAMPLER_TASK_ID);
}
Could you post the scif_how_to_use.html for your SCE project (or are you able to post the complete project)?
Do you have any initialization code or one execution code?
Is it noRTOS you are trying to use?
Question: In your question you ask about both freeRTOS and noRTOS. You have worked in this project for awhile, haven't you decided?
Question: Are you exploring different ways to use the ADC since you are asking both about SCE and CCS usage (your multichannel question)? Is the overall goal to sample 2 or 3 channels with a defined frequency?
HI Ter
Attached both the CCS and SCS files, I have no initialization code also we are using no RTOS. In my final project we will use FreeRTOS.
In answer to your question we are exploring your CC13xx parts to use new product, I have been tasked with the ADC, I have now managed to get the ADC working in the main core, but we are interested in it working in the SCS, hence all the work on the ADC.
Regards
David
The files seems to be missing. From the code you have posted before I don't fully understand how you intend the code to work.
Please make a flow graph showing the intended flow and explain which part(s) in the code that does each stage in the flow graph.
Ter
Can you tell me how I insert files as I go into the insert/image/video/file and it will not accept my files
Have you tried drag and drop?
Please make a flow graph showing the intended flow and explain which part(s) in the code that does each stage in the flow graph.
Of course I have tried to drag and drop, Before going any further we need to sort out why I cant sent files, I have tried 3 different browsers, I tried to send you a video of me putting files in your drag and drop window but when I dropped it in your drag and drop window it just played on the browser. we really need to find a solution.