Need help learning uC's - Page 1
Forum section: electronics / general

author: DaveHardy
author_rank: Regular Contributor
timestamp: July 24, 2011, 08:05:42 am
content: I'm interested in learning the ins and outs of uC's. I've got a pretty strong background in analog electronics related to amplification and musical applications. However, if you asked me what a bit was, I would tell you that it attaches to a power drill.Over the past year, I've been flirting with learning microprocessors, specifically the Z80 CPU. I thought that the Z80 would be a good place to start because it was basically the first in the evolutionary chain and, well, simpler for lack of a better word. After doing a little bit of research, I figured out that interfacing and support would be a big pain in the ass so I abandoned that idea.Next, I bought an Arduino Uno on the recommendation of a friend.. It seems rather limited and I got super pissed off when I inspected the unit and determined that the 5v rail didn't work the way it was supposed to (If I remember correctly, there was some kind of sense switch for outboard power that was a completely crappy design and didn't switch properly) so I stuffed it into a drawer somewhere and occasionally use it as a multi-channel function generator. My attitude is that if they can't even get a power sense switch right, the rest of the unit probably sucks too. Furthermore, a lot of info on the net says that I should lean C and Assembly, whatever assembly is. Also, I need to compile stuff for some reason?Recently, I found a few copies of a magazine called Circuit Cellar and was absolutely bombarded by all of the cool stuff available. They make these really awesome projects look simple and I think it would be a blast to have my toilet talk to my microwave. For the first time in a long time, it looks as though learning uC's might still be within my grasp without going to college. I'm hoping that maybe some of the vocabulary in Circuit Cellar will soak in or I'll get lucky and find a good place to start learning how to create intelligent designs. Some of the PIC prototype boards in Circuit Cellar look cool and that might be a good place to start?I'm assuming that uC's are a better place to start than the Z80 or 8051 nowdays because RAM, ROM, & Oscillator are all on the same chip? Does anybody have advice or book recommendations? Again, I need to learn the very basics like C, Fortran, Assembly, Compiler, etc.-Dave

author: Bloch
author_rank: Unknown
timestamp: July 24, 2011, 11:58:26 am
content: If it was mehttp://www.microchip.com/pickit2orhttp://www.microchip.com/pickit3Perfekt for a beginer.

author: DaveHardy
author_rank: Regular Contributor
timestamp: July 24, 2011, 06:07:44 pm
content: Thanks!

author: bruce273
author_rank: Contributor
timestamp: July 25, 2011, 09:32:42 pm
content: Might be a bit late but if you like the idea of an older microcontroler you could have a go with the 8051. Theres plenty of support and they are supported by SDCC if you would like to use C.I started on the PIC aswell and while the support and IDEs are excelent although I found the interrupts to be a bit frustrating but there are slight annoyances to most ucs so I wouldn't worry too much once you've learn one the rest become alot easier.Heres a link to a modern 8051 processor very good specs for a 8 bit microcontrollerhttp://www.silabs.com/products/mcu/Pages/C8051F005DK.aspx

author: bruce273
author_rank: Contributor
timestamp: July 25, 2011, 09:42:02 pm
content: And appologies for not reading your post fully. A microcontroller contains a core, examples of this are the Z80 and 8051. In the 80's the Z80s and motorolas had the RAM and ROM and other peripherals on external IC's as you said. Fortunately now there are many 8051 based uCs such as the one in my previous post, and I think there are Z80s in existence, which have all the rom ram etc on board the uC. The link belows for a website which discusses the 8051 and provides a good overview of a microcontroller.http://www.8052.com/tut8051The pics certainly a good sugestion as the datasheets contain brilliant information on how to program the chip. With the pics its easiest to start with the 16f series so the uC will have a number like pic16f84.

author: Bloch
author_rank: Unknown
timestamp: July 26, 2011, 05:27:19 am
content: Quote from: bruce273 on July 25, 2011, 09:42:02 pmWhy not use the one that is in the Pickit2 ? PIC16F690The only con is 20 pin vs 18 pin.Ram 256 vs 68 bytes16-bit timers10bit ADCComparatorsCap TouchOn RS webpage PIC16F690 it is half price !12 ready made Pk2 Starter Kit Lessonshttp://ww1.microchip.com/downloads/en/DeviceDoc/Pk2-Starter%20Kit%20Lessons%20(b).zipThe only problem with the PK2 vs PK3 is that it have no debug. But the PK3 is a SMD and i dont like that personally.

author: BBQdChips
author_rank: Contributor
timestamp: August 15, 2011, 06:43:17 pm
content: Quote from: Bloch on July 26, 2011, 05:27:19 amRegardless of what uC you choose, for learning I'd suggest staying with a rather current part. You don't need a super powerful part, but newer is typically better. As to the pin counts, you can get any pin count, package, internal architecture you could ever want. Again, regardless of vendor.Grab a breadboard from someone like Jameco or MPJA, get a power supply, a entry level dev tool from whoever you're getting the micro. That last sentence was important. Get it from the chip manufacturer. For low cost and support, probably Pic and Atmel are going to suit best. Let your 3 year old decide which, it matters that much. Any of the new parts will have internal oscillator, Flash, EEprom, and ram, along with so many i/o choices it'll fry your brain. Even an 8bit 18pin Pic or AVR will work for 90% of all hobbyist projects.Things like a Basic Stamp and BOE will have a Pic on board, but they run only Basic. These are really useful for super basic quick learning projects and I've give a few to kids in the family wanting to learn. But, they are not for any serious work cause they're too slow for a lot of things. And, they're $75 vs $3 for the low end uC's from Atmel/Mchp.The assembly instruction sets for both 8 bit systems are so easy, it's amazing. Don't start thinking about some 8088 instruction set and get something like that in your head. It's not even close. Within a few hours, a non-programmer with any brains at all will know the entire instruction set. What's a Pic16 got, 37 instructions?The memory models for any uC will be a bit confusing at first,( to a newcomer) but once you get a grasp on that, its' a breeze. Then too, most early projects won't use a second page, so you never end up caring about that anyway.Grab a pic or avr, plug in 5v, and go to town.

author: IanB
author_rank: Super Contributor
timestamp: August 15, 2011, 08:07:06 pm
content: It sounds like you are not familiar with computer programming at all, in which case microcontrollers might not be the best place to start. Opinions vary about the best environment to learn about computers, whether it should be the PC on your desk or a microcontroller "close to the metal". However, I think the PC on your desk would be he best place to begin. Mainly because the PC is a much friendlier environment. It has a huge number of nice programming tools and environments to choose from, it insulates you from your mistakes (if your program crashes you just get a message on the screen, it doesn't take your whole computer down), debugging programs while you are learning is much easier, and you are less constrained by hardware and memory size limits. Your desktop PC is where you can learn about compilers, assemblers and general programming concepts. Later you can move on to microcontrollers and learn about I/O, interrupts, ADCs and so on.Programming microcontrollers is slightly different as here you need to design your code around interrupts and be sensitive to the time it takes to execute and the amount of memory it uses. Debugging this code and getting it to work right is a stage harder than desktop programming. It is true you can use emulators on your desktop to try things out, but I'm still not sure it is the best place to begin.You might also want to give the Arduino a second look. It is designed to make microcontrollers accessible and many people have done cool things with it.