NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Microcontroller Programming » Boot loader Questions

April 07, 2010
by CyberGod
CyberGod's Avatar

Hi, In the instruction manual you've mentioned that the micro controller that comes with the kit has already a boot loader installed called foodloader. My questions are: 1. Why the chips that you buy from the market don't come with a boot loader? 2. Is the boot loader burned into the ROM of the chip. 3. If I am to buy a new controller how do I installed the boot loader, do I need a special programmer to do this, and what different choices for a BL are there. 4. Is the purpose of the boot loader to just point to the first instruction that start the code.

I apologize if all this questions seem too beginner like. I just received my kit yesterday and managed to do the first experiment. I am really enjoying it and already have some ideas that I'll share.

April 07, 2010
by mcai8sh4
mcai8sh4's Avatar

Hi CyberGod, I can offer you some brief answers to your questions, I'm sure others will be able to add more detail (and probably correct me where I go wrong)...

1- Why the chips that you buy from the market don't come with a boot loader?

Since these chips don't actually need a bootloader (although we do, I'll get onto that) and there are different types of bootloaders out there, it makes sense to sell the chips blank, then they are suited to everyone.

2- Is the boot loader burned into the ROM of the chip?

The bootloader is uses part of our programming space (around 2k I think) so the max size of our programs (on the 16k chips) is around 14k. Question 4 will explain this a little more.

3- If I am to buy a new controller how do I installed the boot loader, do I need a special programmer to do this, and what different choices for a BL are there?

To put the bootloader (foodloader or other) on a blank chip you need an ISP programmer. There are available from ebay and other places (you could even make your own with the nerdkit) They program the chip differently to how the Nerdkits guys do it.

4- Is the purpose of the boot loader to just point to the first instruction that start the code?

The reason (or at least ONE reason) Nerdkits uses the Foodloader is to make life a little easier AND it also adds a little more functionality without adding extra parts. To explain a little...

The food loader is 'just' some more code, it's a program that accepts the code you send it, places it in the right place (so it doesn't overwrite the bootloader) and alows you to run it. A normal ISP doesn't need a bootloader as it works in a different mannor. The beauty about the Nerdkits system, is not only can you program the chip with the USB header, you can also get your program to interact with the computer using the USB header. Long story short, it makes life easier. Using an ISP, you have to worry about setting the fuses correctly, it uses more pins to program....etc.

I have bought an ISP and occasionally use it, but the majority of my progects/test/playing around is done using the Nerdkits setup - it's quick, easy and works!

I apologize if all this questions seem too beginner like... : Never apologise for asking what you think are beginners questions. I am also a beginner and a while ago, I had the same questions. You'll find alot of people here who will try to help answer any questions you have, and I don't think anyone will chastise you for asking seemingly simple (or complex) questions.

It is worth reading through the forums as alot of beginners questions have been asked already. Whilst this is a daunting task (there are quite a few posts on here now) there are some good reads (interesting threads). But don't worry if you post a repeat of a previous question.

I hope you enjoy learning this fascinating subject as much as I am. Welcome to the community!

I know I've been a little brief on the answers, I'm a little short on time. If you need any more information, just ask.

If I'm wrong about anything above - oops, sorry - please correct as I'm still heavily in the 'New guys' corner.

-Steve

April 07, 2010
by CyberGod
CyberGod's Avatar

So if I am to buy a new chip how should I go about installing the foodloader bootloader so it can be just like the nerd kit. I am just trying to understand the concept here and not just use the micro controller as a black box.

April 08, 2010
by mcai8sh4
mcai8sh4's Avatar

The way I (and others on here) have done it. Buy an ISP (In-system Programmer) and use that to upload programs onto the chip. These programs can be the same as the ones we create (temperature_sensor example) or a bootloader (Foodloader). It really is as easy as that... although I had a few issues (setting fuses, altering the Makefile to suit the new programmer), but once all that was sorted, it's as easy as pie.

Take a look at this thread : Linky, also is you use the forum search box and search for 'ISP' it will reveal quite a number of other threads that may be relevant.

To summise...

The foodloader is just another program, kind of like any that we write - but it also accepts code via the USB header and lets us run our new code. Without the food loader you need an ISP to upload your code (slightly less convenient in some cases), but with an ISP you can also load the bootloader on.

Hope this helps

April 08, 2010
by Rick_S
Rick_S's Avatar

Here are some links to threads discussing people programming bootloaders that I have responded to. Might make for some good reading for you.. :)

Link one

Link two

Link three

Any other questions, feel free to ask,

Rick

April 08, 2010
by CyberGod
CyberGod's Avatar

Thank you very much for your replies, they really helped me understand the concept!

Post a Reply

Please log in to post a reply.

Did you know that you can aim and fire a servo-controlled water gun from your computer? Learn more...