h1

Freescale Technology Forum 2010!!!

June 15, 2010

This is going to be a short post because I’m currently putting the finishing touches on my hands-on training session on motor control.

I’ll be presenting this session at FTF 2010 in Florida on Thursday, June 22nd (in a week!) I’m really excited about this, FTF is one of the coolest events on the Embedded Systems world and I get to go and share a bit (get it?) of my knowledge. I’ll also be co-presenting on a touch sensing technology session, so those of you who’ll be at FTF and like spinning metal things or who can’t keep their hands at easy, should attend my trainings. I’ll be the really cool engineer amidst a bunch of nerds ;)

So if you’re going to FTF, let’s meet, I guess you should look for me by my real name: Eduardo Viramontes. If you’re not going, we’ll happily be streaming a bunch of content and then also have recorded trainings for you at http://www.freescale.com/ftf

See you there!

h1

Some funny stuff engineers say…

May 26, 2010

Embedded systems engineers are usually creative people, we need creativity to keep innovation flowing and to solve problems in optimal ways. We also use creativity to cope with stress. Over the years I’ve heard some funny things come out of the mouths of over stressed engineers, causing generic group laughs that release tension in the room, at least for a little while. Causing it’s been a stressing day for me, I’ll share some of the funny things I’ve heard over the years:

  • “No problem, if one fails, both will fail”. A desperate engineer assuring that at least he’s sure his bugs are repeatable.
  • “A tester has to do what a tester has to do”. Some zen knowledge about software testing, I told this to a guy complaining that tests where too stressing on his code.
  • “Users are always wrong”. I don’t endorse this point of view, but you would be right if you guessed that this phrase came as a reply to a phone call reporting a customer had found a bug.
  • “Real programmers don’t comment their code. It was hard to write, it should be hard to understand.” The guy that said this actually does document his code pretty well.
  • “Use a timer to turn on the RTC”. We where looking for a way to turn on the system in a specific timing and someone suggested a timer from the controller (which was off) should be used to turn on the RTC which would later turn on the MCU, luckily we discarded the idea and went to sleep.
  • “That’s bad for the hard drive”. Said a guy to another who was desperately pounding his computer out of frustration.
  • “Stop thinking and program”. Someone said this to me, I tend to overthink my code before writing it.
  • “Software is always right”. I wish this were true.
  • “It’s not a bug, it’s a design error”. Design bugs do exist, this guy just didn’t believe in them.

There you have it, hope you had fun, I did remembering all those incidents. Is your office as funny as mine?

If you doubt the power of laughter to cure stress and maybe even other things, read this article:

http://stress.about.com/od/stresshealth/a/laughter.htm

h1

Building a freak guitar (of embedded systems and the arts)

May 18, 2010

For some months now I’ve been planning on doing a bunch of stuff to one of my guitars. A couple of years ago I bought a very old (built in 1977) guitar. The guitar was heavily modified (which meant the “original” value was not very high) and had a funny little sound. But I fell in love with it kind of how some embedded folk are in love with the 8051 CPU even being such an old CPU. It has this beautiful wood colors and the neck is amazingly easy to play. Those of you who play guitar should understand, those of you who don’t, imagine the best compiler that could ever exist…and it’s incredibly well documented as well – nay! Imagine the documentation is so good that you only have to think about what you want, and the document will pop up in your computer screen, in the exact page and paragraph you need to read…that’s how much I love this guitar. There’s also the fact that it’s old and uncommon, kind of like bragging that you can program in COBOL.

Yesterday I decided to start this project. I had bought some things in advance and was now basically ready to start soldering.

1977 Ibanez Musician in the process of being rebuilt

1977 Ibanez Musician in the process of being rebuilt

Sorry for the bad picture quality, I’m a engineer/guitarist, not a photographer. This picture was taken when I had removed mos of the internal electronics and was fitting the new pickups (or pups as we guitarists call them). Pickups are the magnetized coils used in electric guitars to sense the string vibration (just a cultural note). The old pickups on this guitar were particularly bad, I don’t know if it’s the kind of sound they liked in the seventies, or if they were too old, probably the input impedance in old amplifiers was different as today’s amplifiers (because of valve technology vs semiconductor technology), I don’t really know. The important thing here is that the original sound sucked to my ears (and that, of course, is subjective) so I wanted to change the pickups. Sorry to disappoint those of you extreme home-project builders: I didn’t wind my own pickups, I want this guitar to sound awesome, so I bought some pickups that I know will sound awesome. Now I’m looking into the right combination of potentiometers and filtering capacitors to get everything sounding as cool as it sounds in my head.

But I noticed something: there’s some extra room inside of my guitar back panel. The guitar used to have a bunch of switches to configure the pickups in all sorts of ways, I won’t be using all of the switches as the original configuration because I find some of the attainable sounds a bit redundant so now I’ll end up with some extra holes that will not look so nice. But then I got thinking about this effects pedal that I own that is some sort of audio signal processing development platform created by Freescale Semiconductor and Line6 (a guitar effects and accessories company which specializes in guitar amplifier and effect digital modeling). This little pedal (called the Tone Core) I own has an integrated USB bootloader with which you can load DSP code to the on board Freescale audio processor. The USB bootloader is controlled by an 8-bit USB MCU also from Freescale. The Audio DSP platform is a free Eclipse-based compiler and Line6 provides some example code to build an equilizer or a tremolo (volume swirl) effect. Based on those codes you can start writing your own effects from scratch. There is even an independent Tone Core wiki where people can post their effect code, and some videos on YouTube of people playing with the effects they’ve made.

So now I’m thinking that if I remove the metal chassis and just find a way to stick the effect pedal electronics into the guitar electronics chamber and use the extra holes that are already there to put the effect pots there, I might get to have some sort of freak reprogramable guitar…and I’m a fan of freak embedded stuff! Before you start telling me not to do the freak thing, consider this: Gibson, one of the most important guitar companies out there, has it’s own flavor of freak guitar, the Dusk Tiger. It’s not only a freak guitar, in my opinion, it’s one of the coolest embedded systems out there. Just a little bit of the specs:

- Robot guitar: this is what Gibson is calling their automatic string tuning system. It’s crazy, each tuner has a tiny stepper motor, and at the other end of the string there’s a piezo-electric sensor. You play all the strings at the same time and a processor inside the guitar determines the tuning on each string and adjusts the littler stepper motors accordingly. The guitar can be completely out of tune and re-tuned in seconds.

- Digital EQ with presets: a little knob allows you to choose from a bunch of EQ presets to output different sounds.

- Configurable: if the previous characteristics weren’t enough, you can plug the guitar into a computer and, via custom software, load new settings to the guitar, different equalizer settings or tunings.

Please visit the link to the Dusk Tiger, it’s such a weird and amazing guitar full of embedded systems wonder: motor control, digital signal processing, LEDs, connectivity, all sorts of fun!

So after writing this article I still haven’t decided if I’ll turn my guitar into a freak…any opinions?

h1

I (heart) cores

April 28, 2010

The embedded systems conference is going wild this week and I’m not there, I do hope to get there some day, but meanwhile I can’t help thinking about the number of CPU cores that an attendee is exposed to in this event. There are omnipresent cores like the everpowerful ARM, so many MCU/MPU providers have a flavor of it, I dare say it’s like the 8051 of our times. Then there are, of course, the very specific cores of which only a specific company has full ownership, and everything in between like the Power Architecture core, not as omnipresent as ARM, but still favored by many silicon vendors . Oh! And the 8051 is still amazingly around.

I love the fact that there are so many cores around, I believe this is a reflection on our humanity, on our ability to create. If the world were eventually dominated by computers, I bet the world would eventually only have one core (to rule them all, pun intended), it would be gray and boring. Lucklily the chaos that ensues having so many cores is probably avoiding computers of becoming interested in dominating us…maybe we are already dominated by them, I’m not sure (pun intended?).

Anyway, cores are cool. Apart from the inminent information overflow from trying to understand each of their architectures I think it’s important for the industry to keep investing in many options instead of settling for one single core (single core, multicore…well, you get it). I just hope I get to work with as many of them as I can get my hands on…what’s the count now? 11 cores, I’ve worked with 11 cores in my lifetime so far…how about you?

h1

Infections

March 28, 2010

So I was out some weeks…I had a funny little infection caused by a mosquito bite (not byte) that’s recently popular here in Guadalajara, Mexico. It’s supposed to stay in tropical weather, but for some reason it decided to come to the city, it also decided to get me.

I had to just rest (and work from home, though I mainly slept through it all) for a couple of weeks and it got me thinking about infections in the work place. I don’t mean catching a flu from the coworker next to you but catching a bad programming habit from the repository closest to you.

Bad programming is in inevitably the software industry and it won’t leave I see two reasons for this:

  1. Maturity of the industry: software as a whole is a relatively new discipline, we haven’t even done it for 100 years. We have been doctors, chemists or civil engineers for thousands of years, but not programmers. Not enough mistakes have been made (mistakes are the best way to learn), not enough experience has been developed, so processes are not in the mind-set of all the software developing community. Civil engineers know exactly what to do to get a bridge to stand, and even after thousands of years of building bridges, mistakes are still made (those of us who are electronic engineers heard the story of the Tacoma Narrows bridge in college as a means of teaching us the effects of resonance in circuits).
  2. Bad programmers: everything else, falls under this category. It can be laziness or lack of knowledge, but there are bad programmers out there same as there are bad civil engineers out there.

Both of these conditions are severely infectious. The lack of maturity of the industry leads to development houses that don’t do what it takes to put out good products. This infection not only has an effect on the company, but also on individuals: engineers (particularly freshouts) will learns these bad practices and take them to other companies. Sad thing about it is that they probably don’t know any better, just because I can do infinite loops that wait for conditions to happen or I can put functions wherever I want, doesn’t mean I should. Code should be well structured, well designed, well thought of; you wouldn’t let someone build your house if you don’t see the blueprints first, that should be the same in software. But they don’t know any better, our colleges are evolving and adapting, and I do hope these infections are eventually done for. I have surely seen I change in my school. When I studied there, I had no software engineering training, it is arguable that I studied electronics engineering and not computer science, but I wouldn’t agree with that position, anybody who gets to program should get trained in best practices, and they should have passionate teachers who understand and will teach this as best as they can. In recent years I’ve had the chance to work with current students from my school, as well as interns in my office and I’ve seen how schools have evolved in this and new engineers are grasping the concepts much better. Me? I had to downward spiral through the path of a thousand errors and head bumps before I started to get it…but that’s just me.

Now bad programmers, those are just infections that every discipline has, I guess there’s no right way the get rid of these except to have managers and technical leaders that are capable to spot these and do something about them (train them, enforce better practices, fire them…though I hope the solution wouldn’t be this last one but something more constructive).

There are also other types of infections in the workplace, gossip and such…but I’ll leave that for another post.

h1

Software engineering and the iPad

January 28, 2010

Hold on! Don’t browse away, this is NOT a post about the iPad…it’s just my hook ;-)

So what is it about then? You ask. It’s my theory about why the iPad was a disapointment to many. Why is it a disapointment?

  1. It’s an oversized iPhone that doesn’t do calls.
  2. No OSX.
  3. Not able to run more than one application at once.
  4. Did I mention it’s just an oversized iPhone?

I am not an Apple fanboy as you can see. But I’m also not a detractor, I like their products (though I don’t like the fact they could be doing much more to improve their eco-friendliness). In general, it’s a cool company, with cool products, but the iPad just isn’t one of them. They lost at their own game. The iPhone was revolutionary, it impressed everyone, so when rumors started to surface about a tablet PC from Apple, we expected a lot, and a lot we did not get, sorry Apple, I’m still considering getting an iPhone though.

I said this wasn’t going to be about the iPad, right? Ok, so on to the subject. My theory about the fact that the iPad is not multi-app (I’ll use this made-up term because I don’t like to use multitasking for this concept, multitasking means something else) is that there in fact is a multi-app version deep within the ultra secret Apple software repositories. It’s just waiting to be properly tested, debugged and released. Apple, being the great company that it is, has even made a deliberate plan to get to the market faster than other tablet manufacturers to win market, while finishing development a a way cooler software version. Their software processes are so fine tuned that they are even able to predict when they can come up with the simple version (the one that was just released) and when they will release the next version supporting multiple applications, I bet it’ll even have TabletBand.

Of course the story could be different, they wanted to release a cooler version but their development process was so bad that in a desperate attempt to be able to release it on time, they cut down on all the features and kept just the basic features to be a market-hypeable product (this is my word inventing post)…

I really don’t know why the iPad was designed that way, I bet I just don’t find it useful for me being the geek that I am. I need a bunch of ports, power, compilers, too many applications running at the same time. I need to tweet the latest news or funny pictures while writing this blog, playing a hand of internet poker, compiling some project in the background, hearing music, chatting with 4 different people and keeping the beat of the song in my imaginary drum set…while brewing some coffee. So maybe it’s just not for me, maybe I’m an old-school geek, maybe new geeks will find it useful.

What I do know is that I’ve seen embedded systems projects do this strip-the-requirements-down-to-release-on-time sort of thing and it’s really sad. Mainly because the development team is usually technically able to deliver all the requirements, the failure is not in the capabilities of the team, but rather their management, many times their marketing (yes, being a development type, I tend to blame managers and marketers for the wrongs of the world…or rather, manager for the wrongs of a project and marketers for everything that is wrong in the world :P ). In companies where management hasn’t been able to properly articulate and synchronize all the inputs and outputs, this stuff tends to happen. Bad requirements lead to bad development platforms, that lead to bad products. Example: the requirements indicate that I need an 100 MHz processor, management insists in using a processor that barely accomplishes that to save cost, turns out the marketing team forgot to mention some critical characteristics that they thought could later be added, hardware has to be redesigned.

The worst example there is about this is trade shows developing anything with a trade show timeline is about the worst you can do to the project, unless for some magical reason (unbeknownst to mankind) a project is started with enough time to finish by said trade show, the project will invariably be started after this magical date. But that’s not all, it’ll be started late, and while the trade show get near, a funny thing will happen: a double negotiation between the development team asking to eliminate features for the “trade show release” (yes, trade show release) and marketing asking for new features or feature tweaks specially designed to meet some weird desire. The result is a software project completely void of quality, full of holes and just plain ugly. It’ll also be almost impossible to get it back to acceptable standards.

Notes:

- I don’t really think this is what happened to the iPad project.

- I don’t really play online poker while compiling, that’s just wrong.

h1

Welcome 2010, what do you bring?

January 14, 2010

I’m back! It’s been a while, end-of-year activities and then, well, vacations, just added up.

I’ve done a lot of thinking recently. Mainly about the direction the world in general is taking. We’re barely starting to get out of an international economic crisis and already CES was bursting with excitement this year, already consumers are expecting new devices, marketers are finding new stuff to hype about. I wonder, didn’t they notice that the economic crisis was nothing but a reflection on over consumption? I know, the cure to a reduced rate of consumption is to start buying again, to feed the economy. But isn’t it a trap? The resources that support our economy are not infinite, but our economy is, it has the “more” keyword written all over.

Just last month leaders from all over the world gathered to talk about the impending problem that is climatic change, I wonder, shouldn’t our economy start transitioning to more sustainable models? Shouldn’t electronics focus on newer paradigms? The new marketing hype should be all about energy-saving devices, intelligent homes, growing your own food, there’s so much that embedded systems can do in those fields.

An example of what I’m talking about, the Copenhagen Wheel. An embedded system, inside a bicycle wheel which integrates intelligent energy harvesting (from pedaling and braking your bike) to help you out with an integrated hub motor when you go uphill. It has all sorts of sensors inside and the “cool” factor: it communicates to your iPhone. The iPhone application gives you data from the sensors and traffic and controls how much the motor helps you, it’s just really cool, and what is it for? To ride long distances on your bike, leave the car for when you ACTUALLY need it. Interested? It’s still a prototype (though I hope it’ll become a product soon, I might just get an iPhone). Here is the project page for more info:

http://senseable.mit.edu/copenhagenwheel/

So for me, 2010 shouldn’t be about new consumer products that won’t do too much for us, it should be about redefining the industry, redefining the economy.

Note: I do know what I am saying is almost absurdly idealistic. I know this isn’t the year the economy will actually change. I just want to have that mentality. In my mind change is not only needed, it is an inevitability towards which a lot of indicators are pointing, not this year, it will be a slow process, throughout the coming 20 or 30 years, but for me, change starts this year. We who have the pleasure of working in the electronics field at this point in history are seeing and shaping new paradigms, it is our responsibility to come up with new paradigms that will enable our industry to become sustainable, just coming up with new products is not enough.

Have a great 2010 everyone!

h1

At last! My motor control MCU!

December 2, 2009

I am deeply interested in motor control as you can read in my “about” page. I also currently work with 8-bit MCU (though I’m starting to move to 32-bit technologies as well, as you can read in my blog post below). Even with my interest in motor control, I haven’t done a lot of work with DSPs (shame on me),  luckily 8-bit MCU are becoming more and more specialized these days.

Freescale (when it was still Motorola) used to have a really nice MCU called HC08MR, part of the HC08 CPU family, the father of the S08. The HC08MR was an MCU specifically designed for the low-end motor control market, specially BLDC motors and ACIM motor with simple control techniques (V/Hz conversion technique, not fancy stuff like vector control, of which I hope I will eventually talk…when I understand it well enough). The HC08MR has lived a long and happy life, even spawning some curious devices like the MC3PHAC, an analog + MCU + firmware integrated device, basically a plug&play ACIM motor control, very cool indeed.

Now we have the S08 CPU, faster bus clocks and cooler peripherals, so it was only natural that Freescale came out with a new and fresh 8-bit motor control MCU. At last it happened, and last week the S08MP family was launched. The S08MP is a little controller filled with peripherals besides the peripherals you would expect in a current 8-bit microcontroller it has some cool features like: FlexTimer (FTM) module specially designed for motor control with complementary PWM and dead-time insertion (one FTM has 6 channels and a secondary one has 2 channels), 2 programable delay blocks (little timers designed to synchronize two peripherals like the ADC with the timer), programable gain amplifier that can be linked with the ADC, high-speed analog comparators, 5-bit DAC and a CRC generator. All these features help make motor controllers that are both low-cost (1 to 2 dlls at 10,000 pieces, the most expensive ones are automotive certified) and still full of features. Reference designs for both sensorless and sensor BLDC motor controls are expected to be published very soon. Won’t be long before other reference designs come out doing maybe V/Hz conversion for ACIM motors or maybe even steppers. There are also other places where this MCU could shine, like power factor conversion or high brightness LED control (get it? Shine, LED? Ok, a bit lame…get it? Bit? Sorry, I’ll stop now).

In the coming months I’ll be writing more about this fascinating little device. I’ve had it near my heart ever since I first heard of it and now it’s right here in my cubicle happily turning a small motor round and round (pure geek bliss). I’ll probably even post a picture of me and S08MP16 smiling together, or I probably won’t, I wouldn’t want my readers to think I’m a creepy semiconductor freak (though I probably am).

h1

RTOS for dummies

November 18, 2009

This week, Collin Walls from Mentor Graphics, published an article from guest columnist Meador Inge in his blog. The blog post is called “C is great, but…“, and it goes on to highlight how embedded software programmers should get into languages other than C, the premise is that doing only C will make you a bad programmer. I agree and I have a lot to learn. I’ve played with Python in the past (not with embedded software purposes) and it’s been fun and educative.

On a similar note as Meador’s post, I believe developers should not limit themselves to a single software architecture. so I’ve also been learning the pleasures of RTOS. Coming from the low-end embedded world and having worked with 8 and 16-bit microcontrollers for most of the last 6 years, I’ve become used to forcing myself to do resource constrained software, with bare-schedulers at most. While this has been fun, I think I really need to get going with bigger systems. So I started playing around with MQX by Embedded Access, which is currently being offered by Freescale on several MCU and MPU. I believe MQX is a really nice step towards bigger and more complex RTOS, it has all the basic functionalities an RTOS is supposed to have as well as integrated communications stacks (ethernet, USB) that make suitable for a lot of projects. Freescale is putting a lot of effort into releasing a lot of enablement material.

Even with such a nice option, many of us are less than beginners in the world of RTOS. If you are one such case you should take a look a the Friendly Little Interrupt Tasker (or FLIRT), it’s a very small and simple RTOS ported to Freescale’s S08 architecture. The author, Dave Armour, published an article on Embedded.com about it, the article explains the operation of this great little RTOS in clear and simple language so that even the least knowledgeable of us can understand. A recommended read.

 

How about you? What’s your experience with changing your development paradigms? Leave a comment and let me know your experience with new languages, software architectures, RTOS, etc.

h1

No andaba muerto, andaba de parranda

October 25, 2009

We have a saying in Mexico: “No andaba andaba “>muerto, andaba de parranda”, which is roughly equivalent to: “he wasn’t dead, he was just out partying”. I haven’t written in some weeks, but there is, I think, a good reason for it: I was out partying…

No, really, I just joined a citizen action group called “Ciudad para Todos” (City for All). We’re a non-profit organization dedicated to promoting a healthier city through increased use alternative transportation like bicycle and public transport as opposed to the car-centric view of modern life. Aaanyway, the first couple of months working with this group have been particularly intense and taking up a lot of my free time. But I’ve decided I have to also commit to my blog as I am also an engineer, and this is what this post is about.

How do you define yourself, as engineer? As an “also engineer”? As an engineer and ‘x’? I have always had trouble with the idea of describing who I am, because I consider myself to be too many things, and I like it like that. I like to see myself as some sort of musician and some sort of writer. I also see myself as a free-thinker, an avid reader, a coffee addict. I will probably even be a family man some day (who knows, right?) When I was in college I had a lot of friends doing the social work thing. I was drawn to it, but considered my studies too important to do it. I was also doing an internship that eventually got me a part-time job that eventually got me my first full-time engineer job. I was career oriented, and still am, but I always felt I sacrificed a bit too much by doing so. On the other side of the equation, I also know people who definitely did more engineering than me during college. After almost 5 years of having finished college I came to the conclusion that I need to start doing stuff to change my contribution to life, because essentially I would implode if I didn’t. I am not JUST and engineer and this is just part of me. Some people have the drive to come home and start programming a random, self-motivated embedded software project. I admire them a lot, cause I don’t. When I come home I have the drive to grab the guitar and pluck at it for a couple of hours, that’s just who I am. I also am worried about the environment and how irrationally my city is growing, so I went and joined a group that is trying to change things.

I believe the world is made up of different types of people. I know that, because of my engineering training, I can satisfactorily do engineering work and be good at it. Yet, I don’t see myself as just that person. Some people are more of the just-engineer type, I know my brother spends more hours per day programming than me, some people are better suited for that. How about you? What type of engineer are you?

h1

Is pair programming for the embedded folk?

September 22, 2009

I just read an article in Obbie Fernandez’s blog about pair programming and how it is not for every company (10 Reasons Pair Programming Is Not For the Masses). I don’t usually read his blog cause I’m not a web developer, but my brother (who does do web development) tweets the articles he likes and I read them…(except when they talk about high level ruby code that my lowly embedded-C brain can’t or doesn’t want to understand).

Aaanyway, pair programming has always been something that intrigues me. The article basically states why it is difficult for most development teams to adopt the pair programming method. It just requires too much commitment and so much non-traditional focus that most shops are just not ready to do it. Even so, I bet there are embedded software companies out there willing to try the model out and that actually have the resources and commitment to make it happen. This leads me to (dreamily) wonder, is embedded software development adequate for pair programming? Most of my reasoning points towards yes, embedded software is, for all purposes, software, so the model should work even if it is not the ideal world of web (for more on why pair programming is so good for the web software folk, read this article by Rod Hilton). I felt particularly devastated by “the no-asshole rule” cause, let’s face it, the embedded development community is full of these types (all of them, the prima donnas, the smelly ones, the antisocial ones).

I also see a big problem with the overall maturity of the embedded software industry. From my very personal point of view, there are currently two types embedded software shops:

  • The stick-to-the-process, extremely formal type of place: these are the places where they are making really “important” software, for example: automotive, aero-space or networking (some) industries would be here. These types of shops have a rigid process and way of doing things all focused on clearing all sorts verification, validation and tests. Would they be willing to commit to the big change that would be jumping to a pair programming model?
  • The rest: sorry for the ambiguity but most other shops (again, from my perspective) are just completely random, with all sorts of people following all sorts of processes and/or not following any at all. There are of course varying degrees of truth to this, but the fact is that as an industry, we are way behind in jumping to an actual “software engineering” culture, most people come from an electronics engineering background, which doesn’t help either, and most of the people don’t really know or care about the benefits of formal processes (and I’m not talking about the IEEE, RUP, ISO type thing, but just a set of light and easy-to-follow steps like requirements-architecture-design-code-test). In this (admittedly) gruesome and negative panorama, does it even make sense to throw in a paradigm changing model? Not sure.

What do you think? Are embedded developers mature enough to pull pair programming off?

h1

Real masochists program in 8-bit assembly

September 17, 2009

So I’ve been programming some mathematical functions in assembly for the Freescale HCS08 core for the last couple of weeks. It’s been a really nice experience because I had not programmed in assembly for a while. Before you start judging me on not using C, consider that mathematical functions are one of the few places where assembly does makes sense, particularly when performance is a priority (like in motor control applications).

Apart from the horribly fun process of remembering the instruction set, the great thing about this project is that I’ve been able to go back to the roots of the CPU. I got to remember the cost of declaring a variable in a function and of passing too many arguments instead of pointers or structures. I also remembered how nice it is to have a CPU with several registers instead of only having three. But by far, the most valueable thing I got to remember was just how much an 8-bit CPU has to do to handle 16 bit variables. It’s almost ridiculous. A simple shift operation will take some 18 CPU cycles if done in variables stored in the stack. Depending on the input values, a 16 bit division could take from 100 to 900 CPU cycles depending on the algorithm being used.

All in all, a valuable (and gray-hair-inducing) experience. But I would definitely would recommend it to anyone who has gotten too comfortable with the high level languages.

Side note: I also love compilers a lot more now.

h1

Are embedded systems for the “do it yourself” person?

September 7, 2009

Most of my friends know I play the guitar (and those of you who don’t are bad bad friends). I’ve always loved tweaking around my guitars, desoldering and soldering them back, playing with the internal electronics and what not. I recently started thinking about “going all the way” and building a guitar out of scratch. It’s a pretty big project considering I don’t have wood working tools (or experience), I’ll eventually do it. Couple of weeks ago a friend remembered he had an article on building an acoustic guitar, so he sent it to me. Turns out it was from a November, 1964 issue of Popular Mechanics. It got me thinking, will there ever be do-it-yourself articles in magazines about building embedded systems? I know there are some electronics kits out there, but there is no programming involved. I mean some more “hardcore” embedded development with compilers, watchdogs and maybe even a small do-it-yourself oscilloscope. That would be fun, but I’m not sure if it makes sense. Embedded systems are custom hardware based, will there ever be really generic microcontroller modules that you can plug into whatever external hardware in a generic mechanical format? Or will embedded systems be always constrained to having the knowledge and budget to build your own hardware?

h1

College students…

August 18, 2009

All through college I never thought of sending an email to technical support of any semiconductor company, it was some sort of “student modesty” that I thought I should have, so all my stay in college the only contact I had with semiconductor companies was to get samples, and then I battled for hours with their demo boards. Today someone reminded me that I was one of the go-to guys to get the HC908QT4 demo boards we had in our school lab to work, good times.

Nowadays I’m a technical support engineer and we constantly get requests from students asking for all sorts of support, although I’ve read some really interesting questions from college students, most questions are of the please-spend-an-extra-hour-figuring-this-out-instead-of-bothering-me sort. Maybe it’s my pride talking, but it really gets me angry when students treat technical support like their own personal code monkeys. College is the time when they are learning to do that (learn their technical skills, becoming a code monkey or a manager is a combination of luck, decision, hard work, etc.)

I once had a student ask me to write their homework code for them (without even a small attempt to hide the fact that it was a school assignment). We have a politic to not develop code for students, it’s not that we don’t want to, it’s that we just don’t have enough personnel to write every code snippet request we get (although I do enjoy telling them we won’t be doing their homework), but we do send code snippets that have already been written. This particular request was for something that was very similar to something I already had available  (let’s say he needed a USB HID mouse and I only had an HID keyboard example). I sent it to him, told him which files he needed to modify and sent him on his way. A week later I received a “very dissatisfied” survey from him, saying he didn’t like that fact that I didn’t send exactly what he was requesting. Per our policy I had to call him or email him to request feedback. His phone number was bogus and he never answered my email. I wonder what grade he got for that project.

h1

Same product, different wrapping?

August 13, 2009

A couple of days ago I decided to change the theme for my blog…I tried a few templates and then I decided I should make a new template…being the graphically challenged person that I am I opened up my trusty MS paint, and got to work. The result, was, for my standards: amazing.

I kept thinking about this cycle of redefinition everyone lives. We are essentially the same, but with more experience, different body (some of us tend to get heavier, some of us try desperately to get thinner). The technology industry also works in a similar fashion. I thought of semiconductor product lines, and they do the same thing. New microprocessors are released with just a little tweak different from the previous one, then another tweak and then another, until suddenly a new core is released. Then that core gets new tweaks, and eventually a new core ends up having the same features as an old core had, but with more power, optimized peripherals (more experience), new packaging technology (different body), but it essentially does the same. It’s an LCD controller, a mobile processor, an RF IC. It just does the same thing but it’s better at it, pretty much like a person throughout his/her lifetime. Until we get obsolete and we stop adding new features and wait for the new cooler core to be released…sorry, for our children to be born…mmm…younger coworker to take our place…mmm…the possibilities seem endless…aaanyway, just a thought.