Saturday, January 06, 2007

Starting out with RTX

The one thing I did do before I took my creative break was start getting to grips with the RTX real-time kernel that is supplied royalty-free as part of the RealView Microcontroller Development Kit. From what I can see, it has pretty much all of the standard resources and features you would expect to find in a modern day real-time kernel. I started out playing with some of the examples and then quite unlike my normal hackish behavior, I started to write an RTX-based application from scratch.

My simple 4-task application built just fine, but when I ran it I discovered that it sat in the SWI handler forever. I took the source of one of the RTX examples and pasted that into my project, and found that that, too, got stuck in the SWI handler. "Curiouser and curiouser," I thought. I now had exactly the same configuration and the example code in my project and yet it didn't work. Conclusion: Something was not the same. So I "diffed" every file in the example directory against every file in my applications directory and there in the example startup code were the following lines...

; IMPORT SWI_Handler

Undef_Handler B Undef_Handler
;SWI_Handler B SWI_Handler ; Handled by RTL

My application did not comment out the SWI handler code. I checked the documentation and the Knowledge Base and could find nothing on this requirement. I finally decided to check in with Reinhard Keil and found that this was indeed a weakness in the documentation. Reinhard quickly put together a Knowledge Base article here that explains what to do.

Now my example works just fine, so it's on to the next phase of the project.

Friday, January 05, 2007

Hacky New Year

I took a bit of a creative break over the holidays in order to regroup, look at this project with a fresh pairs of eyes and think about the spec. I didn't stop completely; my mind was working away quietly in the background worrying about the one-button interface and whether one button was one going make it simple or make it unusable. I guess it depends on if you are a Mac or a PC kind of guy.

The idea of "Press button to start logging" and "Press button to stop logging" seemed simple enough, but upon consideration this makes it too easy for kids to mess up. It would be pretty easy to accidentally press the button when taking the LogStick to and from the field and start/stop it logging. I could go for double clicking but that seemed less intuitive and kids don't always double click the way adults do. So I came up with the idea of the length of time you press the button being significant. A long press could start logging and a short press could pause rather than halt logging. A long press can't be accidental and a short press will only pause logging rather than starting all over again.

Santa was good to me and I got a great book in my stocking.

This has some very interesting projects that I think would easily become LogStick applications.