Posted by: Claudio Carbone | 3 October 2011

A little (huge) detour

Some random news.

  1. Microchip has opened up a new site: Embedded Code Source

    A site that inherits the best of intentions: aggregate all interesting free source code for any particular task you can put a Microcontroller at.
    The press release cites third party companies currently working with Microchip as possible contributors, but as of now the only giver is Microchip itself. Albeit with a decent number of examples. Currently it’s limited almost only to Pic24 and dsPic, with rare occurrences of Pic18. Let’s give ’em time and see what they come up with.
    Site link

  2. I’ve started working with: FreeRTOS

    And what is it? RTOS stands for Real Time Operating System, which is an OS designed to adhere to strict time constraints. Contrary to modern OSes (all of them, including every Windows and every Unix derivative) that live to simplify the life of the user, helping him with user interfaces and time-limited tasks, RTOS where born for the control industry, in which timings are of paramount importance. Abused examples are plants security control systems (imagine the temperature of the core of a nuclear plant): you have to react to incoming data in a certain time, data itself must be sampled at defined times and rates. You can’t delay a temperature sampling because the processor is occupied serving a webpage.
    In this peculiar scenarios the RTOS has flourished arriving today to the point that free complete RTOSes are available, like the aforementioned FreeRTOS.

    Thanks to Joao Melo and his blog (available here) I was able to have a simple implementation running in no time at all.
    It’s thrilling to create tasks, delay them, suspend them, resume them, have the scheduler preempt them, all in real time in a teeny-tiny fingernail sized package.
    It’s almost as if a complete cpu from years ago has shrunk to a centimeter in size, maintainig all its processing power, but losing all the heat dissipation. It’s amazing!

    So now I’m at the point that I have the scheduler working nicely, simple-stupid task (think the “blink the led” type) are interrupted and resumed at the touch of a button (also the button is sampled by another concurrent task). And since the console output of the debugger is routed through the Microchip IDE, it’s painfully slow. So I had the brilliant idea of trying to port the Microchip’s USB Stack to FreeRTOS.
    Since I was sorely missing a decent UART link, I started with the CDC mode (in this mode the USB device is seen as an emulated serial terminal, you connect to it via any HyperTerminal) and after some days of hard work I can say it works.
    I have gone up to 60 Kcps which is equivalent to 60KB/s. Which is not bad considering it’s an hack of mine!
    I’ll see what I can do with other USB modes (Mass storage is next on the list).

    Right now I’m really satisfied with this free OS, it’s really powerfull and yet simple.
    Give it a try if you have one of the supported platforms.

  3. I finally found the code for this wonderfull demo: Multiple Stacks on a single MCU

    I’ve been amazed by this demo since I saw it, and I’ve been hunting the code everywhere. Finally I found it in a largely forgotten site (why did they abandon it?):
    Unfortunately it does not compile for some ASM error I can’t understand. But having the RTOS code and all the Microchip stacks already in Threaded form is something I wouldn’t have ever hoped, so… I’ll use it to get the stacks to work in the RTOS and see what I can do with them.

I’ll have some more updates  in the coming days.

Embedded FTW!



  1. Thanks for the reference to my simple freeRTOS work.


    João Melo

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s


%d bloggers like this: