C bit field structures for microcontroller multitasking

So you’re getting better at programming microcontrollers and now you want to do several things at once? You know better than that, microcontrollers are only capable of processing one thing at a time. But if you’re clever with your coding you can achieve something that behaves as if several things are going on at once. The most common way to do this is to set a flag using an interrupt, then use the main loop to check for that flag. [S1axter] posted a tutorial on this topic where he uses bit field structures to help simplify time sensitive events.

We think [S1axter] did a fantastic job of explaining this moderately difficult topic clearly and quickly. In the video after the break he begins by explaining what a bit field is and how it is defined. Basically you’re using a C structure to track a flag using just one bit of storage. This way the flag is either set or not. We suggest you pay careful attention to how he declares the structures as volatile, so you don’t have unexpected behavior when you try it yourself.

[Read more...]

On the life of [Dennis Ritchie]

Chances are you have already heard of the passing of [Dennis Ritchie]. We admit, we’re among the throngs who knew little of his life, but [Cade Metz] has posted an excellent remembrance of his life which we think is well worth reading.

[Dennis] passed on October 12th at the age of 70. This image shows him receiving the National Medal of Technology awarded to him by [Bill Clinton] in 1998. His legacy lives on in the work that earned him this award as the creator of the C programming language; a side project which he developed to help him achieve the creation of a new system kernel called UNIX. This work, of course, was the precursor that led to universal software packages like OSX, iOS, Linux, and even Windows (which at one point was itself written using the C language).

There has been some Internet fodder regarding media coverage of [Steve Jobs'] death and not of [Dennis'] passing. It’s harder for those lacking experience with programming to comprehend [Dennis'] contributions. We’re glad to have an opportunity to pass on the story of his life and to take a moment to appreciate his accomplishments.

[Thanks Dave]

[Photo Source]

BASIC programming on an Arduino

[Mike] sent in a project he’s been working on – a port of a BASIC interpreter that fits on an Arduino. The code is meant to be a faithful port of Tiny BASIC for the 68000, and true to Tiny BASIC form, it fits in the very limited RAM of the Arduino.

True to Tiny BASIC’s assembler roots, [Mike]‘s C port makes extensive use of the “infinitely-abusable” goto statement. Kernighan and Ritchie said themselves, “code involving a goto can alway be written without one” but [Mike] found that using goto left a lot more room available for BASIC code. The BASIC interpreter eats up around 600 bytes in the Arduino RAM, leaving about 1.4 kB for BASIC code. Not much, but more than the lowest-end BASIC Stamp.

[Mike] says he started this project to see how ‘old bearded ones’ conjured up so many impressive programs with a few kB of RAM. Tiny BASIC was originally conceived for the Altair 8800 that shipped with 256 bytes of RAM stock, so it seemed like a perfect fit. Right now, all we know is we’ll be spending the weekend digging through our copies of Dr. Dobb’s Journal.

Microsoft’s attempt at an Arduino killer — feels like a gimmick

Microsoft has thrown its hat into the open source hardware hobby market. Their offering is called the Gadgeteer. We’d love to tell you all about it, but the big M didn’t make it very easy to find out about the device and it’s addons. When we set out to find what processor is running on the board we were happy to see that they do call it an Open Source Hardware project, but no schematic is posted. When we did finally navigate to the hardware documentation it’s a file that must be downloaded and you’ve got to agree to their licensing before grabbing it. So that’s as far as we went, and now we’ll go back to using more open tools.

For those of you who aren’t scared off by the lack of openness, the first thing you’ll notice about this board is that it’s full of connector headers. Instead of the small rows that Arduino uses, the Gadgeteer is meant to use ribbon cables to connect to various breakout boards. You can program for the platform in C# using the .NET framework. This means using Microsoft Visual Studio for those that are already acquainted with the platform. But regular readers will note that we’re always looking for Linux support in our IDEs and you won’t find that here.

[Thanks Hrasdt (and several others) via Slashdot]

Over-engineered clock finds purpose as RSS reader

[Bob Alexander] admits that he over-engineered his clock, giving it eight control buttons, eight twelve-segment alpha-numeric display digits, a GPS module as a time source, and a beefy microcontroller to boot. But he’s found a way to get more for his money out of the device by adding RSS and weather features to it.

Since he’s using the PIC 18F4550 it’s a snap to add USB connectivity. From there he wrote a fantastic PC-side application for communicating with the display. Now he has the option of displaying time, RSS feeds, or weather by scrolling through the options with one of the buttons. Perhaps the best feature is the option to launch a browser on the PC and view the current story just by pressing a button on the display. Check out the two demos after the break; one shows the clock features and the other demonstrates the C# software.

[Read more...]

Kindle terminal with secret key-press activation

[Luigi Rizzo] has been working on some hacks for his 3rd generation Kindle. There is already a Python based terminal emulator called AjaxTerm but he wanted a lightweight standalone so he reimplemented the program in C. The 100k binary monitors the keyboard, launching the terminal emulator when it detects a Shift-T sequence. It also uses alternative key mapping to fill in for some of the keys the Kindle’s keyboard is missing.

We haven’t seen a whole lot of Kindle hacking since it was hacked to run Ubuntu. Seems like this terminal emulator is a useful and unobtrusive hack to try out on the beloved reader.

Rendering a 3D environment from Kinect video

[Oliver Kreylos] is using an Xbox Kinect to render 3D environments from real-time video. In other words, he takes the video feed from the Kinect and runs it through some C++ software he wrote to index the pixels in a 3D space that can be manipulated as it plays back. The image above is the result of the Kinect recording video by looking at [Oliver] from his right side. He’s moved the viewer’s playback perspective to be above and in front of him. Part of his body is missing and there is a black shadow because the camera cannot see these areas from its perspective. This is very similar to the real-time 3D scanning we’ve seen in the past, but the hardware and software combination make this a snap to reproduce. Get the source code from his page linked at the top and don’t miss his demo video after the break.

[Read more...]

Follow

Get every new post delivered to your Inbox.

Join 92,317 other followers