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.

sys/bios blink LED example

I want to blink LED in the experimenter's board of C28343 using sys/bios. I came across the "task example" under C28 under sys bios. The comments in the "task.c" file says

2) blinks an LED and increments a counter within
 *         a timer interrupt.

But it does not do anything in the hardware and I do not see any code for it.

  • Sunil,

    The comment about blinking an LED is incorrect.  I filed a defect report (SDOCM00077020) to get this comment removed from the file.

    Regards,
    Scott

  • Scott,

    Thank you for making the note. However my search for the example continues as I struggle to find out how to ineract with any of the peripherals of the processor in the sys/bios enviornment.

    It is strange that TI has plathora of examples for non bios in dealing with all the peripherals and not a single example in sys/bios environment.

  • Sunil,

    You’re right, the examples we provide with SYS/BIOS do not show much use of peripherals.  They are focused on demonstrating basic OS features. 

    For some “high end” device families TI does provide add-on driver stacks for complex peripherals. But for “lean resource” targets like MCUs, I think most customers will not want the added footprint and cycle overhead of device driver abstraction, even if it is small. I think they typically will look at the non-SYS/BIOS examples you mention, and then scavenge appropriate code from those, and integrate that code into their application.  For simple peripheral I/O there may be no difference from the non-SYS/BIOS case.  For more complex peripherals they may use some SYS/BIOS APIs where necessary to protect from preemption, or to post a SYS/BIOS thread from an ISR for deferred execution, etc.

    For something as simple as flashing an LED… I think that there would not be much to see.  I expect there would be a register write (maybe in main()) to initialize a GPIO bit direction, and then simple register writes elsewhere to turn the LED on/off when appropriate.  For device families (like MSP430) where some of the SYS/BIOS examples flash an LED this is only for visual feedback, and not for purposes of demonstrating peripheral control.

    All that said...  I don’t know if this is helping.  Maybe there are some additional C28x examples (besides what is shipped with SYS/BIOS) that are good examples of peripheral management that someone else may know of and can point you to for reference?...

    Regards,
    Scott

  • Hi Sunil,

    I know it has been a long time since you asked your question. And I am not familiar with coding in SYS/BIOS specifically. However, from my experience in embedded systems I think that you need to look at the users manual for the specific IC you are using to run SYS/BIOS and find out what registers you need to use to do IO. Usually, the OS at this level of complexity cannot help you with device-specific features.  Even if they gave you an example, it might not work because your hardware might work in a different way.  I say, consult the manual for your CPU and find out how to access the device's hardware. Also make sure the external connections are correctly configured, you may need to connect pins to LEDs or something.

     

    Another Scott,