Gadgetory


All Cool Mind-blowing Gadgets You Love in One Place

mbed - Everything you need to know!

2015-05-06
harms cortex a micro processors can be found in a bewildering range of devices from single board computers like the Raspberry Pi right up to servers like HP's moonshot course we also find them in our smart phones and our tablets needing our Chromebooks but I'm also make a range of microcontrollers known as the cortex M range and in fact they're probably more popular than the cortex a range last year arms partners ship some 4.4 billion microcontrollers hello there my name is Gary Simms from Andrew authority and today I want to talk about arms microcontrollers and the EM Bay platform a cordless M microcontroller is quite different to a cortex a microprocessor really there are two different ends of a scale there's no access to a GPU for example when you're using a microcontroller it doesn't have access to a sophisticated memory management unit for virtual addressing it runs a completely difference of speed and microcontroller might run it may be only 48 megahertz or 100 megahertz and it has only a tiny amount of RAM maybe 16 K or 32 K quite different to what we're expecting what we see with cortex a micro processors so what are they for well if your microwave oven has a small display on it it's probably using a microcontroller this control circuit inside your washing machine are probably using a microcontroller in fact we'll find them in wearables like the Fitbit that also uses a microcontroller rather than a micro processor we find them in cars in toys in smart locks in security systems in musical instruments we find them in anywhere that needs some kind of computer control but with a low amount of power and not much performance of course the big thing that is a blossoming at the moment is the Internet of Things and microcontrollers are perfect for the Internet of Things it's able to capture data talk to the network send it up to the cloud and allow us to make intelligent decisions on the information that we've received and this might sound quite complicated quite inaccessible but actually thanks to arms embed platform it isn't for just $12 you can get yourself a small board with a micro controller on it that allows you to start programming almost straightaway before going on it's worth mentioning the different microcontrollers in arms cortex-m range there are currently six microcontrollers the cortex M zero the M zero plus the M one the M 3 the M for and the m7 the M zero is the smallest and the silicon for this chip can fit onto the cross section or the hair as you go up the range the microcontrollers increasing complexity and speed the m3s micro architecture includes branch speculation and 32-bit Hardware divide while the m4 adds DSP extensions and the ability to use an optional floating-point unit the m7 is arms latest microcontroller and offers greater performance and more features for example it offers twice the DSP performance as the m4 the key thing about the M bed platform is all you need is a web browser and a USB connection to start programming the development environment is all web-based and from within your web browser you can write code and compile it to a binary when you plug the board into your computer via USB it appears as a flash drive to copy your program onto the board all you need to do is drag and drop the binary from the Downloads folder onto the drive hit the reset button and your board will start running the program that you have written the language of the embedded platform is C and C++ that means that anyone with high school level programming experience can start programming an embed board you don't need to worry about inventing the wheel again as the embed platform provides a whole range of libraries so that your board can communicate with other peripherals and with the outside world for examples there are libraries for networking USB LCDs displays audio monitors sensors NFC barcodes DSPs and so on later this year arm will release the next iteration of its embed platform which will include embed OS and the embed client embed OS is a new operating system designed for IOT devices that enables them to securely connect to the rest of the world it will be open source and is designed specifically for arms cortex-m range of microcontrollers the embed client is a set of core layer bridge which allows embed OS programs to be to cortex a based computers and board running Linux in other words you can develop an IOT or other network away a program using embed OS on a cortex and microcontroller and then simply just by recompiling ported to balls like the Raspberry Pi or the Odroid c1 at the time of writing there are over 50 boards available for the embed platform everything from simple cortex m0 base board with no integrated peripherals to board with built-in displays accelerometers networking on Wi-Fi there are even bought of cellular connectivity board with Bluetooth and there's even a robot to help you get an idea of what you can do with a cortex-m microcontrollers and with the embed platform I'm going to look at four boards and see what you can do with each one of them the first board is the freedom KL 25 0 free scale this board uses a cortex m+ core clocked 48 megahertz and includes 16 K of RAM plus 128 K a flash it comes with a built-in three color LED a 3-axis accelerometer and a capacitive touch sensor this makes a great starter board and you can pick one up for just $13 in the world of microcontrollers the simplest program you can write is one that will flash the LED on and off is the equivalent to the hello world program that is so often used during programming language tutorials ok so what I want to show you now is how you write a very simple program the blinking LED program the hello world program or the embed world to see how easy it is to put it onto one of these Balter first we go to embed org then over here at the right we click on the developer site and I've already logged in with my account and then up here at the top it says compiler so we go there that'll open up another tab and we get an integrated IDE here in the web browser now as you can see there's nothing in the web browser at the moment so I'm going to go to import and this will give me a list of all the different example projects that are available on the embed web site and the first one I want to import now is embed blinky just turns the LED on and off we hit import yep horn we important that and here it is now just one thing to know he's helped here at the right top right-hand side I've already selected the ball that I'm using you can click on that button and in hand select any boards that you like that are available on the embed website I've got that one board at the moment so we're using that one now if we double-click on main.cpp we'll see a very simple program this one says that the variable my lid is connected to the lid and then here my lid we turn the lid on and off again with a slight pause in between nothing very difficult it's an infinite loop here while one would go round and round around forever switching that LED on and off so to get it what we do is hit the compile button this will compile the program on embeds website and you can see it's downloaded a file here embed blinky dot bin now I've got my downloads folder already open here there's the father's has been downloaded from the web browser and here dry an e as you can see has come from the actual ball that I've plugged in when you plug it in it appears as a flash drive and all I need to do is drag the file from here to here and it will program the board and start running it so here I have the board plugged into my laptop USB connector at this and giving power to the board and also allows data to be transferred to it it allows it to be programmed this end is connected in to my laptop what's this green light when I copy over the file it will flash to show the file is being reprogrammed the board is being reprogrammed and then watch to see what happens with this LED here so here we go we're going to copy over the file onto the board notice the flashing LED the green one and there's the red one flashing that's the blinky program that we just compiled our next board is the Nordic n RF five one eight two two this borders is a cortex m0 microcontroller clocked just 16 megahertz and includes 16 K of RAM and 128 K of flash in terms of performance that might seem like a step backwards from the KL 25 but the this board is special in that it has built-in Bluetooth 4.1 and includes a battery slot so the board can be independently powered by a single 2032 coin cell battery the M 0 is designed for the lowest possible power usage and is therefore perfect for standalone Bluetooth applications and this is where Android comes in like a Fitbit or other Vette wearables this ball is the perfect building block for devices that will communicate with an Android smartphone over Bluetooth Low Energy now here I've got the Nordic board with the Bluetooth built-in capabilities Bluetooth Low Energy again connected via USB to give it power that this one has got a slot for a battery not much else is happening here on the board we can see this little LED is flashing here ok but if we get out my Android phone better see the Bluetooth signals that this device is sending out so here I am running the ble scanner as you can see the first entry is for my Fitbit the second entry is for this ball is advertising itself as h RM one which is something you can define in the code if we connect to it now we better see what the scanner is picking up is pinging all these different services we're interested in the heart rate service let's click on that there's lots of other things it can tell you but one of them is the heart rate measurement which we want to go to there we hit notification and we can see the heart rate information coming in 161 beats per minute 160 260 will just keep on going up to 175 then it cycles back down to a hundred again that's just something set in the code because it is really just a fake heartbeat information that is which is using in his up but there he goes come back down to a hundred now and it will just cycle round and round around but this shows the Bluetooth working on that board so how about that for instead of things devices a Bluetooth smart phone now just imagine what you could create next up is the embed LPC 1768 and its application board the 1768 doesn't look like much on the outside but on the inside it's quite different as well as sporting a cortex m3 processor it has 32 K of memory and 512 K of flash but more importantly has for built-in Ethernet and USB the power of the LPC 1768 can be seen when you connect it to its application board the board comes with an impressive set of peripherals and sensors including a graphics LCD an rj45 Ethernet connector a five-way joystick two potentiometers a speaker a three axis accelerometer two servo motor headers a temperature sensor and a socket for a ZigBee although you won't find a finished product based around this application board in its prototype form it certainly makes a good springboard for building something like an IOT device for example you can use the temperature sensor on the board together with an Ethernet connection to periodically upload the current room temperature to cloud services like things speak it would also be possible to integrate the board with your Android device again using a service like things speak you could write an app to send commands to your LPC 1768 to perform home automation tasks ask for specific sensor data or even get to perform a task for you like tweeting or sending an email in fact the only limit is your imagination if you want something that's a bit more fun than IOT devices then I recommend the M Bach from outrageous circuits it is an n-bit enabled robot with the reflective sensors LEDs and a buzzer on first power up and bot is loaded with software that makes it dance on a table without falling off it does this by reading the two reflective sensors on the front if it detects no reflection it knows that is off the edge of the table and will back up and turn it only cost $30 and provides a great introduction to microcontroller programming outrageous circuit provides all of the source code for the default program and also provides full documentation including schematics pin outs and a hackers guide as I mentioned earlier that over 50 boards available for the embayed platform this number is growing all of the time the board's action today arranges a brief overview of some of the things you can achieve with a microcontroller and of course once you add connectivity to your smartphone once you add connectivity to the cloud the possibilities are endless well my name's Gary Sims from Andrew authority I hope you enjoyed this video if you did please give it a thumbs up also don't forget to use the comments below to tell me what you think about arm in bed platform also don't forget to subscribe to and Roth auratus YouTube channel and as for me I'll see you in my next video
We are a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for us to earn fees by linking to Amazon.com and affiliated sites.