Re:Chip Hall of Fame: Atmel ATmega8
by ceocoder on Tuesday October 31, 2017 @12:15PM
(#15594332)
I 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.
Re:Chip Hall of Fame: Atmel ATmega8
by jondubois on Tuesday October 31, 2017 @03:15PM
(#15595772)
I 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.
Re:Chip Hall of Fame: Atmel ATmega8
by filomeno on Tuesday October 31, 2017 @07:29AM
(#15592412)
I 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 ;-)
Re:Chip Hall of Fame: Atmel ATmega8
by lmilcin on Tuesday October 31, 2017 @07:51AM
(#15592512)
I 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.
Re:Chip Hall of Fame: Atmel ATmega8
by lmilcin on Tuesday October 31, 2017 @08:56AM
(#15592843)
That's what I would usually do.
I have almost 2 decades of interesting experience as a software dev. I am now learning hardware design so that I can create niche hardware products and use my dev experience as an advantage.
I decided to fix it only because I am of the opinion that if I want to act professional in any area I can't shy away from projects like that.
If I calculated the time I spent on this I could have easily bought few of these, new, for the time I was not spending on billable hours.
Re:Chip Hall of Fame: Atmel ATmega8
by crankylinuxuser on Tuesday October 31, 2017 @10:11AM
(#15593333)
It's awesome that you did that :)
I know it's one of those compliance issues, but it might be a good idea to have an electrician come out. Last thing a renter wants to see, is bodged together "fire badness".
I'm not saying yours is by any means! But sane-ness and law hardly go together :/
Re:Chip Hall of Fame: Atmel ATmega8
by lmilcin on Tuesday October 31, 2017 @10:33AM
(#15593506)
You would be correct (compliance, responsibility, etc.) but I also know for a fact that the guy guys (I won't call them electricians) that would come to fix stuff would not do better job.
My kitchen was completely miswired since the building was built. The ground exchanged with neutral line. I tested the lines and put it back together as it should. There were many complaints from previous tenants but nobody was able to figure out and fix it -- seems so basic but nobody could do it.
Re:Chip Hall of Fame: Atmel ATmega8
by crankylinuxuser on Tuesday October 31, 2017 @10:55AM
(#15593658)
If I wouldn't know better, it sounds like we live at the same place!
I get you - that your work is likely higher quality, and you could claim ignorance if anyone did have a complaint.
But yeah, on Sunday, I redid some of our outlets and switches. We live in a trailer, and some of the switches were getting intermittent, and some outlets were loose to the point of turning off stuff if they jiggled. But.. I did find out that 1 outlet in the bathroom, the hallway lights, and 1 wall of the living room were on 1 gang... (sigh). I have my work cut out for me if I actually want to do it right.
Re:Chip Hall of Fame: Atmel ATmega8
by lmilcin on Wednesday November 01, 2017 @06:31AM
(#15600003)
I asked myself the same thing.
I think its best to start by utilizing your software experience as much as possible and having just enough hardware to get by. Also don't try to learn/solve too many problems at the same time.
Most of my projects is relatively little/simple hardware + lots of features in software.
For example -- one of my complicated projects requires very precise temperature measurement, precise regulation of mains AC power to 1kW heating element, dealing with PCB environment being very hot and humid (up to 80C), etc.
I am splitting the effort of learning all of those things, and first thing I am building is a precise, standalone thermometer. I will build some software features (data acquisition to SD card, USB, etc.) which is relatively simple compared to getting precise temperature measurement.
Then I will maybe build standalone power regulator that I could have many uses for especially when connected to the thermometer (for example control my oven to do reflow!).
Once I know the building blocks I will attempt building the complex project I have in mind.
Re:Chip Hall of Fame: Atmel ATmega8
by mschuster91 on Tuesday October 31, 2017 @08:05AM
(#15592579)
Out 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...
Re:Chip Hall of Fame: Atmel ATmega8
by lmilcin on Tuesday October 31, 2017 @08:16AM
(#15592631)
3 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.
Re:Chip Hall of Fame: Atmel ATmega8
by nerfhammer on Tuesday October 31, 2017 @01:50PM
(#15595071)
now, add a motion sensor so the light comes on when you stand near it and a smoke sensor so that it turns on automatically when you start cooking and stops automatically when all the smoke is clear.
Re:Chip Hall of Fame: Atmel ATmega8
by retSava on Tuesday October 31, 2017 @08:10AM
(#15592606)
I 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.
Re:Chip Hall of Fame: Atmel ATmega8
by lmilcin on Tuesday October 31, 2017 @08:21AM
(#15592656)
No, 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.
Re:Chip Hall of Fame: Atmel ATmega8
by forkandwait on Tuesday October 31, 2017 @05:50PM
(#15596905)
Is there a hacking genre in which one replaces the "brain" (e.g. the microcontroller) and the "neurosystem" (e.g. the wires running to relays controlling power) in already extant machinery? Like this fan? I would love to read about that. Maybe help the right to repair.
Re:Chip Hall of Fame: Atmel ATmega8
by lmilcin on Tuesday October 31, 2017 @06:51PM
(#15597338)
Not sure about replacing. My current project is to design completely new electronics for Rancilio Silvia espresso machine. I know this kind of modding is popular with many people buying a machine with modding already in mind.
Re:Chip Hall of Fame: Atmel ATmega8
by filomeno on Tuesday October 31, 2017 @09:31AM
(#15593071)
> I agree, but I would say that for personal projects, I find the difference in price quite irrelevant
Yes, of course, but it just doesn't look good when the price almost doubled in twelve months, specially when you have better and more powerful micros like the STM32 for less money.
Re:Chip Hall of Fame: Atmel ATmega8
by filomeno on Tuesday October 31, 2017 @11:03AM
(#15593729)
Sure, with "better" I was talking only about the features. I still prefer the AVRs for the ease of use, but they were as easy to use as today when the price was half it is now :)
Re:Chip Hall of Fame: Atmel ATmega8
by lmilcin on Tuesday October 31, 2017 @11:19AM
(#15593848)
So what is the price of the chip? If you are hobbyist, your main investment isn't going to be chips. Here in Poland, I can buy 5 ATMEGA 328Ps from Mouser for the price of single cinema ticket.
Any investment in time or tools is orders of magnitude more than prices of these parts.
Re:Chip Hall of Fame: Atmel ATmega8
by lmilcin on Tuesday October 31, 2017 @08:34AM
(#15592724)
Most of the time when I go for AVR it is because ease of use and if I need more from MCU I go for Cortex-M because they are dirt cheap and very powerful and you can always find a part that does what you need.
For me there just isn't enough middle ground between 8-bit AVRs and ARM Cortex that would justify learning another platform.
I might be biased, as I learned starting with AVRs and then took to Cortex-M3/M4 when my projects outgrew 8-bit. If I started with PIC that would probably be PIC/Cortex-M, but AVR is so much easier on a newb like I was few years ago.
Re:Chip Hall of Fame: Atmel ATmega8
by vvanders on Tuesday October 31, 2017 @10:17AM
(#15593388)
Yeah, for me I love the AVRs for small things but when I step up to a Cortex I love Cypress' PSoC. You get a mini CPLD and Arm m0/m3 on the same bus which lets you do all sorts of clever things.
Re:Chip Hall of Fame: Atmel ATmega8
by vvanders on Tuesday October 31, 2017 @02:27PM
(#15595387)
Yes! They're incredible little chips.
Want 8, 2 bit timers? Sure thing! One large 32bit timer? Done!
Having a CPLD to drive your peripherals so that you can reconfigure them is a brilliant idea. The fact that you can drop down to VHDL is an awesome bonus. They've also got some small reconfigurable op-amps built in as well that lets do you really clever things while sleeping.
Re:Chip Hall of Fame: Atmel ATmega8
by audunw on Tuesday October 31, 2017 @10:22AM
(#15593422)
Check 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.
Re:Chip Hall of Fame: Atmel ATmega8
by crankylinuxuser on Tuesday October 31, 2017 @10:07AM
(#15593301)
Well, 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.
Re:Chip Hall of Fame: Atmel ATmega8
by gh02t on Tuesday October 31, 2017 @11:07AM
(#15593751)
Micro 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.
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.
Re:Chip Hall of Fame: Atmel ATmega8
by crankylinuxuser on Tuesday October 31, 2017 @11:14AM
(#15593811)
Hey, 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).
Re:Chip Hall of Fame: Atmel ATmega8
by boznz on Tuesday October 31, 2017 @02:45PM
(#15595533)
Been 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.
Re:Chip Hall of Fame: Atmel ATmega8
by _b8r0 on Tuesday October 31, 2017 @01:26PM
(#15594889)
I 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.
Re:Chip Hall of Fame: Atmel ATmega8
by dfox on Tuesday October 31, 2017 @10:53AM
(#15593644)
For 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.
Re:Chip Hall of Fame: Atmel ATmega8
by retSava on Tuesday October 31, 2017 @07:34AM
(#15592432)
Agree, 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.
Re:Chip Hall of Fame: Atmel ATmega8
by garaetjjte on Tuesday October 31, 2017 @08:54AM
(#15592833)
AVRs 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.
Re:Chip Hall of Fame: Atmel ATmega8
by ajford on Tuesday October 31, 2017 @09:30AM
(#15593058)
Because for the average user, the features and power of a "Good" IDE are at best a nuisance and at worst a barrier to entry.
I've tried using some, such as a brief stint with Atmel Studio some years ago, Eclipse, and a couple others I can hardly remember. My biggest complaint was how tedious it was to start a project. They start asking you questions that a hobbyist isn't going to have enough background to answer.
Arduino takes those and hides them. Yeah, it means you might have less flexibility, but by the time those important hardware details actually become relevant, the user has probably amassed enough experience and knowledge on micros and AVR chips that they'll now be able to use those fancy IDEs.
Arduino isn't about being the final product, or for becoming the next best IDE, it's about teaching, learning, and prototyping. It's about teaching a generation that programming, hacking, and technology isn't out of their reach or understanding. I've taught middle schoolers from rural areas in Puerto Rico how to control things with an Arduino.
One of them build a timer/thermostat for their house using scavanged IR leds from a broken TV remote, a few passives, and a temperature sensor that costs about $0.50USD. He now has a system that will turn on and adjust the Mini-split AC unit in his room, so it cools his room down slightly before he gets home. His unit was an older, cheaper model that did not have a built in thermostat (or the thermo died, I'm not completely sure). That student now wants to go into Electrical Engineering in college, and now thinks he stands a chance at getting into college, where he didn't before.
Re:Chip Hall of Fame: Atmel ATmega8
by user5994461 on Tuesday October 31, 2017 @08:01PM
(#15597833)
I have never seen a good IDE in the embedded world.
Between the impossible setup, the non existing documentation, the examples that don't work if there are any. Just kidding, there are never any example at all.
Arduino can actually run a program and do shit. You can turn on a led in your first hour. And if you are an experienced programmer you can google the name of the function and see what arguments it takes and turn the led off and on. Amazing.
Blinking a led is a 3 weeks project on a normal hardware platform. And that's when it goes well.
Re:Chip Hall of Fame: Atmel ATmega8
by bjt2n3904 on Tuesday October 31, 2017 @10:23AM
(#15593432)
In short, the Arduino was popular because how bad everything else was. Travel back ten years, and look for an embedded development kit. This is what you'll find.
Average cost is gonna be about $100 for the board. Oh, did I mention you'll need another $80 for the programmer? It only runs on Windows XP, by the way. Closed source custom USB driver that no one understands. Wine chokes out, so no running it on Mac or Linux. PS: The programmer was the "student edition". You'll only be able to program their low end series of chips, and hardware debugging is disabled.
I forgot to mention. You're limited to the free assembler / IDE, that only allows you to use 4k of space. If you want to use any more, you need to purchase a license for $250. And by "integrated", I mean no using your own makefiles or editors.
There's no "stack overflow" style community, either. Your support is limited to poorly written app notes behind a crumby web portal.
And then the Arduino came out. $20 gives you the board, and programmer. No licenses. No drivers. Open documentation. Works with a fork of GCC. Want to use VIM and Makefiles? An Eclipse based IDE? Work on a Mac? Comes with a vibrant community, a repository of examples, and inexpensive addon hardware.
TL;DR - Want your product to die? Force me to use your crumby closed source / "evaluation period" tools from the 90's, lock everything away behind NDA's and web portals, and provide no support community for your product.
Looking at you, FPGA manufacturers. Does your revenue come from selling chips, or selling crap development environments?
Re:Chip Hall of Fame: Atmel ATmega8
by akandiah on Tuesday October 31, 2017 @08:23PM
(#15597945)
The magic of AVR was that it always had a great, opensource toolkit in the form of avr-gcc and plenty of community support around it. The AVR Freaks forum started well before stack overflow and offered a tremendous volume of support.
I do agree about the expensive programmers though. However, there were people out there who wired up their own using the STK200 configuration and put the schematics online for the community's use.
Programmers (irrespective of micros) have always been relatively expensive - even the home-brew ones. It's only recently (say in the past 5-8 years) they've become cheaper thanks to people's interest in hobby boards like the Rasberry Pi.
The biggest problem was the availability of JTAG debuggers. Atmel had the reference, closed-source implementation. Although the community managed to eventually reverse engineer their implementation and cheaper ones became available on eBay (usually from China).
Re:Chip Hall of Fame: Atmel ATmega8
by lmilcin on Tuesday October 31, 2017 @12:10PM
(#15594300)
The assumption here is that if you go for FPGA design you should already have at least some knowledge of embedded applications.
FPGA development process is aimed squarely at corporations and rightly so.
There is very few hobbyist projects that really require FPGA. Most of cases where I saw FPGA in use was not because it was needed but because the person didn't know how to achieve the result using other, more appropriate means.
Re:Chip Hall of Fame: Atmel ATmega8
by bjt2n3904 on Tuesday October 31, 2017 @02:27PM
(#15595382)
> FPGA development process is aimed squarely at corporations and rightly so.
Sure, I wouldn't burn too much money advertising FPGAs to makers and hackers. But I wouldn't design my platform to exclude them.
The accessibility and hackability of the Arduino and the Raspberry Pi helped create the IOT field (for better or for worse). The only reason the Raspberry Pi exists is because there was an insider at broadcom that was able to convince them to sell a smaller quantity of chips.
> We were able to get our foot in the door to discuss buying chips in much smaller numbers than they usually sell (you’re right about millions of chips) because Eben works there and was able to get access to the right people, who were right on side once we had explained the goals of the charity. [1]
Alienating and raising the barrier for smaller players hinders business development. What cool projects would exist now if FPGA vendors weren't so stuffy?
Re:Chip Hall of Fame: Atmel ATmega8
by lmilcin on Tuesday October 31, 2017 @02:47PM
(#15595554)
I think FPGAs are not like general purpose MCUs.
I think the comparision is like between CPU and GPU. GPUs are fantastic at solving some of the problems but you don't see people rushing to use GPUs in every computing application.
Chances are, if you can implement it on MCU you will want to implement it on MCU because:
1) you need an MCU anyway either separate or FPGA based one
2) FPGA programming is sucha a hassle and not because of the tools but because it is genuinely hard
3) learning FPGA development well is a major effort as it requires different type of thinking. It is much more of a change that going from one programming language to another as entire concept of what is a program changes.
4) if you need more power, it is typically easier to step to more powerful MCU than to FPGA.
As I understand, we need some number of very specialized people that can invest the time to learn hardware design on FPGA and the rest is better off spending that time thinking of fun MCU-based projects:)
Re:Chip Hall of Fame: Atmel ATmega8
by user5994461 on Tuesday October 31, 2017 @07:53PM
(#15597784)
A GPU is much closer to a CPU and a MCU, than any of these is to a FPGA.
VHDL is a different thing entirely from any programming language. It's not ranked as a programming language by the way. It might be easier to learn if you don't know any programming but know how to make integrated circuit boards.
Re:Chip Hall of Fame: Atmel ATmega8
by sokoloff on Tuesday October 31, 2017 @09:08AM
(#15592915)
The "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.
Re:Chip Hall of Fame: Atmel ATmega8
by lmilcin on Tuesday October 31, 2017 @09:17AM
(#15592974)
Because 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.
Re:Chip Hall of Fame: Atmel ATmega8
by IgorPartola on Tuesday October 31, 2017 @11:00AM
(#15593703)
Same reason WordPress is "better" than whatever fancy CMS you prefer. It's accessible. I dislike the Arduino IDE, but it's so underpowered that getting lost in it is nearly impossible.
The variant of C it uses is actually not bad at all for what you end up doing with AVR's. I have looked at Lua and MicroPython and for me the problem is that they do a little too much abstracting away of the hardware. I mean on the one hand, great I can write Python. On the other hand it might not work because you don't have the low level control you need inside interrupt handlers to not screw up your state. As for the pre-processor, well again it's not something most casual users use. I remember looking through WordPress's core code about 10 years ago and there was a statement in there that amounted to variable assignment... but using a damn eval(). Does an average WP user care?
Re:Chip Hall of Fame: Atmel ATmega8
by hugs on Tuesday October 31, 2017 @08:58AM
(#15592853)
Don'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.
Re:Chip Hall of Fame: Atmel ATmega8
by kayfox on Tuesday October 31, 2017 @09:28AM
(#15593046)
I like the simplicity of the IDE, you don't have to muck around with a bunch of stuff or spend an hour configuring the debugger just to compile and download code to the target.
I'm also fairly sure thats why its popular with more artistic people.
Re:Chip Hall of Fame: Atmel ATmega8
by bittercynic on Tuesday October 31, 2017 @01:16PM
(#15594828)
My anecdote (which I suspect is common):
When I was brand new to embedded development I spent dozens of hours struggling with a bare ATMega8 before finally getting an LED to blink. It was all simple stuff, but overwhelming when you're in a new and unfamiliar environment.
After playing around with that for a while I got an Arduino, and was able to blink an LED in minutes, and there was a clear path to move on to more sophisticated things.
I completely agree that the Arduino IDE is horrible to use, but it makes up for that by making it easy for beginners to get started.
Re:Chip Hall of Fame: Atmel ATmega8
by dekhn on Tuesday October 31, 2017 @09:06AM
(#15592905)
because 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.
Re:Chip Hall of Fame: Atmel ATmega8
by HeyLaughingBoy on Tuesday October 31, 2017 @02:37PM
(#15595468)
Because it's easy.
I'm a professional embedded systems engineer and I do tons of side jobs with Arduino because I can build a one-off in an hour whereas on a bare AVR, even starting with my own prebuilt framework, I'd be looking at many multiples of that time.
Right now I'm working on precision motion control using resolvers and I'm still building with Arduino because of all the readily available parts in that ecosystem.
Re:Chip Hall of Fame: Atmel ATmega8
by bsder on Tuesday October 31, 2017 @02:40PM
(#15595496)
> I don't get why Arduino is so popular
The community.
If you can write a PID loop, you aren't the target audience.
If you have an old toaster oven and need to control the temperature and you have no idea what a PID loop is, you are the target audience. You can go get an implementation from the community for "the thing that controls temperature" and get on with life.
Re:Chip Hall of Fame: Atmel ATmega8
by icebraining on Tuesday October 31, 2017 @09:38AM
(#15593112)
Earlier fully-integrated boards often used BASIC (e.g. BASIC Stamp and PICAXE). With an Arduino you're already closer to the metal, and you can easily "graduate" to avr-gcc.
Maybe there was another board that could do this, but if even I didn't learn about it, they sucked at promotion.
Re:Chip Hall of Fame: Atmel ATmega8
by elijahparker on Tuesday October 31, 2017 @09:47PM
(#15598311)
It 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.
Re:Chip Hall of Fame: Atmel ATmega8
by retSava on Tuesday October 31, 2017 @07:13AM
(#15592335)
It'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, ...).
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/
[2] http://sdcc.sourceforge.net/
[3] 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.
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 ;-)
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.
I have almost 2 decades of interesting experience as a software dev. I am now learning hardware design so that I can create niche hardware products and use my dev experience as an advantage.
I decided to fix it only because I am of the opinion that if I want to act professional in any area I can't shy away from projects like that.
If I calculated the time I spent on this I could have easily bought few of these, new, for the time I was not spending on billable hours.
I know it's one of those compliance issues, but it might be a good idea to have an electrician come out. Last thing a renter wants to see, is bodged together "fire badness".
I'm not saying yours is by any means! But sane-ness and law hardly go together :/
My kitchen was completely miswired since the building was built. The ground exchanged with neutral line. I tested the lines and put it back together as it should. There were many complaints from previous tenants but nobody was able to figure out and fix it -- seems so basic but nobody could do it.
I get you - that your work is likely higher quality, and you could claim ignorance if anyone did have a complaint.
But yeah, on Sunday, I redid some of our outlets and switches. We live in a trailer, and some of the switches were getting intermittent, and some outlets were loose to the point of turning off stuff if they jiggled. But.. I did find out that 1 outlet in the bathroom, the hallway lights, and 1 wall of the living room were on 1 gang... (sigh). I have my work cut out for me if I actually want to do it right.
I think its best to start by utilizing your software experience as much as possible and having just enough hardware to get by. Also don't try to learn/solve too many problems at the same time.
Most of my projects is relatively little/simple hardware + lots of features in software.
For example -- one of my complicated projects requires very precise temperature measurement, precise regulation of mains AC power to 1kW heating element, dealing with PCB environment being very hot and humid (up to 80C), etc.
I am splitting the effort of learning all of those things, and first thing I am building is a precise, standalone thermometer. I will build some software features (data acquisition to SD card, USB, etc.) which is relatively simple compared to getting precise temperature measurement.
Then I will maybe build standalone power regulator that I could have many uses for especially when connected to the thermometer (for example control my oven to do reflow!).
Once I know the building blocks I will attempt building the complex project I have in mind.
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.
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.
Yes, of course, but it just doesn't look good when the price almost doubled in twelve months, specially when you have better and more powerful micros like the STM32 for less money.
If you can get both MCUs to do the same thing but one of them takes 1/10th the time to set up then which one is better?
Any investment in time or tools is orders of magnitude more than prices of these parts.
Agree for getting things going though - definitely faster and none of that PICkit crap to deal with.
For me there just isn't enough middle ground between 8-bit AVRs and ARM Cortex that would justify learning another platform.
I might be biased, as I learned starting with AVRs and then took to Cortex-M3/M4 when my projects outgrew 8-bit. If I started with PIC that would probably be PIC/Cortex-M, but AVR is so much easier on a newb like I was few years ago.
Want 8, 2 bit timers? Sure thing! One large 32bit timer? Done!
Having a CPLD to drive your peripherals so that you can reconfigure them is a brilliant idea. The fact that you can drop down to VHDL is an awesome bonus. They've also got some small reconfigurable op-amps built in as well that lets do you really clever things while sleeping.
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.
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.
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.
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).
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.
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/
[2] - https://docs.hidiot.com/
[3] - https://rawhex.com/blogs/news/ghost-hunting-with-the-hidiot
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.
I've tried using some, such as a brief stint with Atmel Studio some years ago, Eclipse, and a couple others I can hardly remember. My biggest complaint was how tedious it was to start a project. They start asking you questions that a hobbyist isn't going to have enough background to answer.
Arduino takes those and hides them. Yeah, it means you might have less flexibility, but by the time those important hardware details actually become relevant, the user has probably amassed enough experience and knowledge on micros and AVR chips that they'll now be able to use those fancy IDEs.
Arduino isn't about being the final product, or for becoming the next best IDE, it's about teaching, learning, and prototyping. It's about teaching a generation that programming, hacking, and technology isn't out of their reach or understanding. I've taught middle schoolers from rural areas in Puerto Rico how to control things with an Arduino.
One of them build a timer/thermostat for their house using scavanged IR leds from a broken TV remote, a few passives, and a temperature sensor that costs about $0.50USD. He now has a system that will turn on and adjust the Mini-split AC unit in his room, so it cools his room down slightly before he gets home. His unit was an older, cheaper model that did not have a built in thermostat (or the thermo died, I'm not completely sure). That student now wants to go into Electrical Engineering in college, and now thinks he stands a chance at getting into college, where he didn't before.
That is why Arduino is so popular.
Between the impossible setup, the non existing documentation, the examples that don't work if there are any. Just kidding, there are never any example at all.
Arduino can actually run a program and do shit. You can turn on a led in your first hour. And if you are an experienced programmer you can google the name of the function and see what arguments it takes and turn the led off and on. Amazing.
Blinking a led is a 3 weeks project on a normal hardware platform. And that's when it goes well.
Average cost is gonna be about $100 for the board. Oh, did I mention you'll need another $80 for the programmer? It only runs on Windows XP, by the way. Closed source custom USB driver that no one understands. Wine chokes out, so no running it on Mac or Linux. PS: The programmer was the "student edition". You'll only be able to program their low end series of chips, and hardware debugging is disabled.
I forgot to mention. You're limited to the free assembler / IDE, that only allows you to use 4k of space. If you want to use any more, you need to purchase a license for $250. And by "integrated", I mean no using your own makefiles or editors.
There's no "stack overflow" style community, either. Your support is limited to poorly written app notes behind a crumby web portal.
And then the Arduino came out. $20 gives you the board, and programmer. No licenses. No drivers. Open documentation. Works with a fork of GCC. Want to use VIM and Makefiles? An Eclipse based IDE? Work on a Mac? Comes with a vibrant community, a repository of examples, and inexpensive addon hardware.
TL;DR - Want your product to die? Force me to use your crumby closed source / "evaluation period" tools from the 90's, lock everything away behind NDA's and web portals, and provide no support community for your product.
Looking at you, FPGA manufacturers. Does your revenue come from selling chips, or selling crap development environments?
I do agree about the expensive programmers though. However, there were people out there who wired up their own using the STK200 configuration and put the schematics online for the community's use.
Programmers (irrespective of micros) have always been relatively expensive - even the home-brew ones. It's only recently (say in the past 5-8 years) they've become cheaper thanks to people's interest in hobby boards like the Rasberry Pi.
The biggest problem was the availability of JTAG debuggers. Atmel had the reference, closed-source implementation. Although the community managed to eventually reverse engineer their implementation and cheaper ones became available on eBay (usually from China).
FPGA development process is aimed squarely at corporations and rightly so.
There is very few hobbyist projects that really require FPGA. Most of cases where I saw FPGA in use was not because it was needed but because the person didn't know how to achieve the result using other, more appropriate means.
Sure, I wouldn't burn too much money advertising FPGAs to makers and hackers. But I wouldn't design my platform to exclude them.
The accessibility and hackability of the Arduino and the Raspberry Pi helped create the IOT field (for better or for worse). The only reason the Raspberry Pi exists is because there was an insider at broadcom that was able to convince them to sell a smaller quantity of chips.
> We were able to get our foot in the door to discuss buying chips in much smaller numbers than they usually sell (you’re right about millions of chips) because Eben works there and was able to get access to the right people, who were right on side once we had explained the goals of the charity. [1]
Alienating and raising the barrier for smaller players hinders business development. What cool projects would exist now if FPGA vendors weren't so stuffy?
[1] - https://www.raspberrypi.org/blog/qa-with-our-hardware-team/
I think the comparision is like between CPU and GPU. GPUs are fantastic at solving some of the problems but you don't see people rushing to use GPUs in every computing application.
Chances are, if you can implement it on MCU you will want to implement it on MCU because:
1) you need an MCU anyway either separate or FPGA based one
2) FPGA programming is sucha a hassle and not because of the tools but because it is genuinely hard
3) learning FPGA development well is a major effort as it requires different type of thinking. It is much more of a change that going from one programming language to another as entire concept of what is a program changes.
4) if you need more power, it is typically easier to step to more powerful MCU than to FPGA.
As I understand, we need some number of very specialized people that can invest the time to learn hardware design on FPGA and the rest is better off spending that time thinking of fun MCU-based projects:)
VHDL is a different thing entirely from any programming language. It's not ranked as a programming language by the way. It might be easier to learn if you don't know any programming but know how to make integrated circuit boards.
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.
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.
The variant of C it uses is actually not bad at all for what you end up doing with AVR's. I have looked at Lua and MicroPython and for me the problem is that they do a little too much abstracting away of the hardware. I mean on the one hand, great I can write Python. On the other hand it might not work because you don't have the low level control you need inside interrupt handlers to not screw up your state. As for the pre-processor, well again it's not something most casual users use. I remember looking through WordPress's core code about 10 years ago and there was a statement in there that amounted to variable assignment... but using a damn eval(). Does an average WP user care?
I'm also fairly sure thats why its popular with more artistic people.
When I was brand new to embedded development I spent dozens of hours struggling with a bare ATMega8 before finally getting an LED to blink. It was all simple stuff, but overwhelming when you're in a new and unfamiliar environment.
After playing around with that for a while I got an Arduino, and was able to blink an LED in minutes, and there was a clear path to move on to more sophisticated things.
I completely agree that the Arduino IDE is horrible to use, but it makes up for that by making it easy for beginners to get started.
I'm a professional embedded systems engineer and I do tons of side jobs with Arduino because I can build a one-off in an hour whereas on a bare AVR, even starting with my own prebuilt framework, I'd be looking at many multiples of that time.
Right now I'm working on precision motion control using resolvers and I'm still building with Arduino because of all the readily available parts in that ecosystem.
The community.
If you can write a PID loop, you aren't the target audience.
If you have an old toaster oven and need to control the temperature and you have no idea what a PID loop is, you are the target audience. You can go get an implementation from the community for "the thing that controls temperature" and get on with life.
Maybe there was another board that could do this, but if even I didn't learn about it, they sucked at promotion.
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
[2] https://www.youtube.com/watch?v=HrydNwAxbcY