Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


NicholasLindan last won the day on May 22 2018

NicholasLindan had the most liked content!

About NicholasLindan

  • Rank

Profile Information

  • Location
    Cleveland, Ohio USA

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. CoRTOS V 1.10 is now available on Sourceforge at: https://sourceforge.net/projects/cortos-simple/ V 1.10 adds general purpose counting/binary/signaling semaphores. It also fixes a bug in the context save/restore for the AVR processor. Documentation has had some minor improvements. If you are using an older version you should incorporate the update. The change from the old resources to the newer semaphores should be painless.
  2. I've done this on products - powered an analog section off an I/O pin. It is the cheapest power control method - heck it's free and it takes no power to implement. If you need more current you can parallel two or more pins. There is no problem with parallel MOSFETs, they will current share as rdson increases with temperature.
  3. Announcing the release PRTOS, an open-source preemptive real time operating system kernel for bare-metal applications. You may find PRTOS a good choice if you want to learn about preemptive multitasking. The API, though having all the features of FreeRTOS or uC/OS, is much simpler and easier to learn. Additionally the system will fit into much smaller processors. PRTOS is released by Cleveland Engineering Design - the developer of the CoRTOS cooperative real time OS, also available on Sourceforge. PRTOS presently supports the MSP430 and AVR architectures. PRTOS is available on Sourceforge at https://sourceforge.net/projects/prtos-preemptive-rtos/ The advantages of PRTOS are: It has the smallest footprint of any true preemptive system: 1.3kB for basic scheduling and task control, 4.8kB with all the features below (MSP430 / size optimization); Only 950 lines of code implement all of the RTOS features (SLOC-L); The system is configurable, you include only the features you need; There is minimal to zero interrupt burden; The system is well documented with a short but comprehensive manual, well-commented source code, and a test suite demonstrating the features; The system is proven - it has been in use since 1982 with applications in in-vitro medical equipment, process control instrumentation and industrial machinery; It is released under a GPL V3 license and commercial licensing is available. PRTOS provides the following features: Scheduling Preemptive Prioritized Round-robin equal priority tasks Task Control Initialize/Ready Suspend/Resume Lock/Unlock Change priority Relinquish a round-robin turn Communication Messages, priority messages Signals Delay & Time Task delays Time-outs Periodic signals Run timers Resources (mutexes) Multiple resource ownership Priority inversion mitigation Priority or FIFO queuing Semaphores Binary Counting Signaling ISR -> task functions Send signal Send message, send priority message Resume task
  4. You wrote: "I would much prefer that you ..." That's not how it works. The world, and I, don't dance to your preferences.
  5. You uploaded the wrong version - it should be V1d01 - you can find it a few posts up. Don't you feel putting it on GitHub under your name and account is a bit presumptuous?
  6. The code is on Sourceforge https://sourceforge.net/projects/cortos-simple/ As far as being a "good first start" - well, I've been doing this for an awfully long time, as the picture of the old fart on the left should attest. Started with the 8008 in 1974... It's more of a "last start." If someone is doing something serious with the code I would be more than happy to help with support.
  7. Rick: I know that every time I grab code I edit it so it conforms to my needs, prejudices and sensibilities -- that makes the code mine, in a sense, and less foreign - and as I make the changes I get to mutter under my breath about the original author: "Bloody fool, what does he think he is doing." I expect any one using CoRTOS will want to and have to change it in some way and utter their own mutterings. So please, make changes to your heart's content with the source. In any work, everyone finds something to disagree on. What some find terminally annoying others find full of virtue. I can't please everyone and I'm not going try. That path is the surest way to please no one. The Shakers would put a purposeful gouge in their furniture lest their attempt at perfection offend God. I leave plenty of gouges in my work. As the manual states: "Worth price charged." Nicholas
  8. 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.
  9. 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.
  10. 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
  11. 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...
  12. 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.
  13. 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
  • Create New...