go_away

Author Topic: Creating a Microcontroller from Scratch  (Read 1373 times)

0 Members and 1 Guest are viewing this topic.

Offline createmcTopic starter

  • Beginner
  • *
  • Posts: 5
  • Helpful? 0
Creating a Microcontroller from Scratch
« on: September 21, 2011, 08:05:39 PM »
So i want to make a basic first robot and i understand what to do with an already built microcontroller but as a challenge i actually want to build a microcontroller from SCRATCH.

Yes i understand that it's a tough thing to start off with but my plan is to understand how everything works by actually doing it. I'm currently working towards an electrical engineering degree so i know basic terminology or i can look up anything new.

Basically, can anyone provide links/videos/books/comments that i should read to understand how to start building a microcontroller from scratch. I know that once i get going or when i get in the 'zone' i will get the hang of it, but starting is the hard part right now because i have no idea where to start. I have coded before in plenty of languages so programming is definitely not a problem too.

Thanks

Offline WaterPig Master

  • Full Member
  • ***
  • Posts: 62
  • Helpful? 3
  • Hurdy Gurdy playing at Raglan
Re: Creating a Microcontroller from Scratch
« Reply #1 on: September 22, 2011, 01:28:59 AM »
Hi,

If you're referring to an augmented MCU (I.e. A board with the MCU chip and assorted support components on) then that's more than feasible. However, it sounds a bit like you're talking about trying to build an MCU chip yoursel! This will be more difficult.

I suppose there is a chance that you could build yourself a little computer like that with a microprocessor, memory and assorted other chips - have a look on the Internet for popular microprocessors and how to use them. This is probably the best way to go for you if you have good EE skills and can get boards made to precision (you will need buses). This will get you your understanding of the innards and operation of MCUs.

If you wanted to make one completely from scratch, well… you'd have a lot of transistors to deal with :)

Offline createmcTopic starter

  • Beginner
  • *
  • Posts: 5
  • Helpful? 0
Re: Creating a Microcontroller from Scratch
« Reply #2 on: September 22, 2011, 08:34:15 AM »
 ;D Yep i actually want to make the MCU. I have the time and i want to include it in one of my school projects. I can get a board created at school for pretty free. I don't want to 'build' the ip core and i have access to FPGA's...etc.

Thanks for the heads up though

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Creating a Microcontroller from Scratch
« Reply #3 on: September 22, 2011, 09:57:03 AM »
Hi,

;D Yep i actually want to make the MCU. I have the time and i want to include it in one of my school projects.
For a school project, you don't have the time... Take my word  :)


I can get a board created at school for pretty free. I don't want to 'build' the ip core and i have access to FPGA's...etc.
Using an FPGA is not building from scratch!
If you wanna do it (right), buy  5..10k transistors and knock yourself out ;D

Seriously, google the topic, it has been done so many times before and there's no sense in re-inventing the wheel.
Don't expect more than very mediocre result though and perhaps just settle for the CPU part.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline createmcTopic starter

  • Beginner
  • *
  • Posts: 5
  • Helpful? 0
Re: Creating a Microcontroller from Scratch
« Reply #4 on: September 22, 2011, 05:23:57 PM »
Hi,

;D Yep i actually want to make the MCU. I have the time and i want to include it in one of my school projects.
For a school project, you don't have the time... Take my word  :)


I can get a board created at school for pretty free. I don't want to 'build' the ip core and i have access to FPGA's...etc.
Using an FPGA is not building from scratch!
If you wanna do it (right), buy  5..10k transistors and knock yourself out ;D

Seriously, google the topic, it has been done so many times before and there's no sense in re-inventing the wheel.
Don't expect more than very mediocre result though and perhaps just settle for the CPU part.


Hey,
You definitely know more than me so i'll work on your advice. When you say "using an FPGA is not building from scratch", what do you mean by that? would it be easier (and shorter) to use an FPGA and go from there?

In the end, i want to create something that i can use in a very very basic robot. something that could just move around and hit a wall for all i care. However, i don't want to go out and buy already made pieces and just connect then and it's done. I want to at least do SOMETHING in the most important part of the robot imo (the MCU). Any ideas from what i explained?
« Last Edit: September 22, 2011, 05:25:56 PM by createmc »

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Creating a Microcontroller from Scratch
« Reply #5 on: September 22, 2011, 06:43:22 PM »
Hi,

When you say "using an FPGA is not building from scratch", what do you mean by that?

Building from scratch would be to grab a box of transistors and start welding them together - same as what's being done on a wafer.


would it be easier (and shorter) to use an FPGA and go from there?

Yes, you can even download softcores so that you have to do next to nothing yourself, but that would sorta go against the whole idea of  building it yourself I'd guess:

You might wanna check out this page and this page (both on the FPGA subject).

A page on a TTL build-up here and a discrete transistor build 4-bit core here


In the end, i want to create something that i can use in a very very basic robot. something that could just move around and hit a wall for all i care. However, i don't want to go out and buy already made pieces and just connect then and it's done. I want to at least do SOMETHING in the most important part of the robot imo (the MCU). Any ideas from what i explained?

Whatever your fancy!

Personally, I find it a waste of time these days with cheap controllers everywhere (but I'm probably a bit biased, as I built my first real computer from a Z80, some handfulls of Z80 support chips, a truckload of LSTTL chips resistors caps etc. and on a separate PCB, a huge 48kB RAM, all in all taking up about twice the space of a modern motherboard. That was back in the seventies), but each to his own :)

But getting a ready bought cheap microcontroller to work takes a wee bit more than just buying it and popping it into a board and might teach you something useful in the process - like how to decouple supply lines, how to lay out boards for analog inputs etc. etc and it still needs a program stuffed into it's tiny brain.


My best advice is to keep the interest, but do the project with a boring regular microcontroller first (I'm sure it will be enough of a challenge initially) and when it's working perfect and all documentation is done, go ahead and make your own - that way, you can always add whatever you get around to, to the project, but if you're like 99.9% of all the students I've met, known or helped, you don't have plenty of time, in fact, you'll sweat your brains out your ears the last month, week, day, hour etc. derived of sleep and proper nutrients (pizza only makes you fat and coke rots your guts, if you forget to water it down with some Scotch a.k.a. Brain Oil ;D)

You won't get judged on how complicated you made life to yourself or the size of your project, but on how well you documented whatever you made. Even the smartest robot will net you an "F", if the documentation sucks and even the smallest project can land the A+, if the documentation is pristine - I've actually seen top marks for something as "simple" as a one transistor amplifier (an electronics engineering graduation exam), due to the extremely bright and complete documentation.

Cheat yourself in a good way, by setting your watch a couple of months forward - you'll be glad you did  ;D


You don't do this to have a good time, you do it to get a good future life!


P.S. The most important part of a robot is not the microcontroller, it's the power source!
Don't believe me?
You can build a functional robot without a microcontroller, but you cannot build one without a power source!
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline Gertlex

  • Supreme Robot
  • *****
  • Posts: 744
  • Helpful? 23
  • Nuclear Engineer · Roboticist
Re: Creating a Microcontroller from Scratch
« Reply #6 on: September 23, 2011, 12:45:10 PM »
^^^
What that guy said.

Soeren, maybe we should have you make the definitive sticky post for how folks should approach their school robot projects ;)
I

Offline createmcTopic starter

  • Beginner
  • *
  • Posts: 5
  • Helpful? 0
Re: Creating a Microcontroller from Scratch
« Reply #7 on: September 24, 2011, 01:58:49 PM »
Thanks for the replies guys. I think i used 'from scratch' incorrectly. I definitely don't want to recreate each part literally from scratch, i'm not reinventing the wheel here :)

The main problem for me right now is that it still hasn't 'clicked' in my brain yet. Can i go out and purchase a kit with pretty much everything that i need, then kinda "rip out" the cpu and introduce an fpga that i manually program myself? Does that make any sense or does anyone have an idea?

Like i said, I want to use this for a school project, but i don't want to go and purchase everything already premade and then put it together in a week and that's that. I know that i should keep it simple and save myself the time, but i do want to at least reprogram a central part of the kit somehow but i don't have the knowledge to express myself properly or start somewhere. Any comments?
« Last Edit: September 25, 2011, 12:30:39 AM by createmc »

Offline Xyver

  • Robot Overlord
  • ****
  • Posts: 125
  • Helpful? 0
Re: Creating a Microcontroller from Scratch
« Reply #8 on: September 26, 2011, 02:04:45 PM »
Just throwing this out here, but you've probably seen it already...

http://www.societyofrobots.com/step_by_step_robot.shtml

To me, thats building a microcontroller from scratch without reinventing the wheel.

Offline createmcTopic starter

  • Beginner
  • *
  • Posts: 5
  • Helpful? 0
Re: Creating a Microcontroller from Scratch
« Reply #9 on: September 26, 2011, 04:27:56 PM »
:) yep i read that, i quickly skimmed over it again and remembered a few things. thanks for bringing it back up.

i've decided to go with programming an fpga to do the things i want. it should be a good learning experience

 


Get Your Ad Here