6 ms·
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 w
by filomeno 9y ago
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 ;-)
- 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.
- nerfhammer 9y agonow, 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.
- cjsuk 9y agoI find the PIC peripherals better. The counter is fully async on the PICs for example which allows you to do very fast (50MHz+) pulse counting. Agree for getting things going though - definitely faster and none of that PICkit crap to deal with.
- lmilcin 9y agoMost 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.
- vvanders 9y agoYeah, 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.
- cjsuk 9y agoPSoC dev kit is also extremely cheap!
- vvanders 9y agoYes! 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.
- jacquesm 9y agoYou're a dream tenant. The normal procedure when something that is part of the premises fails is to ask the landlord to replace or fix it.
- lmilcin 9y agoThat'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.
- crankylinuxuser 9y agoIt'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 :/
- lmilcin 9y agoYou 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.
- crankylinuxuser 9y agoIf 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.
- filomeno 9y ago> 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.
- lmilcin 9y agoThey are more powerful but to say they are better you have to factor in the ease of use. 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?
- filomeno 9y agoSure, 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 :)
- lmilcin 9y agoSo 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.
- Faaak 9y agoBy pure curiosity: would it be a FRANKE fumes extractor ? I have the same problem with mine.
- lmilcin 9y agoIt is so cheap that there is no mention of any brand on the extractor. I live in Poland so the chances are very slim.
- forkandwait 9y agoIs 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.
- lmilcin 9y agoNot 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.
- 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.