Readers

April 3, 2012 · Posted in Blog · 1 Comment 

This blog was long ago born out of a desire to be able to write whatever was on my mind down and publish it into the world. No matter the subject – if it interests me, or keeps me awake, or provides my rather busy head with yet another thing to concern itself with, it’ll make a fitting subject for this blog. And whether or not anybody cares to read it is really not much more than a detail to me.

That’s right. I simply don’t really care. If reaching tens of thousands of people every day was my main goal, I would have done things differently from the beginning. And I’d have given up a long time ago, because I’m simply not reaching that kind of audiences. The subjects I write about are too random and too specific for that to happen.

Nevertheless, looking at the page view statistics I’ve found that in the last two months or so, the number of visitors to this website has spiked dramatically. Various programs that request the RSS feed from the website are partly responsible for that, of course, but the spikes are too big to be caused by a sudden increase in feed traffic, and the volumes are too high for search engine crawlers, so I’m going to assume that at least some of those hits are caused by actual people.

On occassion, the people who (apparantly) do read this blog say something about it to me, and it turns out that there may actually be some who enjoy reading the stuff that I put here. That is, and always will be, a pleasant side-effect. But nevertheless, receiving that kind of feedback – whether it be from a friend whom I’ve known for years or a person I’ve never met who lives halfway accross the globe (if you read this, you know who you are!) – is the best reward I never expected to receive.

My mind remains in a persistent state of being busy with all sorts of things, and some of those will inevitably keep finding their way here. They have been doing that for I believe about seven years now, and will hopefully continue doing so for many more years to come. I am and always will write here first and foremost because I choose to do so, and it will always be about whatever subject I feel like writing about at the time. But if someone chooses to read it, and finds some sort of enjoyment in the process, all the better.

To anyone who cares to read this:

A sincere and heartfelt thank you, for giving my ramblings meaning.

Memory Card Myths

March 31, 2012 · Posted in Electronics, Photography · Comment 

As you get into digital photography, memory cards are one of the many things to consider. They’re the medium that carry your precious photos home. With file sizes upwards of 20 megabytes (or more!) per photo, and the couple of extra shots that you take every time just to make sure you have at least one good shot, you better carry a lot of that medium, lest you run out mid-shoot.

Luckily, memory cards are (relatively) cheap. It depends on what kind you’re buying – there’s still some major price difference going on between the cheapest of the cheap brand-less cards and the high-end cards from the larger brands – but compared to DSLR bodies, lenses, and the plethora of other accessories, memory cards are utterly insignificant.

Unfortunately, however, it seems that there are quite a lot of myths around memory cards, and how they should (or shouldn’t) be treated. In this article, I will go over a number of “tips” that I frequently encounter on the internet, and see if they hold any real-world value.

Myth 1: Formatting Cards In-Camera

A common misconception is that it is important to always format a memory card inside the camera, not using a card reader attached to a computer. While doing so may help a paranoid mind sleep at night, it holds no practical real-world value whatsoever.

The thing is, when you format a card, its filesystem is rebuilt. The filesystem is a special bit of the storage space that the card has, which tells which files exist where on the card, and which bits of memory are available for use. The basic, quick format (which is most often used) simply builds a new, empty filesystem, overwriting any that may have been on the card previously, so it’ll effectively appear to be empty. The second type of format actually goes over the entire card and writes zeroes to every memory location, so you’re sure it’s actually empty.

However, the basic, empty filesystem is such a simple structure, that there is hardly anything that could go wrong with it. In fact, if something was wrong, you’d notice right away – your camera (or computer) probably wouldn’t even recognize the card properly.

The bottom line is, a card that is formatted inside the camera contains exactly the same data as a card formatted by a PC, so which method you use makes no difference at all.

Myth 2: Format vs. Delete

Some people claim that formatting the card after each use is better than using the “delete all files on card” function, or deleting/moving the files off the card using a PC and card reader. Again, there is no real-world difference between the two.

It again boils down to the filesystem. When the card is formatted, unless you do a low-level format, a new, empty filesystem is created. When all files are deleted from the card, what remains is an empty filesystem, and an empty filesystem is in every way equivalent to a new empty filesystem. There is simply no difference.

Myth 3: Reading Cards In-Camera vs. Card Reader

Whether you use a card reader to download images to a PC, or keep the card inside the camera and hook the camera to a USB port, is not much more than a matter of convenience and speed. Many people prefer using a card reader, because they are generally faster (especially the new USB 3.0 readers, if your PC has a USB 3.0 port), there is no connecting/removing of cables involved, and you don’t have to fumble around with the camera’s card cover so much. Plus, card readers are cheap, and often support a wide array of card types (which is especially handy if you use a mix of SD and CF cards).

All of these arguments are valid points, but the low-level operations that are being performed on the memory card are identical, so in terms of reliability, there is no difference at all. The argument that using the camera drains the battery however is hardly a good point: the battery drain for reading the memory card is hardly worth mentioning at all, and if you’re remotely serious about photography you’ll recharge your batteries before the next shoot anyway.

Myth 4: Card Wear

Some people claim that you should rotate your cards in such a way that each card is worn out at the same rate as others, or recommend other ‘tricks’ to reduce the amount of wear on the card.

Every type of memory card on the market today is based on flash memory. It is true that this type of memory has a limited lifespan. After being rewritten a certain number of types, it is no longer reliable. However, even the cheapest of the cheapest flash memory units are rated for at least 10.000 write cycles, and will typically go way beyond that mark before any problem actually starts to occur.

A typical usage scenario involves two steps which cause the memory to be written to: first, a picture is taken and written to the memory card; second, the picture is  downloaded to a PC and deleted from the card again. That is two write cycles for every time the card is used on a shoot.

This means that the card will have to be used at least 5.000 times before there’s a serious risk it wearing out. If we’re very optimistic, and say that you use the card every day, that will still take you 14 years, and by that time, the card has probably been replaced by a different type of memory card, or a faster/larger card, anyway.

In other words, card wear is very unlikely to ever become a real issue (at least as long as you use established brands). And if a card does start to give trouble, throw it away and buy a new one. They’re too cheap to risk losing your photos over.

Myth 5: Data Corruption

At one point, I encountered the ridiculous notion that taking a photo when the memory card inside the camera is full could cause existing photos to become corrupted. If such a thing were to happen, the blame would be with a completely incompetent programmer. It is simply ridiculous beyond imagining that such a thing would happen in the real world; any camera that, once its card is full, will simply alert you to this fact and refuse to take any more pictures until its hunger for more memory is satisfied.

Another issue, taking the card out of its card slot (or a card reader) while it’s being written to (which is typically indicated by some sort of light) is potentially damaging. While it’s unlikely to make the entire card useless, there’s a good chance that at least some data will be damaged if you do this. Plus, whatever action is being performed doesn’t usually take much more than a few seconds anyway, so just be patient already.

Things You Should Do

After discussing all these things that are not important, let’s also go over a few points that are definitely helpful.

  • Less More is More
    Memory cards are cheap enough that you should be able to buy a good amount. There is no such thing as having too much memory, and it’s an eternal shame if you miss a shot due to a lack of memory. Having more cards than strictly needed also enables you to go longer between downloads.
  • Carry a Spare
    You wouldn’t be the first photographer who brings his camera somewhere, only to realize you left all your memory cards at home sitting next to your PC since you’ve emptied them the night before. It can never hurt to keep a spare card in your wallet, just so you always have at least one card at hand, if you need it.
  • Buy Only Established Brands
    While cheap cards may be, well, cheaper, it’s a wise thing to avoid them and only go for established names. The difference in price gets you a card that is much less likely to fail, and can work at higher speeds. Examples of well-known brands include Kingston and SanDisk. The SanDisk Extreme series of memory cards (to which I can give my personal recommendation) have been known to survive being submerged under the sea for over a year, whilst cheap brands are not guaranteed to survive as little as a two-foot drop.
  • Watch the Speed Rating
    Each memory card, or at least – each proper memory card – is rated to perform at a certain mimimum read/write speed. Whilst a slower card will hold pictures just as well, a high-speed card is essential if you want to shoot video (especially HD), and if you use that fancy high-speed burst mode that your camera has, you’d better pack a really fast card if you want to be able to keep it up for more than a second or so. A speed rating of at least 30 MB/sec is recommended, but the higher, the better.
  • Play Safe
    Whilst the better memory cards are often designed to handle unfriendly circumstances (such as shocks, temperature, and moisture) better than cheaper cards, it is of course safest to avoid the type of situation that might break your card in the first place. Don’t take them swimming, don’t throw them into fires, don’t drop them from a ten-story building, don’t feed them to your kids, that kind of thing.

Bottom line, there’s a lot to say about memory cards, but as long as you stick to buying quality materials, it’s extremely unlikely that they’ll ever let you down. And has to how you format them, and how you transfer their content to your PC: some personal preference aside, it really doesn’t matter.

Abstract

March 28, 2012 · Posted in Photography · Comment 

(click to view the rest of the album)

The picture you see above is entirely un-edited (aside from being coverted and resized, because a 25MB RAW file is kind of ridiculous to post on a blog).

It was taken a little while ago on a moving train, at night, with a small aperture and low sensitivity (f/32 and ISO 100, respectively) , and an extremely long shutter speed – just over one and a half minute (even dSLRs don’t usually go above 30 seconds and even that is an extremely rare setting). The front of the lens was directly against the train’s window so as to avoid reflections, and the camera was rotated slowly (roughly 60 to 70 degrees counter-clockwise) about halfway through the exposure.

The result is that over 3 kilometers of lights that happened to be somewhere in the area – car headlights, billboards, buildings, street lanterns, anything – were captured, into an image which is quite abstract and weird, but also quite fascinating (in my reasonably humble opinion).

Photography can be about creating a depiction of a scene or object, which is both accurate and visually appealing, and a wide variety of “rules” exist to aid in accomplishing that. But photography can also very much be about breaking the rules and doing something radically different – being creative. I think this image shows how interesting it can be to just go straight against everything you’re supposed to do and try something totally unexpected.

The rest of album (click the image above to go to it) contains other, similar-style photographs, but the one above is probably my favourite of the series (with this image, capturing an entire train as it races by, as a close second).

Mail

March 25, 2012 · Posted in Randomness · Comment 

Postal systems are great. I do believe that paper letters, for most intents and purposes, are pretty much past their expiration date, but nevertheless, the postal system is the foundation for something I’ve come to appreciate greatly: ordering stuff on the internet.

Every postal service company in the world does basically the same thing. They deliver something somewhere, and how expensive that service is depends on two main factors: how far away it needs to be delivered, and how big it is.

Since we have yet to establish any major colonies outside of our little planet Earth, and postal services generally have their area of service well-defined, the first of those two factors is pretty much safe. However, when I look at any given weight vs. price table – whether it be for a domestic letter or a full container load sent to the opposite side of the planet – there seems to be one crucial flaw:

All – or at least nearly all – postal services assume that the items they deliver will have a positive weight.

Imagine this:

You take a box. The size doesn’t really matter, but making it as large as your local postal service will allow will make this experiment more interesting, because it’ll also be a lot more difficult to handle the box.

Inside the box, put an air-tight bag. Plastic would probably the most suitable choice. Latex/rubber balloons may work, but the material being porous might become a problem in terms of endurance of our special little parcel.

This bag/balloon/whatever thing is then filled with helium, and the box is taped shut. Slap on a label addressed to, well, some random person, and take it to the post office. Walk into the post office with the large box, pretending that it’s really heavy. Then watch the surprise on the poor post office clerk’s face as the box will stubbornly refuse to be weighed.

Not to mention the dilemma of what the price for delivery should be – as in most cases, the cheapest category is 0 to however many kilograms (or grams, or pounds, or potato-weights, or whatever). Or the trouble that the box will cause everywhere throughout the sorting and delivery process.

Also, use insured shipping, so you can claim damage money when the delivery person accidentally allows the box to float away and go high up in the sky.

Helium is fun.

 

P.S. A lot is happening behind the scenes here. Aside from my unusually high post frequency (and a rather long list of things that are I’m planning to write about in the near future), I’m doing various things to improve the blog as a whole. The category system has been reorganized, I’ve set up a connection with Facebook so that new posts here are automatically published there as well, and some various other things. Also, in the background I’m working on a shiny new theme for the site. It’s going to be awesome!

Spring

March 23, 2012 · Posted in Photography · Comment 

(click to view the rest of the album)

Movies & Stills

March 11, 2012 · Posted in Games, Photography · Comment 

So, yeah! It’s been a while, again, as it happens from time to time.

Two days ago I started watching a movie. I believe it was called Mass Effect 3.

Or well, watching a movie is pretty much what the first two hours or so of the game felt like to me. It seemd mostly like an endless stream of cutscenes with an occasional dialog choice and a couple of short, extremely Pokémon-y (ie, linear) bits where you actually get to walk a bit

Luckily, it got better after that, and now I’m at the point where you do actually have a fair amount of choice in what you do and where you go, and at this point, it’s definately enjoyable to play ME3. Despite the fact that it still suffers from the same things that the previous incarnations of the game did: especially at the start when walking through the Citadel you get overloaded with so many new side-quests and stuff that it’s entirely impossible to keep track of the things you’re doing/going to do, and the game is very much a Pokémon game.

Not that it has anything at all to do with the colorful little creatures from the 90′s, it’s just my way of stating that the entire game world is built in a very convenient manner. Every little detail that’s there has something to do with some mission in one way or another. Every place which has objects that you can use as cover that you encounter in a mission is a place where you’ll get attacked by some sort of bad guy, no exceptions. Every route that doesn’t lead to to your objective is conveniently blocked off by a door you cannot open, rubble, fire, or some other conveniently-placed object.

And as good as the rest of the game may be, this is just something that makes everything feel so very damn convenient.

Anyhow, watching Mass Effect 3 is not the only thing I’ve been up to recently.

Up until recently, I’ve been using an old digital camera, an Olympus C-350 to be exact. With 3.2 “effective” megapixels (whatever that may mean), more digital than optical zoom, a tiny poor-quality 1.8″ screen, as many menu options as a water heater and the speed of an upside-down turtle on crack, this camera stems from the era were digital cameras were only just rid of floppy drives as primary storage medium and they barely became affordable to the general public. In the time this camera was bought, it’s then-impressive 64 MB memory card (the infamous xD Picture Card, no less) cost a small fortune.

And it was a good camera. For a compact camera from that period, at least.

But alas, I was no longer happy with it. The images it produces are consistently blurry, low-res, and chock-full of noise. The card will hold only 60 or so shots, but after the third it’ll have depleted it’s batteries. Then again, taking a single shot (and writing it to the card) takes about a week and it’ll try to use the flash no matter how much light there is, so then again, that sort of battery life is almost impressive.

Since it’s been on my list for a while anyway, and since I am now in a position where I can afford it, I decided to upgrade.

And a serious upgrade it is. I now have in my possession, a brand-new Canon EOS 60D digital single-lens reflex (dSLR) camera. With 18 megapixels on an APS-C sized sensor, 9 cross-type AF points, 5.3 frames per second burst rate, very good noise performance, an absolutely gorgeous 3″ LCD screen with tilting/rotating capability, and full HD video, the word “upgrade” seems a bit of an understatement.

To start with, it’s paired with a Tamron 28-75mm F/2.8 lens. Bought second-hand, it cost me as much as a kit lens would have, but delivers far superior performance. And first on the list for expansion is the Canon EF 70-200mm F/4 L.

I’ve received the question why I chose a Canon. As you might know, in the world of proper cameras, there are basically two major brands: Canon and Nikon. There’s a few others (Sony, Pentax, and so on) but they’re not as big. Canon and Nikon are kind of like Microsoft and Apple: both have their base of devoted fans, and fans of one brand hate the other brand and vice versa.

For a large part, brand loyalty in the dSLR-world is easily explained by the fact that lenses are expensive. Once you own more than one or two lenses (especially the more high-quality ones), they often represent an investment far greater than the actual camera, and since lenses are only interchangeable between the cameras of one manufacturer, it’s a very bad idea to switch brands or use multiple different brands, financially speaking.

Having said that, I bought a Canon because the 60D offers what I’m looking for at a price I’m willing to (and able to) pay. Other than that, both Nikon and Canon will probably always be in an endless war with eachother, and one may occasionally have a small advantage only to be overtaken by the other again – but in the end, both brands make very good products, and which one is best for you really boils down to personal preference.

Very much like the war between Apple and Microsoft. Yeah, I said it. Live with it. Because if you put aside personal preference and look at the situation objectively, that’s how it is.

(And in the background, the competition will only drive manufacturers to innovate and continue developing better products, which benefits to everyone.)

For the moment, I’m mostly just playing with my shiny new toy, and getting as familiar with it as I possibly can. On the somewhat longer term, I have some great photo-opportunities coming up. And who knows, maybe I’ll actually be able to take some decent pictures.

Normal

December 19, 2011 · Posted in Blog, Randomness · Comment 

So, yeah!

It’s been a little while since I last wrote here. If you don’t like it, well, I blame my irregular update schedule (or well, lack of an update schedule, really). As I’ve stated in my little About Me section: it can be a day between posts, a few months, or anywhere in between. Who knows. (I certainly don’t.)

So, yeah!

Normality.

What the hell is it anyway? When are you normal? When are you not?

For starters, being like me would probably put you in the latter category. But that is entirely beside the point.

Wikipedia (oh, how we love thee!) states that ‘in behavior, normal refers to a lack of significant deviation from the average’. This is pretty much how I would define it myself. However, I find this definition a bit unclear.

In order to determine what normal is, we’d need to first find a way to quantify every aspect of a person. Some of these are easy: a person’s age is already counted in years. We can easily count how many times a person has had sex (well, it kind of hangs on how drunk the person usually is when they have sex, but that’s a separate aspect), or how many different bikes they’ve owned as a kid. When it comes to personality traits, it gets a bit more difficult, but let’s assume that we’re able to measure stuff like how well you respond to humor, at what level you’re interested in science, how socially developed you are, and a gazillion other things, on a simple scale of 1 to 10 each. Of course, there are other factors as well, such as what gender you have and how pretty you look.

Now we have the tricky bit. We’d need to know the values for each of these scales, for every living person on the planet. This may be a liiiiiiitle bit problematic, but in order to accurately figure out what ‘average’ is exactly, it’s pretty important.

So, now we know how an exactly average person would be. We know exactly what he/she would look like. Actually, the matter of whether this average person would be male or female is a bit tricky, but since there are slighly more females than males in the world, our person would have need to have a single breast and both a vagina and a penis, but the vagina would have to be slightly larger than the penis (but still of average size of course – you can see why this is a bit difficult). He/she would probably live somewhere in the molten section of the planet’s core (though leaning more towards China than any other area on the planet), have about a quarter of an internet connection, and own something like three quarters of a mobile phone. We would also know exactly how his/her personality is, how well he/she likes certain subjects, and everything else there is to know.

(Obviously, if we take the world’s internet user’s as an accurate representation of the human population, chances are than our average person is a dumb annoying idiot.)

So, yeah.

Now we have a perfectly average person. Problem is, there is probably not going to be any living human in the world who is a perfect match to this average, and besides, we’re talking about normality, which we’ve established to be having a lack of significant deviation.

‘Significant deviation’ is again a pretty vague term. When exactly is the deviation significant?

I’d say, the deviation is significant when it’s more than the average deviation.

Oh boy, we’re gonna need to pull out the numbers again, and compare everyone’s scores against the perfect average, and write down the difference between everyone’s scores and the average scores, and then find the average of that. In other words, we’re calculating the average deviation that people have from the perfectly average person.

Now we have a pretty good baseline: we know what ‘normal’ is exactly, and we know how much you can deviate from ‘normal’ without reaching an over-average (ie, significant) deviation from being normal.

Since our average person is just about halfway between male and female, and pretty much everyone else is either male or female, we all have a large deviation from the average, so you’re probably safe on that count. In other areas… Well, I can’t tell that for you. Not until zeh maths are done.

So, there we go. Normality.

Have a nice day now!

One Ring…

September 30, 2011 · Posted in Blog · Comment 

One Ring to add to the thousands of others, actually.

Yeah, it’s a (small) piece of chain mail, and yeah, I’m learning myself how to work this stuff.

It’s actually more complicated than it seems at first. Getting the first bit right is tricky, but once you have a piece of fabric (like the above), it gets easier. The rings will arrange themselves in their pattern more easily, and any mistakes you might have made become more obvious.

Also, it takes a LOT of time.

Eight

September 13, 2011 · Posted in Blog · Comment 

We all know that Microsoft has had a tradition with Windows, in which each good version is followed up by a horrible one. Windows 2000 was a good OS, ME was… Well, we all know. XP was (and still is) a good OS, Vista, well, even Microsoft admitted that it was crap. Windows 7 is good. But Windows 8…

Of course, somewhere along that line we could also mention Bob, but Bob was never officially released. Microsoft Bob was an attempt at a very easy-to-use version of Windows. You probably know the annoying paperclip from MS Office? The one that you feel compelled to axe-murder the nearest person every time he came up to offer you a tip? Yeah, he’s actually a leftover from Bob. Now imagine what the rest of Bob was like.

Anyway, I’ve read a few things about it before, and today a lenghty article has been published on the Dutch IT-news website Tweakers.net. It goes into details about the new interface that Microsoft is putting on Windows 8, called Metro. It is supposed to be (and well, actually is) the biggest makeover since Windows 95 (and quite possible earlier). It also looks like the most epically-sized mistake Microsoft has made since Windows 95.

Sure, the Metro interface looks all shiny. Integration between applications is definately something I can appreciate. And if this whole Metro interface ended up on smartphones and tablets, there’s not much negative stuff I can say about it. On such a device, the interface will work, and it’ll be all pretty and nice and great.

But not on a desktop.

The first big mistake is that apparantly, the Metro interface is just shoved down your throat and you can’t easily get around it. The “classic” interface with a desktop with icons and a task bar is still there, but is considered an application within the Metro interface, and not one you can go into by default. It’s no secret that running with multiple monitors has not always been optimally supported in Windows (the ever-present lack of native support for a taskbar on those extra monitors is a perfect example of that), but I fear that in Metro, the extra screen space that people like me have come to love can hardly be utilized at all.

Guys, the whole reason why I have more than one screen is that I have more space to put stuff in, not so that I can have the same things only with bigger icons and more empty space (which seems to be the trend that Microsoft has been following lately, along with many others).

Bringing in HTML5/JavaScript/CSS as a platform to develop Metro-applications is language abuse of pretty much the worst possible kind, and using Internet Explorer as the platform to run it on is arguably even worse. I can foresee Microsoft getting serious legal issues because with this, they are once again forcing IE down people’s throat rather than letting you choose which browser to use. The infamous browser selection screen, and especially the debacle that led to its creation, is an issue that is going to roar its head and spew fire like it hasn’t done before.

Just about every single existing application is going to be marked as legacy/outdated in this new Metro interface, and the new application store (yes, yet another one) will again be a perfect opportunity for Microsoft to siphon cash from the pockets of hard-working developers.

The perfectly good explorer-interface from Windows 7 has been desecrated by forcing the infamous Ribbon UI on it. The fact that the world has widely shown its disapproval of the ribbon once again doesn’t seem to bother Microsoft in the least. They’ll do whatever the fuck they like and what the actual users want is certainly none of their concern.

Casual computer users will probably accept the new interface that comes with Windows 8, be it with a bit of getting used to. But unless Windows 8 has at least the option to turn Metro the fuck off and just use the desktop environment that we’ve all come to know and love (which is especially true for power users), Microsoft’s latest stillborn creation will be right up there alongside ME, Vista, and quite possibly, Bob.

Solutions

September 10, 2011 · Posted in Blog, Electronics, Programming · Comment 

Lately, I’ve been putting quite a few hours in a little electronics project. It involves (amongst other things) a bunch of microcontrollers; primarily PIC18F2520 (or probably 18F2420 at a later point; it’s the same except for having less memory and being cheaper) but also an occasional PIC18F1330. These microcontrollers are supposed to talk to eachother using CAN.

CAN is a bus system that has some pretty neat features. It can handle a lot of devices, can achieve pretty good bit rates, it has very good error handling and bus arbitration functions, and so on. It was originally designed for use in vehicles (and in fact, any car manufactured in the last 10 or 20 years or so is largely built around tons of individual devices talking on a CAN bus) but of course there’s a lot of other situations in which the features offered by CAN are useful.

I’ve been trying out the new MPLAB X (which is still in beta). There are some major shortcomings, but overall it’s starting to look like a pretty good IDE, which is nice because I absolutely hate the old MPLAB. Compiling is done using Hi-Tech C.

Now, if you were to ask my opinion on Hi-Tech C a week or two ago, you’d get a pretty negative review. I’ve been having issues with it. Weird issues, like global variables not working (no matter what you write, they always read as 0 unless you access them via a pointer, which is a bit of a stupid and inefficient workaround). I’ve also been running it in Lite mode, rather than Pro, because in Pro mode it uses the big Omniscient Code Generation – an optimization technique which is actually quite good, except that it always seemed to turn out horribly bad code that performed nothing like it was supposed to.

It turned out that all of those issues were caused by the extended instruction set being enabled in the PIC’s configuration bits. What happens is that that bit doesn’t only make a few extra instructions available (8, in fact) that are primarily of interest to a C compiler, bit it also changes the way memory addressing is accomplished. Thus, if the extended instruction set is enabled while the compiler isn’t generating code that uses those extended instructions (or specifically, its way of addressing memory), things go wonky. Big time. Turn the extendend instruction set off, and everything works like a charm (OCG included, cutting the code size in half!). Today, I’m pretty darn happy with Hi-Tech C.

Of course, the user manual doesn’t make a single reference to the extended instruction set (I’d say this is exactly the sort of thing that should be mentioned in the manual, but yeah. It’s not).

Also, for the CAN part, I’ve been using a setup with the MCP2515 CAN controller IC, paired with an MCP2551 transceiver. By my initial look at the datasheets, this should have been easy, until the moment I got to actually using it and had to figure out how the bit timing configuration works (and it would seem that I havn’t been the only person to struggle with this). As it turns out, once you grasp it it’s simple enough, and since I havn’t been able to find a functional calculator tool on the Interwebz (just one for the older MCP2510, which isn’t entirely compatible), I might just find some time to write such a calculator.

Still, with the bit timing issue aside, the packets that one of two CAN nodes is transmitting don’t seem to be making it to the other end, for some reason. That’s a thing to figure out once I have the opportunity to put an oscilloscope in the mix and see what’s going on.

Next Page »