go away spammer

Author Topic: Can I use an old CPU from a pc as a microcontroller?  (Read 9347 times)

0 Members and 1 Guest are viewing this topic.

Offline paul23Topic starter

  • Beginner
  • *
  • Posts: 6
  • Helpful? 0
Can I use an old CPU from a pc as a microcontroller?
« on: February 22, 2012, 09:26:25 PM »
From what I understand (very little), the only difference between a cpu and a microcontroller is that a microcontroller has additional hardware. Does this mean that I could use an old cpu from a computer as a microcontroller if I made some additions? I plan on using it to make a robot like the $50 one featured on this site.

I know that it would be cheap and easy to just buy a microcontroller but I thought it would be neat if I were able to make use of some old junk.

Offline newInRobotics

  • Supreme Robot
  • *****
  • Posts: 1,015
  • Helpful? 48
  • N.I.R.
Re: Can I use an old CPU from a pc as a microcontroller?
« Reply #1 on: February 23, 2012, 02:49:53 AM »
From what I understand (very little), the only difference between a cpu and a microcontroller is that a microcontroller has additional hardware. Does this mean that I could use an old cpu from a computer as a microcontroller if I made some additions?
What additions exactly are You talking about?  ;D
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian W

Offline paul23Topic starter

  • Beginner
  • *
  • Posts: 6
  • Helpful? 0
Re: Can I use an old CPU from a pc as a microcontroller?
« Reply #2 on: February 23, 2012, 11:42:10 AM »
(http://wiki.answers.com/Q/What_is_the_difference_between_a_microprocessor_and_a_microcontroller)

a microcontroller combines onto the same microchip :

The CPU core (microprocessor)
Memory (both ROM and RAM)
Some parallel digital I/O
Also, a microcontroller is part of an embedded system, which is essentially the whole circuit board. Look up "embedded system" on Wikipedia.
The difference is that microcontroller incorporates features of microprocessor(CPU,ALU,Registers)along with the presence of added features like presence of RAM,ROM,I\O ports,counter etc.Here microcontroller control the operation of machine using fixed programme stored in Rom that doesn't change with lifetime.

So I think I'd need to add ROM some how and I/O assuming the CPU doesn't already have those things. Mind you I know squat about computers so if any of this sounds ad hoc feel free to correct me.

Offline joe61

  • Supreme Robot
  • *****
  • Posts: 417
  • Helpful? 16
Re: Can I use an old CPU from a pc as a microcontroller?
« Reply #3 on: February 23, 2012, 05:08:55 PM »
From what I understand (very little), the only difference between a cpu and a microcontroller is that a microcontroller has additional hardware.
No, there are a lot more differences. The assumption is incorrect also in that a cpu (if, by that, you mean a typical 32-bit CPU) is more complicated and requires more external circuitry and components as well.

Quote
Does this mean that I could use an old cpu from a computer as a microcontroller if I made some additions? I plan on using it to make a robot like the $50 one featured on this site.

I know that it would be cheap and easy to just buy a microcontroller but I thought it would be neat if I were able to make use of some old junk.

Yeah, that would be neet, but it sounds like it's a little beyond you right now. Take a look at the data sheet for whatever CPU you're thinking about (you should be able to get it from the manufacture's web site), and I think you'll see a whole bunch more things to deal with, that will go way beyond $50.

If you're just starting out try an arduino like board, or if you don't mind using BASIC, a PicAXE. I've been playing around with a couple of them and they're pretty nice too. You can get a prototype board from Sparkfun for around $30 US.

Good luck whatever you do.

Joe

Edit: Also of course, you could just build the $50 robot as described in the tutorial :-)

« Last Edit: February 23, 2012, 05:11:36 PM by joe61 »

Offline paul23Topic starter

  • Beginner
  • *
  • Posts: 6
  • Helpful? 0
Re: Can I use an old CPU from a pc as a microcontroller?
« Reply #4 on: February 23, 2012, 05:31:11 PM »
Thanks for the reply! I did some more research and it's all way over my head. It looks like I will just be buying one for now. I was thinking I would just skip the arduino and do it as described in the tutorial as you said.

Offline newInRobotics

  • Supreme Robot
  • *****
  • Posts: 1,015
  • Helpful? 48
  • N.I.R.
Re: Can I use an old CPU from a pc as a microcontroller?
« Reply #5 on: February 24, 2012, 03:21:24 AM »
Thanks for the reply! I did some more research and it's all way over my head. It looks like I will just be buying one for now. I was thinking I would just skip the arduino and do it as described in the tutorial as you said.
Exactly my point  ;)
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian W

Offline paul23Topic starter

  • Beginner
  • *
  • Posts: 6
  • Helpful? 0
Re: Can I use an old CPU from a pc as a microcontroller?
« Reply #6 on: February 24, 2012, 01:10:38 PM »
Just out of curiosity, is it at least possible to use a cpu as a microcontroller, albeit difficult?

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Can I use an old CPU from a pc as a microcontroller?
« Reply #7 on: February 24, 2012, 03:03:43 PM »
Hi,

Just out of curiosity, is it at least possible to use a cpu as a microcontroller, albeit difficult?
There's a CPU embedded in a microcontroller, or to be more correct, a microcontroller is a microprocessor enhanced with peripheral circuits.

So, you cannot use a microprocessor as a microcontroller, but if you add the perpheral circuits it can be used the same way - no sane person would spend lots of time and money to replace a controller costing less than the fries you have with a hamburger.
(Unless, one needed the processing power of say a 3GHz quad core).
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 newInRobotics

  • Supreme Robot
  • *****
  • Posts: 1,015
  • Helpful? 48
  • N.I.R.
Re: Can I use an old CPU from a pc as a microcontroller?
« Reply #8 on: February 24, 2012, 04:25:18 PM »
Just out of curiosity, is it at least possible to use a cpu as a microcontroller, albeit difficult?
Well, yes, PC in essence is a large and powerfull microcontroller - or gigacontroller  ;D
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian W

Offline paul23Topic starter

  • Beginner
  • *
  • Posts: 6
  • Helpful? 0
Re: Can I use an old CPU from a pc as a microcontroller?
« Reply #9 on: February 25, 2012, 01:06:18 AM »
Hmm, that's interesting to know. What exactly is meant by peripheral circuits? Also, how would a microprocessor tell say a servo motor to move? Does the microprocessor in a CPU come with some kind of firmware pre-installed or does it pull that information from ROM stored elsewhere? I was under the impression that BIOS would detect the CPU, and then tell it what to do. In order to get the microprocessor to work as a microcontroller would one need to overwrite BIOS? Do commercial microcontrollers come with their own kind of BIOS? Also I'm assuming the CPU draws a lot more power than commercial microcontrollers and would need a bigger power source, could the CPU be throttled so that it was only using the power necessary to do the given tasks?

I hope you guys don't mind if I pick your brains... I have so many questions.

PS I have an old RCX microcontroller from the original lego mindstorms kit, could that be re-purposed for general robotics use?
« Last Edit: February 25, 2012, 01:30:28 AM by paul23 »

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Can I use an old CPU from a pc as a microcontroller?
« Reply #10 on: February 25, 2012, 05:03:29 AM »
What exactly is meant by peripheral circuits?
A circuit that resides in the periphery ;D


Also, how would a microprocessor tell say a servo motor to move?
Just like a controller, by toggling a pin, this pin will just be on a peripheral chip.


Does the microprocessor in a CPU come with some kind of firmware pre-installed or does it pull that information from ROM stored elsewhere?
Any micro, whether -controller or -processor contains micro code on a level that you don't see, but apart from that no, firmware is placed in ROM.


I was under the impression that BIOS would detect the CPU, and then tell it what to do. In order to get the microprocessor to work as a microcontroller would one need to overwrite BIOS?
BIOS is just a program in a ROM and run by the processor.
To make a board with a processor, all your programs must reside in ROM (or its equivalent, like flash RAM).
You don't need a BIOS for a robot controller board, the equivalent functions can reside in the main program.


Do commercial microcontrollers come with their own kind of BIOS?
BIOS = Basic Input Output System is an abstraction layer that takes care of some low level stuff. When you're working with a microcontroller, you do the low level stuff yourself.


Also I'm assuming the CPU draws a lot more power than commercial microcontrollers and would need a bigger power source, could the CPU be throttled so that it was only using the power necessary to do the given tasks?
It already is to some extent.


I hope you guys don't mind if I pick your brains... I have so many questions.
Actually, all of the above and whatever else you want to know about microprocessors is really beyond this board and should have triggered you into Googling the subject.


PS I have an old RCX microcontroller from the original lego mindstorms kit, could that be re-purposed for general robotics use?
Give it a try - what's the worst that could happen?
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 paul23Topic starter

  • Beginner
  • *
  • Posts: 6
  • Helpful? 0
Re: Can I use an old CPU from a pc as a microcontroller?
« Reply #11 on: February 25, 2012, 04:25:08 PM »
Again, thank you. I did try to google for these answers but they're never conveyed in a simple, easy to understand, yes or no answer. Your response was exactly what I was looking for. Very helpful.

 


Get Your Ad Here