8 ms·
Chip Hall of Fame: Atmel ATmega8
- retSava 9y agoIt's interesting that not only the later platform - the Arduino, which started out with AVR and aimed at simplifying programming the devices - but the AVR chip itself started out with the goal of simplifying the process of using it (programming, tools, ...).
- filomeno 9y agoI used to do -and still do- a lot of work with AVRs for hobby projects. I find them an awesome piece of technology, allowing you to start working on something with only a breadboard and a couple of wires, in contrast with ARM based ucs where the basic setup is not simple at all. However, in the last years, following the Atmel acquisition by Microchip, the price rise on suppliers like Mouser started to make them look unattractive. But I still prefer the 8 bits ;-)
- retSava 9y agoAgree, for learning and that feeling of knowing more or less exactly what is going on, uc's like AVR, STM8, or MSP430 are hard to beat. It's comparatively simple to do things, and almost everything is just a couple of register settings away.
- lmilcin 9y agoI agree, but I would say that for personal projects, I find the difference in price quite irrelevant. What's typically important is how the part fits the application. For example, recently I found that the fumes extractor in the kitchen of the flat I rented failed. The PIC on board got tazed with 10V from a broken PSU. I fixed the PSU (replaced cap and regulator, added TVS diode for protection), but the programming on the PIC was lost. So I found that there is one AVR with matching pinout that I could use in place of the PIC. Thanks to AVRs being so easy to program I could program and test it in an hour or so, and even added some extra features. I do other projects where I need more power (Cortex M3/M4), but AVR is hard to beat where it comes to how quickly you can get simple things going.
- mschuster91 9y agoOut of curiosity: what features did that fumes extractor have?! Mine has just a plain old switch to control the fan in 2 speed modes, and another switch to control the light...
- retSava 9y agoI guess the microcontroller controls a fan using PWM with a duty cycle depending on the mode. Even if you could do it with a 555, it's easier to just do it with a microcontroller. It also makes it easier to make changes up until production without changing hardware.
- lmilcin 9y agoNo, it controlled it through a Darlington array controlling an array of mechanical relays. The fan has 3 220V AC inputs and selecting the combination of inputs changes the fan speed. I haven't looked inside the fan because it worked correctly. I also didn't want to test it to see how it works so I figured it out by analyzing the PCB. Actually that was quite good idea because the relays seem to be connected in such a way as to only allow valid combination to be sent to the fan even in case of invalid input from the microcontroller. I suspect bad things would happen if I sent incorrect inputs to the fan -- looking at how crappy the board was but at the same time that the person put effort into placing the relays to explicitly disallow invalid combinations of power lines to the fan.
- lmilcin 9y ago3 speed modes, light, and some diode indicators. Previously there would be one switch to control light, 3 switches to control speed modes and extra switch that I don't exactly know what it did -- probably it controlled some kind of timer. The 3 switches that controlled modes were 0/1 (change speed to 1 if anything else than 1, turn off if it is currently 1), and 2 and 3 which would turn on 2 and 3 speed mode. I have added a 500ms long press to 0/1 switch which means that whatever is happening it turns off both light and fan at the same time. You don't have to turn off light and fan separately and you don't have to press 0/1 twice to reduce the speed to 1 and then to turn it off. As it was sometimes difficult to figure out which speed it was on without looking at the indicators (on the side and not on the front of the extractor) you never knew you had to press it once or twice which was quite irritating.
- crankylinuxuser 9y agoWell, it really depends on what area of arm you get into. I prefer the Maple Mini style, using STM32F103's. 72MHz is a good amount of speed, and has more than enough IO pins and interrupts. You can source predone boards for Maple Mini at $4/each either on eBay or aliexpress. To be honest, I can't even source the individual parts and 2(4?) layer boards for 4$/each. No bloody clue how the Chinese do. But as long as they do, they get my business and i'll keep using them in my build. Maybe later on, I'll unfold the STM32f103 into its constituent parts and mount them on the board directly.. But still, damn the microUSB connectors are pricy.
- deleted 9y ago[deleted]
- gh02t 9y agoMicro USB connectors can be had for cheap on Aliexpress if you don't mind waiting for shipping, I usually buy from this guy at slightly more than a penny each. https://www.aliexpress.com/item/10pcs-5pin-Female-Micro-USB-Connector-SMD-4-Fixed-feet-Widely-used-in-tablet-phones-and/32671445317.html https://www.aliexpress.com/item/10pcs-5pin-Female-Micro-USB-... Also don't forget what is IMO the main advantage of STM32, which is the ST-Link programmer. Even the official ones are cheap and the clone ones are like $2, but you get a programmer that gives you real debugging. You can also reflash them with the Black Magic firmware and have a self-hosted GDB debug server for generic ARM. Regarding directly breaking out the STM32f103, this gets at my main problem with the STM32F (and most 32 bit micros AFAIK), namely that it only comes in LQFP, which is pretty irritating to solder by hand without using an oven. There are a few TSSOP ARM micros which I don't mind soldering but it's a hassle to make a one-off quick project if I have to use LQFP or even worse QFN.
- crankylinuxuser 9y agoHey, thanks for the heads up about the connectors. I was sticking primarily with Digikey and Mouser. Their prices certainly arent in the "pocket change" area per connector. Looks like I'll have to find a component dealer and just buy a bunch of stock components from them. None too happy about 3-5 weeks leadtime, but damn they're a magnitude cheaper. Oh, and I do hand SMT rework (thanks to my 20/15 eyesight). Doing some of the smaller packages isn't terrible. And Ive found that I can reliably do BGA in a converted toaster oven - as long as I flux correctly and do about 10c over recommended ball solder melt temp. It's a wee finicky, but ive only had 2 fail out of a dozen (I was too impatient and removed it hot - big mistake).
- audunw 9y agoCheck out BBC micro:bit. It uses an ARM based MCU and is really easy to use. Don't even need a programmer, just plug it in with USB and drop in a hex file. The nRF51 (used by micro:bit) and nRF52 chips are in general very nice to use. I'm really looking forward to more breakout and development boards coming out for nRF52840 which is just a great chip that can do just about everything (Bluetooth and Thread, at the same time even! Also USB! And PDM microphone input!) Incidentally, these are also designed in Norway, by Nordic Semiconductors. A lot of the engineers from Atmel has jumped over to Nordic recently. Disclaimer: I'm in a position where I'm obviously extremely biased (without being specific), but I'm also a hobbyist and I sincerely enjoy using these chips for smaller projects. Even if I don't use the radio.. they're just good microcontrollers.
- dfox 9y agoFor me AVRs stopped to be interesting around the time when Arduino gained popularity, which also caused significant price rise and also availability problems. In 2010 for one-off art project (lot's of MCUs on RS485 controlling LEDs and pushbuttons) we had to switch from ATmega8 to AT89C2051 because it was the only MCU that we could source in time for the event for reasonable price and we had (semi-)reliable programmer capable of programming it (notice the 89C, not 89S). After that I pretty much switched to MSP430 for such things.
- iuguy 9y agoI built a self-build ATTiny85-based dev board[1] with a bunch of tutorial projects[2] designed for time poor people, most recently an EMF detector[3] for Halloween. Unless you include the LPC810, it's pretty much impossible to do anything similar on ARM. A lot of people seem to think everything needs at least a Cortex-M0 but in reality, an AVR or PIC is more than enough for most projects. There's also a lot more accessibility with through hole projects. Sure it's larger and more expensive than buying a pre-built board, but for most beginners through hole is way more accessible than surface mount. [1] - https://rawhex.com/ https://rawhex.com/ [2] - https://docs.hidiot.com/ https://docs.hidiot.com/ [3] - https://rawhex.com/blogs/news/ghost-hunting-with-the-hidiot https://rawhex.com/blogs/news/ghost-hunting-with-the-hidiot
- boznz 9y agoBeen using the chip for a while and the current ATMega328PB variant is a better chip, dual UART and more IO, some people say they had XTAL issues but I have not come across them and also the internal 8Mhz Osc is accurate enough for reliable 9600 baud UART between 0 and 40 degrees. My point is it is also the cheapest it has ever been. I think the price rise was people stocking up after the buyout but I currently pay $1.02 ea for Qty 25 and there is a shit-tonne of stock. My Annoyance is that to get more RAM/FLASH you tripple the price which is ridiculous. I also use PIC18K chips which are a similar price at 32KB/2KB but only cost $0.20 more to double the FLASH/RAM/CLOCK and so are much better value. Clock for clock the AVR is a more efficient chip so Microchip have no real excuse not to do the decent thing and give us a 64K/4K version of it without the stupid price hike. 32 bit is so overkill for most applications but you just get so much more for your money with them.
- thowarray 9y agoGreat microcontroller, shitty article.
- ajford 9y agoI concur. I was expecting way more that a paltry few paragraphs barely talking about the chip's impact.
- pietrofmaggi 9y agoWikipedia page for AVR[1] is much better! And Atmel released in 2008 a video with the two co-creators of the chip describing its history[2]. [1] https://en.wikipedia.org/wiki/Atmel_AVR https://en.wikipedia.org/wiki/Atmel_AVR [2] https://www.youtube.com/watch?v=HrydNwAxbcY https://www.youtube.com/watch?v=HrydNwAxbcY
- garaetjjte 9y agoAVRs are great for small embedded applications (I think only 8-bit architecture with good compiler support), but I don't get why Arduino is so popular. Poor "IDE" with some horrible C++ preprocessor, heavy libraries abstracting important hardware details, and no onboard debugger.
- hugs 9y agoDon't underestimate the power of plug-and-play ease of use and the inclusion of dozens of ready-to-go example programs. And good documentation. And a welcoming, friendly, active user community. And marketing to people who want to make something light up or move, and don't (yet) have a need for an onboard debugger.
- dekhn 9y agobecause the same code runs on 5+ different architectures without porting. That's really more about WiringPi and the libraries with #ifdefs, but the value is there.
- sokoloff 9y agoThe "problem" that hobbyists had, pre-Arduino, was not that they couldn't do cycle-accurate interactions with base hardware, but rather that they couldn't get the moral equivalent of "hello world" running in any reasonable attention span. (In micros, this is an LED blinking under program control.) Arduino solved the "easy on ramp" problem; that was the problem that needed solving. This allowed a community to spring up (because now everyone had the same hardware [initially]) and so sharing was possible/easy in a way that bare AVRs on random breadboards didn't support.
- lmilcin 9y agoBecause of the time an knowledge it takes to blink a LED. When you are complete newb, you can't diagnose and fix problems. By definition you can't yet understand how things work which is prerequisite to debugging. This first step is then most critical -- if it doesn't work immediately many people will be just put off completely. If it works, people can tinker with it, see result, learn, etc. They can't learn in the absence of feedback. Newbs will not be able to judge if IDE is "poor" or C++ preprocessor is "horrible". What's most important is that it works right away.
- ceocoder 9y agoI have fond memories working on Atmel chips, started with 89C52 and graduated to ATmega8 later on. It was such a fun experience building "medical devices" with these chips. First successful project was a commoditized Vibration Perception Threshold meter, ones made by bigger companies used piezoelectric crystals costing upwards of 10s of thousands of rupees - I built one using relays and 89C52 to create a square wave of varying frequency to change vibration frequency. My then girlfriend (now wife :))'s project was EKG wave generator, essentially a device that simulated signals out of a human body that one can use to test EKG devices. Just the mere act of programming one was amazing, you'd have to use SDCC[2] (small device c compiler) to convert your C code to assembly that 89C92 understood, in process I built my own chip burner and use some combination of PonyProg[3] to burn it. We went through many chips due to mis-configured serial port connectors but it was so worth it. [1] https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2992204/ https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2992204/ [2] http://sdcc.sourceforge.net/ http://sdcc.sourceforge.net/ [3] http://www.lancos.com/prog.html http://www.lancos.com/prog.html p.s. I air-quoted medical devices to make it abundantly clear that whatever we made was never ever ever used to diagnose any patients.
- jondubois 9y agoI remember programming the Atmel ATmega8-16PU at university in C with AVR Studio (that was before Raspberry PI). We had a team project where we had to build a Morse code receiver and decoder from scratch (circuit board and everything); our device had to intercept Morse code from radio waves on a certain frequency and output the message on a standard computer in human-readable ASCII text via a serial port. My team was one of the best and our device was able to intercept and decode the message. It's amazing what 3 people with complimentary skill sets can do from scratch. It's a really good chip too I have to say.
- elijahparker 9y agoIt was the original AT90S8515 that really grabbed my interest and launched me into embedded programming (when I was about 15 years old). Prior to that I was using the Basic Stamp, with it's incredibly limited and slow instruction set (yet a ridiculously high price). Then I switched to seemingly impressive BasicX with a far more powerful instruction set, though still Basic. That's when I realized the BasicX was really just an AT90S8515 with an interpreter so I learned C and programmed it directly at just a few dollars per chip -- it changed everything for me! Not only did I have the most powerful MCU I had ever used, but it was also cheap enough to leave in projects.