## Implementing microcontrollers (AT89C51-24PC)

I'm planning on learning how to use microcontrollers (ATmega series) so that I can use the skill for various other projects.
I already know how to use arduino (which use the ATmega series of microcontrollers) and I feel as though this will only be an extension, since the coding will be the same.
What is required circuitry wise in order to run this? I understand I likely need to have a 5V regulator and peripherals in order to power the logic, but what else?
Do I need to add some sort of flash memory? What about SRAM?
Is programming as easy as hooking up the right pins to a USB cord and flashing to the chip (using which program, will the standard arduino program work for this?).
 PhysOrg.com engineering news on PhysOrg.com >> Multiview 3-D photography made simple>> Giant 3-D printed bugs shed light on insect anatomy>> A microphone that listens with light
 Recognitions: Science Advisor There is a big difference between programming an Arduino in a C/C+ language and programming an Atmega in machine code. So, if you want the convenience of the high level language, you should stick to the Arduino. I often use Picaxe chips because they can be placed in normal circuits like any other IC, perhaps unlike the Arduino which requires a relatively expensive circuit module. Picaxe chips start at about $3.  What do you mean by machine code? I'd like to learn and be able to expand my horizons, withing reasonable difficulty. I don't like the picaxe flow chart system, it's too easy. Recognitions: Science Advisor ## Implementing microcontrollers (AT89C51-24PC) Actually I should have said Assembler code. Here is an introduction to Assembler for an Atmega: http://www.avr-asm-download.de/beginner_en.pdf Don't knock Picaxe, at least on the grounds of being too easy. Easy is good. You don't have to use the "kiddy" flow charts. Real programming is done in a type of Basic which is heavily laced with I/O commands. It can be challenging enough if you try to get serious about programming. I have a friend who wanted to read a pot voltage and convert the result to Pulse Width Modulation to control a motor. A hardware solution to this was going to be very complex while a Picaxe did it in about 4 lines of code. Have a look here: http://www.picaxe.com/ http://www.picaxe.com/Getting-Started/PICAXE-Manuals  Well I am still 16 so maybe I should go for the kiddy programming :p The main reason I'm moving away from arduino is because I want more of a challenge, as well as the ability to expand by using different micros. I guess picaxe it is, it seems both languages are reasonably similar so I won't be losing anything. Thanks for the help.  Recognitions: Science Advisor Each Picaxe chip can do a large number of useful tricks and it is worth knowing about them so you can use them if you need to. There are "programming kits" available but these tend to be overpriced and you can make a programming cable yourself for a few dollars or less if you have an old serial mouse you don't want. I like the freedom of buying a cheap powerful chip I can just plug into a socket and use instead of having to buy a module (like Arduino or Stamp) which costs a lot more and is much more bulky. If you want to get started, go for a larger Picaxe chip like the Picaxe 20X2. The 20 means it has 20 pins but it looks like any other DIP chip.  I was planning on going with the 28 something one (forget the name). What do I need to make the programming cable so that I can get it on the same order? Recognitions: Science Advisor  Quote by Packocrayons I was planning on going with the 28 something one (forget the name). What do I need to make the programming cable so that I can get it on the same order? There are several 28 pin Picaxes and some of them are nearly 10 years old now. The important bit is the end part of the type number. Look for an X or an M. These are more recent. They have more memory and can operate at faster speeds than the older ones. Download the manuals from the link above. http://www.picaxe.com/Getting-Started/PICAXE-Manuals The first one gives the programming cable details. It is just two resistors and a serial port plug. It also gives the pinouts of the various chips.  Okay so I have it (I actually ended up with 2 20M2's) and I'd like to start programming as soon as possible. I'm planning on making my own cable from a USB port. What is the pinout and/or wire color of a standard USB port on a computer? I don't have the right connectors on my laptop as depicted in the manual, and it never says anything about USB ports as far as I know.  Recognitions: Science Advisor If you don't have a serial port on your laptop, you will need a USB to serial adapter. You can't directly connect the USB port to the Picaxe input. However, not all such adapters will work for programming a Picaxe chip. You need to get one which is assured to work for Picaxe programming. You could have a look on the Picaxe Forum to get a type of adapter that works OK. This comes up as a topic quite often and you should find one easily. Ebay has them for$1 plus postage, but they may not work. Alternatively, you can get a USB cable from Rev-Ed in England. It is type AXE027 and sells for about 10 pounds (British). http://www.picaxe.com/Hardware/Cable...ownload-Cable/ Other distributors sell these too. Just about any old PC is OK for this job so you could consider using an older computer just for programming. Even very old laptops had a serial port on them.
 Alright, I guess I'll have to pull out the dinosaur and use it. It's only 13, it can handle it :p. What about building the adapter? I do have one built for programming brushless motor controllers, I'm assuming it'll be different?
 Recognitions: Science Advisor The programming board for a Picaxe is so simple, it is easy to just include the couple of resistors on each project board. You can buy programming boards, but they tend to be expensive. Putting a socket on a bit of circuit board with pre-etched tracks is pretty easy and there are lots of such boards available. If you can find it, this type would be OK: You may have an old serial mouse you don't want any more. Like the old ball type. You can use the cable from that. Just trace the wires with a multimeter on "ohms". Using a serial port is very simple and avoids the problems some people seem to have with USB ports, so it is good to, at least, start with a serial port.
 I'll crank out an old computer then and start with the serial port. Once I get it working and want to be able to flash more often I'll start working on a USB to serial.
 Recognitions: Science Advisor Yes, that would be a good choice. You could just leave it set up while you test the various commands from the Picaxe manual. You need all three manuals and you can download them from here when you download the programming editor: http://www.picaxe.com/Software I suggest you print out the pinout diagram for the 20M so that you can refer to it easily. A useful setup would have a couple of LEDs (with series resistors) a switch, a pot and (because the 20 M can produce music) a sound transducer. This would let you test various input and output commands. You will find these very well documented in the second manual with liberal use of examples to explain the command structures. This is a very powerful chip and it should keep you amused for a while.
 I plan on being very amused. Maybe next I'll build a little ipod with flash memory with an 08M2. I'll make a book with the cover page being the pinouts and print out the manual on paper for quick reference.
 Recognitions: Science Advisor OK. Maybe try to turn a LED on and off before you make an iPod? The Programming Editor has a pull down syntax help thing which is useful when you want a quick clue like where to put the brackets, etc. But a printed version would be nice, if a bit bulky.
 Yeah I'll start slow. I'll learn quickly once I get started because of my experience with arduino. Old laptop is not working, so I'm going to have to jump right into the usb to serial. Wheres the best place to get started?

 Similar discussions for: Implementing microcontrollers (AT89C51-24PC) Thread Forum Replies Engineering, Comp Sci, & Technology Homework 3 Electrical Engineering 4 Electrical Engineering 2 Electrical Engineering 8