Go to Source
Author: Anas Essop
Go to Source
Author: Anas Essop
Hello everyone. My name is Matthew Reinbold. Tonight, I’m going to be talking about why AI success is built on APIs. We’re briefly going to go over why AI is such a big deal right now just to make sure we’re level set and everybody’s aware of all the hype and the realness that is going on. We’re going to talk about the challenges with creating API models and then segue into why those significant challenges ultimately lead to APIs that will deliver AI functionality and how to evaluate those type of claims.
If you’re wondering who I am, as I mentioned, my name is Matthew Reinbold. I am the Director for the Capital One API and Event Streaming Platform Services. That’s a bit of a mouthful, but essentially it means that I have a very unique position. I’m part enterprise architect, I’m part business analyst, and I’m part internal developer relationship guru. We kind of mix those things together into a pot and then subsequently apply our expertise. Me and my team apply our expertise to our approximately 9,000 plus developers. We try and make sure that the systems that we’re building based on APIs and event streams are consistent, exhibit that best decoupling practice that David mentioned, and that have guaranteed return on investment over the long term.
I also do a fair amount in the community. I write a newsletter called Net API Notes that goes out about three out of every four weeks. I do the curation on a site called Web API Events. If you’re at all curious about future API meetups and the community worldwide, that’s a good place to go. I also tweet a fair amount. I’m not here to sell you anything other than the fact that I’m going to be doing some sticker giveaways in my newsletter. If you sign up and support the newsletter, you could be getting some legally dubious sticker parodies that happen to have something to do with APIs. That’s the only pitch you’re going to hear from me tonight.
But what you’re here for is really about AI. I think there’s a lot of excitement and a lot of interest in what this is among people that are probably technology savvy but maybe not directly in the milieu when it comes to AI, and you would be forgiven to think that we’re all on the precipice of something nasty. There’s been a lot of negative coverage over the past couple of years about how we’re entering this dangerous phase. I mean even the Pope is talking to Microsoft about what’s going on with their API. I mean that’s significant. There’s something going on there and while this is very interesting and probably the source of a lot of clickbait, I am here to tell you that we are not one compile away from Skynet. Okay?
AI is a vast bucket that can describe a multitude of things and usually when you see these scary things of like terminators and questioning whether we’re losing control, usually, that is referring to something called a general-purpose AI or AI that can think like people and we’re a significant ways away from that happening. What I’m talking about tonight is much more narrowly focused. In fact, it’s called narrow API and I’m specifically going to focus on machine learning, which is a segment of AI. That has real benefits for companies and businesses. It has interesting applications for technologists and it’s probably not going to end life as we know it. So that’s a good thing.
There’s considerable growth in the space. So if you’re trying to follow the space right now, we have one of these up into the right type of graphs. If you are following papers released on machine learning, you would be to the point where you’re trying to keep up with a hundred new machine learning papers every single day. A lot of advancement, a lot of interesting things happening in the space. And the reason for that is multifold. You have things like Moore’s Law and GPUs getting faster and faster, enabling compute on a scale that you never had before. And even if you don’t have access to the physical hardware, you now have greater access to scalable cloud compute resources. So maybe you don’t have those servers in your closet to do machine learning, but Amazon does, but Google does and you can access those through APIs very easily.
There’s an increased ability to collect, store, and study data. I think for better or for worse, we’re getting much more sophisticated about how to collect data. And then the final point, the reason we’re seeing so much interest in growth in machine learning applications is because we have lowered barriers to creating training and deploying models.
So when I say model, what does that mean? Taking everybody in the room and making you a machine learning practitioner is probably beyond the scope of this conversation. However, as we get to talking more about why these things take so much compute, why they’re so processor-heavy, we need some basic, some grounding in how these things are put together. Say, for example, we had a task before us. We had to take pictures and decide whether the picture was of a Chihuahua or something else. So a very simple application. Yes, no. Chihuahua or not. Well in that particular thing, you have a number of nodes in your input layer and each one of these nodes has some value for the input and some weight. How important is the value at this node at a given time?
And just to illustrate just how many of these things there possibly could be. My first digital camera was a Sony Mavica and the max resolution you had on those pictures was 640 by 480. You can imagine now your modern smartphones have millions and millions of pixels, but in that 640 by 480 image you have 307,200 pixels. So if you were creating some kind of machine learning algorithm to determine whether or not the picture had a Chihuahua or not, you would have over 300,000 input nodes, one for every single pixel. And then you take the output, you take the weight, you take the input, and then you send that to every single one of the nodes in the next layer and the next layer and the next layer and so on and so forth. And then you train the model, which is taking all of this math that’s happening in here and tweaking it.
I have a subset of data and this got me closer by tweaking the weights here, tweaking, tweaking, tweaking, tweaking, and eventually you get to the point where you have a model that can reliably produce something that will tell you whether or not you have a Chihuahua or not — or you have a muffin. So it’s important to keep in mind that these machine learning models don’t understand what they’re looking at. You don’t spend a tremendous amount of compute and money and power and it knows what a dog is. It just has figured out through all that math that I have a pattern in my data of two blobs overtop a smaller blob. And subsequently, when I put in a muffin picture that has that same pattern, it’s going to think I have a Chihuahua.
If I do have any machine learning folks, I apologize, that’s a gross oversimplification, but we need to be all on the same page as we go forward when we’re talking more about these kinds of things. Machine learning, despite the fact you might get a muffin when you wanted a Chihuahua, is a big strategic initiative for a lot of different companies. The annual growth revenue for artificial intelligence products and services will grow from 643 million in 2016 to over 36 billion by 2025. That’s a 57 fold increase over that time period. It’s the fastest-growing segment in all of IT. So a lot of people need their muffins and chihuahuas.
Where it’s being applied is really important because it’s not a silver bullet. There’s a Princeton professor named Arvind Narayanan and that’s dangerous to pronounce, I apologize in advance. But he had a great presentation where he was talking about how to figure out what is AI snake oil. And he said there’s some genuine innovation happening in the perception space. So things like recognizing images or sentiment analysis or natural language processing. Those are some very powerful applications. When you get to automating judgment, like is this email spam or not? It’s okay and it’s getting better, but we have this whole area that gets really creepy and/or icky where it’s predicting social outcomes.
So you might have a machine learning algorithm that you can focus on somebody’s social media feed and tell you how many times there’s a beer bottle in the photo shared. But what you shouldn’t be doing is using that machine learning algorithm to determine whether or not that is a good candidate to hire. And sometimes in the news we see that conflated, that just because you can go through somebody’s feed, sometimes you can make these correlations, it doesn’t predict the future and we shouldn’t be making machine learning, putting it in the role of trying to divine the future because that’s very, very sensitive territory.
And of course, you need to use common sense. There’s a fantastic rule of thumb here where if your system has more than a hundred if-else, it’s time to switch to machine learning. Now, of course, it might be 90, for you, it might be 110, it might be 1000, but again, machine learning is not a silver bullet. If you have a simple, straightforward use case, program the simple straightforward use case. It’ll be easier to maintain, it’ll easier to understand, it will be easier to pass onto that next developer.
Say, for example, you had a web application and it wanted to suggest the next app to use after you close the first one. Oh, well, you could use machine learning and you could build in thousands of signals based on like time of day and user activity and social media threads and how often they’ve called their mom in the last week and so on and so forth. There’s a lot of signals that you could put into some very complicated machine learning algorithm or you could say, well 70% of the time they just want to use what’s most popular on their phone and that’s what we’re going to suggest to them to use next. Vastly much more simpler. You need to be able to make a significant justification for the investment in machine learning and it needs to be certain X times better than simple alternatives.
So let’s talk about challenges to machine learning. You need data. If you’re going to find patterns in data, then you need to have a sizable amount of data to find. Google republished a paper recently about their latest chatbot named Meena and in order to program it, they use 341 gigabytes of source text. There’s not a whole lot of places where you just find 341 gigabytes of text lying around. That’s significant. That’s something on Google scale that they can do. They used it to train their chatbot and in the course of training it, again doing all those maths, refining the weights, doing the math again, going through that process, they burned approximately $1.4 million in compute. Imagine coming into the office the next month and having to explain where 1.4 million went.
And you see the results there on the right. I don’t know how many folks played with Eliza. The system that was originally built like in the 60s. I struggle to figure out how that’s better. And again, machine learning hasn’t understood what you’re saying. It’s just gotten really good about picking up the keywords and parroting them back to you, which may be sufficient if you’re talking about something like a support system where somebody comes in and asked to pay a bill and the system recognizes the word “bill” and knows that the usual response should be, “Great, what account?” or, “Which bill?”
There’s some regulatory private and ethics of using machine learning. We’re going to talk more about probably one of the least thought of ethics, this power consumption, in just a moment because frankly there’s some pretty significant ethical ramifications for these types of systems. Again, when you start getting into the prediction space, what is the ethics of using a machine learning system in health if the data set population that was used was only ever built on white male results. Is it going to end up causing a disparate number of misdiagnoses on people outside that data set population? All of those are some fairly significant things, but I want to lastly hit on that, that operationalization piece.
You need to continue to tune your model, especially if it’s something like natural language processing. Language is alive, language changes, language is fluid, and so to think that, well, okay, we’re going to spend our 1.4 million now and this is going to be our model that we’re going to be able to use for the next decade is probably false. Brand new memes, brand new things that my kids say that I don’t understand. Does anybody know that “tsk-tsk-tsk” hydroflask? Okay, well he’s a former DJ. He’s down with the kids. I was sitting down to dinner and my eleven and seven year old suddenly started talking in memes and I never felt older in my entire life.
All right, but more about that power, you might’ve seen that the amount of compute used to program Meena ended up using the same amount of power that an average American household uses in 28 years. There’s been other models that have generated some interesting headlines. The GPT-2 is a common text model that Google has produced. Training that emitted as much carbon as five cars in their lifetimes and I will be quick to point out that that includes the manufacturing of those cars, not just their operation. Very, very significant. Also, the amount of power needed is rising at a very rapid rate.
So I alluded to the fact that there’s a lot of ethical ramifications. This is the only one that I’m going to take a side tangent on because I don’t think that many people think about this, but for example, if you are doing machine learning and you can pick which region your machine learning is being run in, Amazon actually has regions that are carbon offset. It’s not US East. So think about that. If it doesn’t matter where your compute is being run, spend five minutes Googling which region is carbon offset and that would do us all a big favor longterm and my daughters will be able to continue going “tsk-tsk-tsk” long after I’ve gone away.
We’ve been here before though, really. I mean because think about it. What if every company decided that in order to build their application, they were going to send a fleet of cars to take a photo of every single inch of every single street? That would be ridiculous. We had one company do that, in this case, Google, and we use their API to consume it. We also would be in big trouble if every single startup decided that they were going to stand up their own data center for scalable compute. Hey, why don’t we just have AWS or Google or Azure go ahead and do their thing and we just consume it via API. Finally, imagine if every single startup that wanted to send a text message or have a phone call in their application had to negotiate their own contracts with the telcos. The barriers to innovation would be horrible. Better to let someone like Twilio do that once and then we just benefit from their contract.
In the same way that these companies have exposed services via APIs, the future very much looks like leaving the big model building to the experts who can burn 1.4 million on a model and then we consume that model through an API, and this is nothing new. David mentioned separation of concerns. It would be the same here. You have your code, you focus on your business problem, and then through a web or a net API, you’re using someone else’s generated model and you leave it to them to have to figure out where all that data is coming from and how they’re refining it and how they’re updating it. Their compute cost is probably divided up across all their consumers, so you probably get a better rate than if you would have tried to create it yourself.
The regulatory and private privacy and ethics of this, of course, you need to have an understanding of how they’re doing things. You can’t just wash your hands of it and walk away if it’s suddenly determined that they’re sacrificing virginal chickens in order to get their data. But it does provide some layer of separation, some layer of abstraction, if someone else, if you’re relying on their information and models. And finally, operationalization becomes their problem. You can continue to innovate on your own business problem and leave that generated model and all of the concerns that come with that model to someone else through that API.
And this is already happening. This was a survey of which types of AI are consumed through an API. Languages first and foremost. So think of things like natural language processing, semantic sentiment analysis, that kind of thing. Followed by speech, vision, data, discovery, and conversation. With the exception of data discovery, these are all perception. That three-column layout by the Princeton Professor about what is having impact. These are perception. How do we perceive the information that’s coming in and how do we scale our response to it? So this is where the API’s are having benefit. And of course, if we’re going to consume these APIs, we do have a responsibility to evaluate their claims.
There’s a great IEEE article about three ways to evaluate. I added a fourth here. There are certainly other folks online who have gone and done rigorous testing as far as, “Hey, I’m going to take all of the major leading AI houses and I’m going to compare them against each other.” But, the first is. Considered incentives.
If the business model that somebody is putting forth means that it’s actually beneficial to them to not be transparent as far as how the model is generated or how the data is collected, that probably is not someplace you want to use. You need to watch out for hype salad. If they’re advertising the latest blockchain, machine learning, IoT, whizzbang gobbledygook, that’s a problem. Certainly leverage the work of others. Again, this is a fantastic article. Not all of them are as comprehensive as this gentleman’s article, but fantastically done, well written, well-researched piece that goes into some depth on all the capabilities, comparing them on all of their various features.
And then finally, interrogate the data. And we all need to be doing this as we are increasingly a data-driven culture, but we’re not good at it. There was a survey done that asked folks to say, “How do you have your data expertise? How do you know whether your data is good or not? Do you have best practices in place for interrogating the data?” And 44% said, no, I don’t know, fell off a truck, now I’m using it. And increasingly, that’s not going to be an acceptable answer. We need to figure out best practices for how to interrogate the data, especially through APIs because we may not have our hands on that data. We need to be able to understand how to talk to those vendors and how to understand where that data is coming from.
Furthermore, “How did you learn to analyze data?” 58 nearly 59% of folks said, Oh I’m self-taught, which may be great. I’m self-taught in a number of things. But as we move forward there needs to be some common understanding, some common approaches, some best practices to how we look at this data. And so there probably needs to be more education about that. There’s a great white paper out there that talks about nutritional labels for data. So, rather than leaving it up to you and I as individuals to dig deep into things and figure out how this stuff was composed, much like anything you buy in a grocery store, they make this a common format.
Again, common standards, common format. So I can come and I can quickly look and see, well, okay, for my given data model, maybe I don’t really need that much metadata, but I really need some probabilistic modeling on how this was put together. That is still being formed. And I think if you have any say at your companies, this is something that you probably need to start asking about. How do we interrogate our data? Do we have best practices for that? And if we don’t have best practices, let’s start referring to some of the thought that’s swirling in the industry right now as far as how we can start putting some of this stuff together. Got it?.
All right, so in conclusion, there’s certainly tons and tons and tons of resources online. Some of the stuff that I found very valuable as a recovering developer who wants to understand this has been some of these gentle entry points. I’m a big YouTube guy, so Crash Course AI, The Coding Train have been great. There’s some GitHub resources… Fast AI is great, if you’re a bit more of a data sciency-type who’s comfortable using some of those tools, they have a great resource. There was a fantastic side by side comparison site, in theory, because these are APIs, somebody should have a portal where I can go and I can test sentiment analysis by putting some text in a field and hitting a button on which cloud provider I want to run that against. And then based on that initial response, then I know who to choose and that was intense.to or intent.io or however you pronounce that.
When I went to go take a screenshot of that site today, they were down, so I don’t know what happened and I can’t find a good alternative, but really we should have like almost a “if this, then that”, to be able to go put some samples in, see how it runs across various providers without having to sign up for a credit card and make that shotgun wedding happen. Algorithmia started out as a marketplace for algorithms before AI was the big catchall. They’ve since pivoted. They’re now a machine learning operationalization company. They don’t have that same marketplace where you could compare and contrast different algorithms so they’re out of the picture. ProgrammableWeb, you have some keywords, some searches that can be done on AI. So that’s an opportunity, but then there’s also finding your own data.
The dataset search from Google is fantastic. I spent a few minutes just searching some terms off the top of my head and I was finding data sets that I had no idea existed. If you want to start playing around with this stuff, that’s a great place to seed some of your initial work on that. And then getdata.io is also great. But the last thing I have to say, I’ll go ahead and I’ll have my notes posted to my website at some point in the near future. As David mentioned, all of these are recorded. If you have any questions, you can certainly find me on any one of those forums and thank you for your attention.
Go to Source
Author: <a href="https://www.programmableweb.com/user/%5Buid%5D">david_berlind</a>
Electric three-wheelers ferry people and goods around Bangladesh but are banned in its capital. Batteries and motors could accelerate the bicycle rickshaws that gum up Dhaka’s traffic and eliminate exhaust from tuk tuks, gas-powered three-wheelers. But charging such EVs would further burden already strained power lines.
That’s just one of many opportunity costs that Bangladesh pays for a weak electrical grid. Frequent power outages hurt businesses and deter foreign investment. A sweeping grid-modernization program promises to alleviate such troubles.
In 2018, the government-run Power Grid Company of Bangladesh (PGCB) doubled the capacity of its first international transmission link—a high-voltage DC connection delivering 1 gigawatt from India. Next month, it hopes to finalize requirements for generators that promise to stabilize the voltage and frequency of the grid’s alternating current.
And next year, Bangladesh expects to achieve universal electricity access for the country’s 160 million people, only half of whom had electricity a decade ago. “It’s a whole social transformation,” says Tawfiq-e-Elahi Chowdhury, special advisor on energy to Bangladesh prime minister Sheikh Hasina.
However, it’s not clear what the grid revamp will mean for Bangladesh’s energy mix. Domestic natural gas is running out, and the country is scrambling to replace it and maintain rapid economic growth.
A nuclear power plant is now under construction, and Bangladesh is importing liquefied natural gas. But the government sees coal-fired and imported electricity as its cheapest options, and both come with challenges and risks.
Coal delivered less than 2 percent of Bangladesh’s electricity last year, but plants burning imported coal could soon match the scale of its gas-fired generation. Three coal plants under construction are each capable of serving about 10 percent of the country’s current 13-GW peak power demand. And Chowdhury expects similar projects in development to lift total coal capacity to about 10 GW by 2030.
The government expects to boost imports fivefold, to 5 GW, by 2030. Importing more electricity will provide access to relatively low-cost and renewable hydropower. A deal struck with Nepal should provide 500 megawatts, and more interconnections to India, as well as Bhutan, China, and Myanmar, are under discussion.
To convey these new power flows around the country, PGCB is building a network of 400-kilovolt lines atop its existing 230-kV and 130-kV lines, with several 765-kV circuits on the drawing board [see map]. The firm is simultaneously improving power quality—which will allow Bangladesh to accommodate more imported power and operate the nuclear plant.
Imports will be costlier if high-voltage DC converter stations must be erected at each border crossing. Instead, the government has agreed to synchronize its AC grid with India’s, enabling power to flow freely between the two. Synchronization will not be possible, however, until PGCB eliminates its grid’s large voltage and frequency deviations.
Sahbun Nur Rahman, PGCB’s executive engineer for grid planning, says most private generators don’t properly adjust the power they produce to maintain the grid’s voltage and frequency. Stability has improved over the last two years, however, as government plants have stepped up. He says the grid could be ready for synchronization in as little as five years.
Coal power will push the country’s annual per capita greenhouse gas emissions up to about 1 metric ton—still tiny, Chowdhury says, since the average developed economy generates 12 metric tons. Still, betting on coal is controversial for a low-lying country contending with climate change. By some estimates, global coal use needs to drop by 80 percent within a decade to hold global warming to 1.5 °C this century. And one of Bangladesh’s first coal-plant projects is 14 kilometers upstream from the Sundarbans, the world’s largest contiguous mangrove forest, which serves as a buffer against cyclones and sea level rise.
What’s missing from the grid push, say critics, is wind and solar. Bangladesh pioneered the use of solar power to electrify rural communities. At the peak, at least 20 million Bangladeshis relied on off-grid solar systems, and millions still do. But Mahmood Malik, CEO of the country’s Infrastructure Development Company, says the expanding national grid means there’s “not much need” to build more.
Off-grid solar still contributes more than half of Bangladesh’s renewable electricity, which makes up less than 3 percent of its power supply. Meanwhile on-grid solar is growing slowly, and wind development has barely begun. As a result, the government will miss its commitment to source 10 percent of the nation’s electricity from renewable sources by 2021.
Abdul Hasib Chowdhury, a grid expert at the Bangladesh University of Engineering and Technology, in Dhaka, says the best long-term bet for Bangladesh is imported power from beyond South Asia. He looks to the rich winds and sunshine in sparsely populated Central Asia. “South Asia is nearly 2 billion people crammed into this small space,” says A.H. Chowdhury. “They will require a lot of energy in the next 50 years.”
This article appears in the February 2020 print issue as “Bangladesh Scrambles to Grow Power Supply.”
Despite significant cost and minimal evidence that mechanical resuscitation devices benefit patients in cardiac arrest more than resuscitation performed by people, the devices are being used more often than ever, says a new study.
The research, published this month in the Journal of the American Medical Association (JAMA), found a fourfold increase of the cardiopulmonary resuscitation (CPR) devices among emergency medical technicians in the U.S. over a six-year period.
“It was particularly surprising because the mechanical CPR has not been tested for effectiveness by the FDA, even though it was approved by the FDA,” says T. Greg Rhee of UConn Health, and a study author. “We don’t really know if it is effective in terms of keeping people alive and whether it is cost effective.”
Rhee, along with collaborators at Yale University and University of California, San Francisco, reviewed data from 2010 to 2016, for 892,022 patients nationally who were identified by emergency medical professionals as having an out-of-hospital cardiac arrest.
In settings outside of hospitals, CPR performed manually is still done much more often than by machine — about 69% of the time, the researchers found. However, the mechanical use rose steeply during that time period — from about 2% in 2010 to 8% in 2016.
Increasingly, EMTs are using the devices, even though it’s not clear whether it is more effective than CPR performed by hand, says Rhee, assistant professor of public health sciences who specializes in population-based clinical outcomes research and health care policy.
Scope of the problem
According to the federal Centers for Disease Control and Prevention, every year in the United States, about 735,000 people have a heart attack.
CPR, which is to be done when the heart stops beating, can double or triple the chances of survival after cardiac arrest, when done immediately by keeping the blood flow active, says the American Heart Association.
An increase in incidents of cardiac arrests being treated outside of hospitals along with anecdotal evidence on an uptick in the use of the mechanical intervention helped spur the decision to do the study, according to Rhee.
CPR is used on the vast majority of people who suffer cardiac arrest outside of hospital settings. Mechanical CPR devices are expensive and prior clinical trials have not provided evidence of benefit for patients when compared with manual CPR, the authors say.
The increase is particularly worrisome, not only because of the uncertainty of clinical benefit associated with device use, but also because of the devices’ known significant costs; mechanical CPR devices are often priced higher than $10,000 per unit.
“Given the high costs of mechanical CPR devices, better evidence is needed to determine whether these devices improve clinically meaningful outcomes for patients treated for out-of-hospital cardiac arrest by emergency services professionals to justify the significant increase in their use,” the researchers wrote.
Rhee says one possible reason for the increased use of machine CPR is marketing done by medical device companies. But more research needs to be done on that question, he says.
More importantly, according to Rhee, more research must be done to determine the effectiveness of machine versus manual CPR, which the researchers are now planning to pursue.
“This is more like an initial step to build further research on mechanical CPR used outside of the hospital setting,” says Rhee.
In addition to Rhee, authors include Peter Kahn and Joseph Ross of the Yale University School of Medicine, and Sanket Dhruva of the University of California, San Francisco.
Go to Source
Selecting the right microcontroller for a project involves juggling many factors. In addition to cost, performance, power consumption and overall size, the availability of the proper software and hardware tools is a prime consideration.
Support for the chosen platform is also very important — not just from the vendor, but from the community at large. It also helps if the chosen microcontroller has a readily available development board.
Finally, development time can be significantly reduced if the selected microcontroller has extensive, fully debugged, software libraries with well documented Application Programming Interfaces, or API’s.
NOTE: This is a long, very detailed article so here’s a free PDF version of it for easy reading and future reference.
In this article, only microcontrollers that generally meet the above criteria will be presented.
All modern microcontrollers share some basic features. On top of a processing unit, they have a certain amount of flash that is used to store the application code, some SRAM, and, in most cases, some EEPROM.
They need a clock source, and this is normally provided by either an internal resistor-capacitor (RC) oscillator, or by using an external crystal for more timing critical applications. They have some digital IO ports, and at least one timer/counter.
Also, other than very low-end microcontrollers, most have at least one UART for serial communications. Beyond that, microcontrollers are distinguished by the amount of memory they have, the number and type of other peripherals integrated on the chip, and the speed at which they run user applications.
This is not just dependent on the raw clock speed; it also depends on the data width of the processor and any hardware acceleration features included.
Microcontrollers for embedded systems mainly fall into three categories based on the width of their data buses: 8-bit, 16-bit and 32-bit. There are others, but these are the most popular ones.
In general, 8-bit microcontrollers are geared toward lower end applications, and 32-bit ones are for the higher ends, with 16-bit for mid-end applications.
By far, most of the products I work on tend to incorporate 32-bit microcontrollers, but 8 or 16-bit microcontrollers can be a good choice for low-end, low-cost products.
If an application does not have very high demands on processing power, and is of relatively small size, then it can make sense to consider an 8-bit microcontroller.
For reference, most Arduinos are based on 8-bit microcontrollers. So if you have built your early prototype using an Arduino then you may be able to use an 8-bit microcontroller in your final product.
Don’t let price alone though guide your decision and in many cases 32-bit microcontrollers can be cheaper than 8-bit chips.
For example, the Atmega328p is the 8-bit microcontroller used the Arduino Uno. It costs a little over $1 in volumes of around 10k pieces. It runs at 20 MHz and includes 32 KB of Flash and 2KB of RAM.
On the other hand, you can purchase a 32-bit microcontrollers running at 48 MHz with similar memory for only 60 cents. This is likely due to the popularly of 32-bit microcontrollers driving down their cost.
That being said, there are even cheaper 8-bit microcontrollers available that cost less than 25 cents at similar volumes.
8-bit microcontrollers should typically be considered for applications that are dedicated to just doing one job, with a limited user interface and little data processing.
8-bit microcontrollers come in all sizes from small 6-pin devices to chips with 64 pins. They have flash sizes ranging from 512 bytes to 256KB, SRAM sizes from 32 to 8KB, or more, and EEPROM from 0 to 4K, or more. A minimal system can be as simple as a single chip, with a bypass capacitor on the power supply rail.
The three most popular lines of 8-bit microcontrollers are the 8051 series, and the PIC and AVR families from Microchip.
Originally from Intel, and now made by others, this microcontroller is still in common use today, embedded in lots of appliances.
While they are available as standalone devices, the 8051 is now mostly used as IP (Intellectual Property) cores that are embedded in the silicon of dedicated application-specific chips such as some wireless radio transceivers.
Very rarely would the 8051 be the correct choice to serve as the main microcontroller for your product.
PIC microcontrollers are quite popular, and have wide support by both Microchip, and third parties.
Microchip provides its MPLAB®X Integrated Development Environment (IDE), which includes a C-compiler for free. Also available for free as an IDE plug-in is the MPLAB Code Configurator that generates C-code for the on-board peripherals.
This can then be integrated in the application code. There are PIC models with combinations of USART’s, SPI, I 2C, ADC, USB, LIN, CAN and other interfaces. Microchip also offers several development tools, including MPLAB PICkit 4, ICD 4 and Real ICE.
Higher quality commercial compliers that have better code optimization are also available. Here is a quick PDF reference guide to PIC microcontrollers.
The AVR is another series of very popular 8-bit microcontrollers. While they are in the same space as the PIC’s described above, and have comparable performances, they do have one big claim to fame: Arduino.
The original Arduinos, such as the Uno, Leonardo and Mega, all use AVR microcontrollers. Due to the very wide range of available libraries for Arduinos, the AVRs merit serious consideration for 8-bit applications, even if only for proof of concept prototypes.
Since Arduino libraries are written in C++, they can be easily incorporated in any application written in C/C++.
Software development tools include AVR studio, or, if using Arduino, the Arduino IDE and Platform IO are both commonly used. The complier used in these IDE’s is AVR GCC a free, very well supported and maintained C/C++ compiler.
Hardware development tools include the Atmel ICE and the PICkit 4. In addition, mature tools such as the STK600 and AVR Dragon are still widely available. Here is a link to a quick PDF reference guide for AVR microcontrollers.
16-bit microcontrollers are the next step up from 8-bit, while still sharing many of the same attributes. They are faster, support even more peripherals, and generally offer more memory, both flash and SRAM.
In addition to more IO pins, most of them also have hardware multipliers that are significantly faster, and use less program memory, compared to pure software implementations.
It is easy to find devices that have both ADC’s and DAC’s, or devices with capacitive touch sensors, segmented LCD drivers and Ethernet.
Internally, these devices also have hardware blocks typically not found in lower end devices. These include encryption engines, Operational or Programmable Gain Amplifiers, and DMA controllers.
Although 16-bit microcontrollers can be found from various manufacturers such as Microchip (their dsPIC33 is a popular choice), NXP, Infineon, or Cypress, the TI MSP430 series will be presented here as a typical example of this microcontroller segment.
The MSP430 is a series of very low power 16-bit microcontrollers that are available in many flavors. They range from general purpose to very specialized models.
One interesting thing about the specialized variants of these microcontrollers is that it actually branches out into two extremes: very dedicated, very low-cost models, and high end models with analog sensor interfaces and Digital Signal Processing (DSP).
An example of a high end application is this ultrasonic flow sensor. At the low end, TI also makes MSP430-based chips that solve many very specific hardware functions. For more details see this e-paper.
For example, want a SPI to UART interface, an I/O expander, or a UART-to-UART bridge? It’s all in there, and all for less than $0.30 for this chip.
Finally, of course, the MSP430 is supported by a number of low-cost tools and development kits.
Are you frustrated and overwhelmed trying to develop and bring your own hardware product to market? If so, now you can finally get help from lots of experienced product developers in the Hardware Academy.
32-bit microcontrollers are powerful devices with microprocessor-like features. Some of the advanced features include instruction pipelining, branch prediction, Nested Vectored Interrupts (NVI), Floating Point Units (FPU), memory protection, and on-board debuggers.
Instruction pipelining means that the processor core pre-fetches subsequent instructions ahead of time, and branch prediction pre-fetches the next instructions of both outcomes of an if-else condition, thus speeding up code execution.
NVI provides for interrupt priorities, where one interrupt can preempt a lower priority one.
FPU’s can do floating point calculations much faster than SW-implemented methods.
Memory protection ensures that application code cannot inadvertently over-write critical sections dedicated to the operating system, for example.
Finally, on-board debugging allows peeking into registers and other areas of the system to facilitate application code debugging. All of these together allow these microcontrollers to run large, fast, and robust applications.
In addition, their raw processing power means they can easily support Real Time Operating Systems (RTOS) that, in turn, provide multitasking capabilities.
Even though there are many 32-bit microcontrollers on the market, the focus in this note will be on the Arm Cortex-M-based devices, with a special mention of the ESP32 from Espressif.
Arm Holdings actually only designs processor core IPs, which they then license to various semiconductor vendors that incorporate them, along with some peripherals, into their own silicon chips. Numerous chip makers offer microcontrollers based on the Cortex-M architecture.
Two prominent vendors of Arm-based chips are Microchip with their SAM device line, and STMicroelectronics with their STM32 line of products.
The SAM devices deserve mention here due to their use in some Arduino-compatible boards. However, in general, the STM32 devices offer more choices, and should be given top consideration when designing in an embedded 32-bit microcontroller.
Arm Cortex-M cores come in many versions. The most popular ones are the M0/M0+, M1, M3, M4 and M7, each offering progressively higher performance. STM32 microcontrollers incorporate M0/M0+, M3, M4 or M7 cores.
Figure 1 shows the STM32 family of Arm Cortex-M-based microcontrollers, and their intended application segments.
Within each of the categories shown in figure 1, there are many families that can be selected to more closely match a given application.
For example, figure 2 shows the main variants available in the “mainstream” category, and their relative performance curve. Note that within each family itself, there are many variants with different combinations of peripherals and amounts of memory.
In fact, at this time, there are over three hundred STM32 microcontrollers available in this category.
STM32 hardware support: The STM32 family is supported by a wide variety of hardware tools provided both by ST Microelectronics, and third parties.
An inexpensive in-circuit debugger/programmer is the STLink V2. It is made by ST, and is available from places such as Digi-Key; however, very inexpensive clones are also available.
Both contain a STLink debugging interface. All that is needed is a computer with USB, running the appropriate software tool to evaluate the chosen microcontroller.
Discovery boards include additional external peripherals such as MEMs sensors, and capacitive touch plates. However, Nucleos have headers that are compatible with Arduino shields.
Before leaving this section, it is worth mentioning yet another very inexpensive development board. Commonly known as Blue Pill, this board sports a STM32F103 Cortex-M3-based chip, and costs less than $2.00 from some sources.
An appealing feature of this board is that it can be made compatible with Arduino so that the Arduino IDE, or Platform IO, can be used to write and download code for quick proof of concept designs.
While the process of making it Arduino compatible is a bit involved, there are several places that sell Arduino-ready boards. Just do a search for ‘STM32duino’.
STM32 software support: STMicroelectronics provides a version of ARM’s Mbed development suite for all its STM32 product line. This includes an IDE, compiler and an extensive set of libraries.
For developers that prefer to use other compilers, ST provides its STMCube. This is code generator software that produces initialization codes for the STM32 peripherals.
With that, there is no need to fully go through the bit settings of multiple registers to set up the peripherals such as IO ports or timers, for example.
The ESP32 is a microcontroller from Espressif Systems. As shown in figure 3, it has all the features on a typical 32-bit microcontroller.
However, what distinguishes this particular microcontroller from others is the inclusion of WiFi and Bluetooth hardware on the chip.
That includes not just the protocol stacks, but the actual radio transceivers as well. The ESP32 is also available as a small pre-certified module with integrated antenna.
For applications that require WiFi or Bluetooth connectivity, the ESP32 deserves serious consideration. The price of the ESP32 (both discrete chip and module) are very affordably priced, especially considering the number of features and performance packed into this chip.
The microcontroller is arguably the most important component you must select for your product. Changing to a new microcontroller mid-project can be a nightmare, so be sure you get this choice right upfront.
Other components in a design can commonly be changed without requiring massive, system-wide changes. That is not the case with the microcontroller which serves as the core of your product.
When picking a microcontroller you want to generally pick one that gives your product some room to grow. For example, if you determine that you require 16 GPIO pins then you don’t want to pick a microcontroller with only 16 GPIO pins.
What happens if you decide to add a new button in the future so you need another GPIO pin? If your microcontroller doesn’t give you room to grow, then you may find that seemly simple design upgrades in the future will require a massive redesign because a new microcontroller is necessary.
On the other hand, you don’t want to select more performance or features than you ever anticipate needing.
For instance, if your product simply monitors temperature and humidity then you won’t ever need an advanced 32-bit microcontroller running at hundreds of MHz. That would be overkill which will add unnecessary costs and design complexities to your product.
Instead, you need to find the sweet spot between having room to grow if needed, but yet not paying for performance or features you will never really need.
Are you frustrated and overwhelmed trying to develop and bring your own product to market? If so, now you can finally get the help you need to succeed!
In the Hardware Academy you will get direct access to me and numerous other engineers and experts to get all of your questions answered. Whether you‘re a new maker or you have a PhD in engineering, you’ll get the help you need to bring your product to market in the Hardware Academy.
Go to Source
Author: John Teel
Shoppers are up to one-third more likely to shell out for the premium option when the extra cost is expressed as an add-on, as opposed to a higher overall price, according to new research from the UBC Sauder School of Business.
The study, published recently in the Journal of Marketing Research, is the first of its kind to examine the effect of add-on pricing on product upgrades. The researchers say consumers could benefit from this research by being more aware of how pricing may influence their shopping decisions.
“Imagine booking a plane ticket — comparing a ticket that is $200 when it involves a two-hour layover with a ticket to fly direct for $250. Put another way, a regular ticket is $200, but upgrading to a direct flight costs $50 more. Which option is more appealing?” asked David Hardisty, study co-author and assistant professor of marketing and behavioural science at UBC Sauder.
The answer boils down to dollars and cents, said Hardisty. Consumers perceive $250 as expensive because the number is higher than the base price of $200, whereas $50 as an add-on price seems inexpensive.
“When you see ‘$50 more’ as an add-on price, it’s a smaller number than the total, and we focus on that smaller number,” said co-author Dale Griffin, professor and advisory council chair in consumer behaviour at UBC Sauder. “Mathematically, the prices are the same, and on consideration we can see that, but intuitively add-on prices just feel less expensive.”
The researchers found this effect applied whether participants were being asked to donate to a local food bank, buy a computer monitor, choose an external hard drive or even order breakfast. They also observed this effect when reminding consumers of the final price of their purchase, suggesting that the shift in preference does not occur because of deception or confusion, but rather because of how people justify their purchase decisions. However, the effect only occurs with pricing, not with other kinds of product upgrades. For example, if shoppers are looking at a two-terabyte hard drive, a four-terabyte hard drive is no more appealing than one that is presented as “two terabytes more.”
But not everyone is susceptible to the add-on pricing effect. “Individuals who are very careful and deliberate when making decisions naturally compare prices whether they are expressed as included or as add-ons,” Hardisty said.
The information could prove invaluable to retailers and other businesses who provide “premium” products and services — while also benefiting consumers the next time they’re offered an add-on price.
“Businesses typically earn higher margins on more expensive products, so it would be good for them to use the add-on price framing if they want to promote these kind of higher quality items,” said Hardisty. “For the consumer, it’s good to be aware of how these different price frames influence you. Why are they doing that? And what effect is that having on me? Now we know.”
Go to Source