Jump to content

NicholasLindan

Members
  • Content count

    6
  • Joined

  • Last visited

About NicholasLindan

  • Rank
    Noob Class

Profile Information

  • Location
    Cleveland, Ohio USA
  1. CoRTOS: An open source minimalist RTOS

    I make no claim to Energia mavenship. I was under the impression that the user's code was interpreted - it seems that is not the case.
  2. CoRTOS: An open source minimalist RTOS

    Well, it's a really small container of ice cream, almost the size of the free sample spoonful you might get with other RTOS's. Dive in and think "Peach." For those who don't want to do the download, here is the kernel: #include "common_defs.h" #include "CoRTOSkernel.h" #include "CoRTOStask.h" uint8_t current_task; static uint16_t sp_save [number_of_tasks]; static uint16_t starting_stack [number_of_tasks]; static boolean start_from_beginning [number_of_tasks]; static boolean suspended [number_of_tasks]; void relinquish (void) { asm volatile ("NOP":::"r2","r3","r4","r5","r6","r7","r8","r9","r10",\ "r11","r12","r13","r14","r15","r16","r17"); sp_save[current_task] = _SP; while (true) { do { if (++current_task == number_of_tasks) current_task = 0; } while (suspended[current_task] == true); if (start_from_beginning[current_task] == true) { start_from_beginning[current_task] = false; _SP = starting_stack[current_task]; start_addresses[current_task] (); suspended[current_task] = true; start_from_beginning[current_task] = true; } else { _SP = sp_save[current_task]; return; } } } void suspend (void) { suspended[current_task] = true; } void resume_task (uint8_t tn) { suspended[tn] = false; } void start_CoRTOS (void) { uint8_t tn; uint16_t spv; spv = _SP; for (tn = 0; tn < number_of_tasks; tn++) { starting_stack[tn] = spv; spv -= task_stack_size[tn]; start_from_beginning[tn] = true; suspended[tn] = false; } start_from_beginning[0] = false; current_task = 0; start_addresses[0] (); } The OS proper is the function relinquish() - about 15 lines of executable code.
  3. CoRTOS: An open source minimalist RTOS

    Rick - thanks very much for the review and bug catch. I have attached a V1d01 zip file with updates. There are two "Blinky" demonstration projects. I don't know if you made one or (as it seems) both. CoRTOSblinkyxxx.c is a one-file project that is specific to a processor. CoRTOSsuperblinky.c is a more elaborate demonstration that links into CoRTOS modules and is processor independent. In both cases, though, the processor is specified in CoRTOSuP.h. Yes, it isn't universal to the all the MSP430 variants. This isn't my day job, so some of the work will just have to be done by the users. On the errors you had with compilation: #20 identifier "t" is undefined (line 202); identifier "tn" is undefined (line 208) CoRTOSblinkyMSP.c CoRTOSblinkyMSP.c was --- well, damned if I know what happened. A corrected version is attached - the corrected version now mirrors the example in the manual. #150 variable "task_stack_size" has already been initialized CoRTOStask.c /cortos line 33 The file "CoRTOStask.c" is a placeholder to use when making your own system. Just eliminate it from the directory when making the CoRTOSsuperblinky demonstration project. The various CoRTOSblinkyxxx.c files should also be removed from the directory if you are making superblinky or you will end up with two main()'s. CoRTOSblinkyMSP.c file is only used with the blinky example/tutorial in the manual, it only needs the CoRTOSuP.h and CoRTOScomdefs.h files. I have added some notes on this to the manual. #1965 cannot open source file "msp430FR6989.h" CoRTOSkernel.c /cortos line 18 This hasn't been flagged on my system, but my system is Windows rather than a Linux variant. Indeed, the file name is msp430fr..., the caps are likely due to copying the part# from the TI box/literature. It has been changed to all lower case in the source code. I have a recollection that using <msp430.h> gave some problems, this may be from some time ago and has since been resolved. A lot of people don't like the file naming convention. I use it because, after so many years, I have an almost infinite number like function/name files. Please feel free to strip off the CoRTOS prefix and also to edit out the processor specific code that isn't for your processor. Again, thanks for your help. CoRTOSV1d01.zip
  4. CoRTOS: An open source minimalist RTOS

    CoRTOS is, possibly, the world's simplest RTOS. After 35 years of writing RTOS systems I had the thought: "How simple can you make it?" It is a naked system meant for use in product, teaching and maker applications. The CoRTOS kernel compiles to ~200 bytes of code. You add features as needed: delays, mutexes, signaling, messaging - each feature adding, again, about 200 bytes. The development environment is CCS and GCC or the equivalent. It has been adopted in teaching environments as It is easy to trace through the code to see what is going on behind the scenes. It is well documented with a 30 page manual and extensive source code comments - every attempt has been made to make it as straightforward as possible. My understanding of Energia is that it is an Arduino-like environment using TI-RTOS and runs on Launch-Pad boards. Code is interpreted rather than compiled. There really isn't a comparison - a bit like comparing a crate engine to an automobile. But if you only need an engine...
  5. Raw ECG Signal Processing with MSP430

    I'd start with a literature search. Just Googling "DSP ECG" throws up some relevant articles, starting with: https://www.intechopen.com/books/applications-of-digital-signal-processing/a-dsp-practical-application-working-on-ecg-signal (I always start with a literature search.) Following the citations in the above article brings up standard arrhythmia data sets at http://physionet.org/physiobank/database/mitdb/ You don't mention your application - medical (POC, personal arrhythmia alarm), excercise, JFA...I agree that your measurement data looks very suspect - there's lots of ECG traces on the 'net. There are also youtube videos, arduino sketches, RPi code for this application ... google "AD8232" I'd start with matlab & co. to develop the filtering algorithm (though you may find a perfectly good one with a web search). Only after you have it working on a PC would I worry about MSP code.
  6. CoRTOS: An open source minimalist RTOS

    CoRTOS is a Cooperative Real Time Operating System for bare-metal applications. Its advantages over other systems are that it is fully documented with a manual and examples, is easy to understand and use and is astonishingly simple: The kernel is just 16 lines of C. The CoRTOS module compiles to ~200 bytes of code. The system includes optional modules implementing delays, timers, messaging, mutexes and signaling. It is intended for smaller microprocessors, such as the MSP430, Cortex M0+, AVR and PIC24, and for smaller systems of maybe a dozen tasks. CoRTOS is not a task scheduler. CoRTOS works like any other RTOS. Tasks schedule themselves, picking up where they left off after making a call to the OS. Please feel free to send questions to nolindan@ix.netcom.com The intended audience includes: • Those needing a small footprint RTOS; • Students learning about real time systems; • Makers wanting to program "close to the metal" Features World's simplest RTOS CoRTOSV1d.zip
×