Microcontroller Architecture for Embedded Programming

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
well welcome to microcontroller architecture for embedded programming I am Todd's ebert and as I mentioned earlier this is me something of a survey of the architecture of microcontrollers a little bit of micro computers and how it relates to how you may get things done on them I'll post a slides of links later so people talk about embedded what is embedded basically embedded is anytime you put a can a microcontroller or a micro computer inside of something such that it's activity is secondary to whatever it is that people see on the outside versus going to their laptop or desktop you may not know this but modern cars have approximately a dozen microcontrollers or micro computers in them well well I guess depends on how you measure it right yeah yeah there's there's this riddled with them your washing machine the thing third from the left is a tickle-me-elmo if you take the clothes off frightening isn't it all modern cameras and whatnot so what does it micro controller the micro controller is often referred to as an MCU because it's got fewer syllables right or the little mu C symbol and micro processors or MP use or UPS generally microcontrollers have less RAM they have less of everything except IO generally and generally have some kind of storage right on the die Ram that is micro processors generally do you would RAM that's off the die I have you know you put your RAM sims in or whatever they use now and then we get into cases like SOC system on chips which have some of all of it what you'd normally find in a computer like a desktop computer jammed into one package will get more to that later I covered this basically they're slower generally they're simpler in some ways they can be much less expensive anywhere from three three cents for a microcontroller up to like twenty dollars generally they don't run in an OS although they can run a real-time operating system there's different types of memory in them that sometimes comes up when you're trying to program them there's I'm not going to get into this too much but there's Harvard and von Neumann you may remember that from your college computer science classes and you were like what is this important becomes important when you're doing microcontrollers I'm skipping through some of these because we have a lot to cover and I suspect there'll be questions so microcontrollers offer protected address spaces memory management union units things like that or privileged execution like you might find in a regular microprocessor that runs a regular OS but many times they don't so if you have code running different places you have to be careful that you don't write over your own memory or write over your own code depending on the architecture because there's no one to stop you which also means if you're trying to secure the device to make sure no one else can write over because they can make your code do whatever they want program memory generally is non-volatile usually flash or EEPROM flash ram is generally faster so some microcontrollers will copy the program into RAM if they have enough RAM to run it from there it's faster so on a microcontroller instead of the whatever I know I think my clap table has 32 gigs of RAM they usually have like 16 caged 128 K is pretty common which means you have a whole different idea of how you're going to code data memory can be anywhere generally from 8 kilobytes to like 256 kilobytes which isn't a whole lot you know and some have non-volatile Ram where you can store stuff if you like loose power or if you're trying to keep logging data things like that but usually it's very small often times you're gonna want to put that off chip anyway instruction clocks okay we don't have generally 4 gigahertz microcontrollers but they can get up to like about 1 gigahertz sometimes higher but speeds more like 40 megahertz so like something like that is much more common so you don't have generally the raw processing power you would and for those who don't remember if you have like a 16 megahertz clock a cycle which becomes important when you're programming for these things is basically the reciprocal of the clock speed so a cycle for a 16 megahertz clock is 0.025 microseconds which doesn't seem like a lot but it becomes him timing becomes important when you're doing certain things in a microcontroller Oh especially since every every instruction a microcontroller runs can take usually more than one cycle can be as many as a dozen or more like microprocessors some microcontrollers are superscalar they can execute multiple instructions per once sometimes even have pipelining you may not know what these all mean but as you get more powerful and these different architectures come into play your microcontroller becomes less deterministic in its timing because you don't know necessarily how long each instruction is going to take basically this is about speed and performance not that important right now you Construction Set you know even like something bit like division can take 17 cycles so that's that's quite a while it gets expensive especially if you have a small microcontroller there's ways to get around this look-up tables approximations there's all kinds of algorithms out there you can implement if if it doesn't actually include like subtract or divide I mean or multiply or divide and then like things we always use in computer science like module requires division it's not easy for a computer to do or a microcontroller floating point math we're pretty rare in microcontrollers again you have to come up with algorithms to kind of get around it I've mentioned one called binary scaling you can look up sometimes they put floating-point units on like a what's called a peripheral or a different part of the chip and you have to context switch just to get the math going so there's a cost of a context switch so you have to decide if it's worth while microcontrollers have Indian Asst which is important if you're trying to transfer data between devices because because make sure they have the same it's basically which one it which byte is first a least significant byte or the most significant byte you know if you're doing desktop development this never comes up essentially okay physical aspects how am i doing on time actually I'm going through this pretty quick so if you have any questions stop me okay so some definitions and I see is what's on a die it's a piece of silicon here's a blow-up of an atmel eighty tiny 8:13 a which is really simple microcontroller obviously they're made of there's various sections on the die and each section has all kinds of circuits made of primarily transistors and each transistor is you know etched into the silicon in the for to comprise logic gates and that's what makes computers work the package is what holds the die so you can get tiny here's a pic 10 F and a SOT 23 package and you can see it's kind of small so you can put these things in anything here's one of my favorite which is an 80 tiny 85 it's an 8 pin dip dual inline package and then you get these gigantic ones that look like desktop processors with hundreds of pins which are also nearly impossible to solder if you're like a hobbyist so so how do we get more supporting components and associated things into a chip well there's different solutions we have somebody called the system-on-chip SOC basically they've put everything on one die the CPU Ram everything else they can that basically is logic based then they came up with basically multi chip modules basically they put multiple dies in the package and they stack them they put them side-by-side and they connect them with tiny wires and the little chips inside of things like that are called chip 'lets and we'll talk more about that later then there's system in package s IP and they basically stack the dies vertically which shapes space and you can put more in there then you get sops system on package and like these terms like so confusing well the industry came up with them but they are what they are and the nice thing about the SOP is it can include discrete components like capacitors and inductors and antennas you can basically have everything in one package and basically just connect your i/o and your power and then there's something called a customizable system-on-chip which generally is a subset in FPGA thus the customizable part I'll talk more about FPGAs later so it's a simple like a sideview diagram this is what they they look like so you can see can you see my cursor yeah you can nice so you can see an SOC everything is side by side and in MCM these are the chip 'let's like this little box here they can put them side by side and and you can see there's wires going through the substrate and then system in package they stack them vertically to save space which means but things have to commit be connected vertically instead of going to the substrate and SOP they kind of throw everything in there and whatever way the the result of this is whereas a chip used to do one thing now it can do pretty much an entire computer in a package or Wi-Fi communications and things that like that here's an example of the this is the the TI SI p this is the one to use in the BeagleBone black I think I thought I wrote that down but it's nice because it actually has an ARM Cortex 3 micro processor and 2 of these root Pru programmable real-time units which is basically a micro as a micro controller with a deterministic instruction set and it's all in this one package so you could just pop it into your designs or into your breadboard whatever you're doing yeah well well okay so yes interrupts can definitely throw off your deterministic but like a microcontrollers used to be basically every instruction took so many cycles so you could just if you needed something to happen like every 24 cycles you knew you can only get three instructions going right but now with like pipelining and superscalar and different instructions taking different number of cycles it's hard to know how long something is going to take because even if you're kind of the instructions and motorcycles they take wait superscalar and pipelining like you don't really know it's kind of up to the chip but with something like the PRU you know everything there's no superscalar there's no pipelining everything is the same number but if you program using interrupts which is a generally good idea do you have to take that into account so I'll talk about that a little but many things that are might control come down to timing and if you don't know how things are timed then it gets even more complicated so you can see this over here includes EEPROM it's got a LDO power anyway okay so I think Chiclets are really exciting there's been a lot of talk about them over a couple last couple years they can use in MCM s/s IPs and SOPs and that means they're basically commodity tried and true reusable or cost effective pieces of silicon that do one thing basically either it's the memory or it's a cache or it's a logic block or it's the processor itself and basically kind of like Legos you can kind of stack these things in a package and get basically whatever you want out of that chip and since you're not trying to make this huge piece of silicon which gets expensive and you have more of a chance of a failure because you've had this big piece of silicon if you break all the functions up into their own pieces this look and you have a much better chance of having higher yields and lower costs so manufacturers are pretty excited about this there's been some issues about durability and manufacturability and like all the vendors have their own standards but we'll talk more about that too oh right now we'll talk about it so the Open Compute projects open domain specific arc architecture odo DSA started in 2018 and basically they're trying to standardize how all the chip let's talk to each other it's basically similar to an OSI ISO model if people remember that from way back when probably Comp Sci class or whatever or networking this way you can basically take cross platform cross vendor commodity triplets and get them all to talk to each other which basically means you can make any chip from whatever parts you feel or as best and then the Linux Foundation started the chips alliance way back in 2009 and they're more about making IP available say if a code here organization develops and hosts high quality open source bla bla bla IP and interconnect IP and open source software I don't know they're making a lot of progress but is promising and so this way not only will you be able to have a chip but like all the components in the chip will be open source because we talked about open source there's like a couple vendors upstairs with like open source laptops or open source routers but when you get down to it the chip isn't right but we're moving towards a time when that's actually possible in even Intel contributed the AIB a royalty-free physical layer connecting semiconductors in a dye so even Intel I was surprised and there's like a company called Z glue basically offering custom MCM chips and small batches so theoretically if you had your what you're an IOT vendor or even a Kickstarter could theoretically order thousand ten thousand custom chips based on maybe if you got lucky maybe all open-source Chiclets may be closed soon we'll see but I think that's pretty exciting okay talk about something different so in a microcontroller we have something called peripherals and a peripheral is a type of interface that's on the die itself and the interesting thing about them is they run independent of your code cycles so even if your code is doing something and you have a PWM that's a pulse width modulation going on that's it would be a peripheral running on a pin at like 50 percent duty cycle it keeps toggling back and forth regardless of what your code is doing so it doesn't really cost you many things that's not really multi processing but they run independent and there's lots of different peripherals that can show up on various microcontrollers and lot digital converters da sees a serial peripheral interface you probably heard of a spy connector or spy bus there's Twi to two wire interfaces these are all communication types sound interconnects USB Ethernet Wi-Fi I'm sure you're all aware of all these things can be on the die or not depending on the microcontroller you buy I feel like I skipped no I think it's coming later in the in the slides timers and counters are really common peripherals to have their grade again for timing if you need to know when some kind of time has passed control error networks there that ones popular in cars as we talked about how many dozens or maybe hundreds of microcontrollers they have in modern cars real time clocks GPIO is a general purpose i/o various memory interfaces and as I mentioned before floating-point units possibly comparators you arts which is basically the serial communication watchdog and alaric communication protocol called one wire some special-purpose microcontrollers have all things from memory different memory controllers crypto units graphics infrared motor controllers you name it if some manufacturer thought there was a market to put some kind of peripheral in an on a die they've done it and there are many generally as microcontrollers get more expensive or larger and usually faster they include more types of peripherals and often multiples of H it's not uncommon to see two three four different you are it's a couple spy buses dozens of GPIO s but some microcontrollers have as few as six pins and you get like one because you just wanted to do one thing uh kind of covered this generally each peripheral is and historically they were tied to one pin so like that one pin did a GPIO and maybe it did something else but that was it and if you had to use that pin for GPIO but you also wanted it for you are you were out of luck most of the ones we're seeing newer have like what's called crossbar or matrix allocations so you can basically assign a GPIO to whatever pin you want which also makes board layout easier because you don't have now a GPIO pin on the wrong side of the chip from where it needs to go I know how many people here are familiar wood board design but it can be a real pain in the neck now if you don't have a peripheral and you want to do like say I to C or a UART and you just have GPIO s you can do something called bit banging which is basically timing all the signals you need when you need them to happen and basically reproduce the entire protocol and code which for things like cereal and UART is pretty easy if I want to do I to see bit banging find a library because it's really easy to get wrong and this is where things like deterministic B comes into play because if you you have to really pay attention to get to timing right into her point like if you have interrupts keep interrupting your machine you're not going to have the timing right so if you need the peripheral it's best to get it yeah on the chip but if you have to you can you can bit bang it any questions so far I feel like I'm covering a lot sure you know the peripherals are on the die right you basically will talk about memory map but most peripherals are what we called memory mapped so how many people are familiar with UNIX device drivers hey UNIX stuff is file mapped right if we can't want to get I po IO you write or read from a file and a microcontroller their memory mapped so there is no file system right so all you can do is there's a part of memory and there's some byte someplace and it's all gonna be in the datasheet which from my controller can be like a thousand pages and I'm not exaggerating the you'd write to a particular byte in a particularly ILO output or in this case a PWM let's say now and they all vary across manufacturers and across line so theoretically you could say okay I want this pin to be a PWM I'm gonna you know flip a bit to enable it and then I'm gonna flip a bit another bit to say it's an output and then I'm I'm gonna flip another bit to set into a particular mode and I'm gonna write to a byte like say 128 to make it a 50% duty cycle and then you're gonna have to write another byte that's gonna be like the frequency and there's probably clock dividers and things like I'm gonna do write all that and then something of program but once you write all those bits and bytes it just keeps doing it yeah I know that was probably a lot wasn't plain to get into that but no no it's quite all right yeah cool and I often I do it a second session where I get more into the coding so it's speaking of pins here's the eighty tiny eighty-five one of my favorite little I use it for everything type of cheap little process microcontroller and you can see like here pin one is PC inter up five it's also the reset pin also ATC zero and I don't remember what DW is up to that my head so this one has multiple you know three four different functions available on each pin so to kind of like the last question if you want to use it that particular pin for a certain thing you have to go tell the microcontroller it's for a particular thing and then lots of bits and probably people have heard of oh boy on the spot I'll get back to think of it and this is a simple microcontroller oh I know or do we know how many people were familiar with Arduino right so you know it's C ish it's really C C++ but they put all they make all these macros and these macros allow you to set like oh sit pin 1 to B output right well there's just a macro and what it's doing it's it's flipping all those bits and doing them if you want channel 1 it's got a map channel 1 or pin 1 rather to a particular memory region and then it flips all the proper bits it does it all for you but like in your code use right you know pin 1 output right and it all that the guts is hidden below which is nice because it's a nice level abstraction if you're kind of just getting into it but you can do all those things you can you can write arduino code without using any of the macros you can just write it and see but you just have to look up what all the the bytes are okay here's an 80 tiny 8:28 a little more complex here there's lots of different pins doing lots of different things and they've color-coded like power and a log or a serial interface or a timer and then you get this tea I think is the same tea I from the BeagleBone went on the beaglebones and here they don't even try to put all the different peripherals available on each pin because it's just it just becomes unreasonable but at least you know which pin is called what okay power management you know I suppose you have a laptop you're concerned about power but you know if you have desktop it's just plugged into a wall no one really cares how much power it takes if you have a microcontroller most likely you know it might be battery-operated you know if it's running on a coin so you have to really be cognizant of how much power you're drawing you know what I guess we should be green and we should be you know keep this in mind somehow but depending on the microcontroller they have various states you can they have like low-power sleep and really it depends on the vendor and the product line sometimes you can change the clock speed but you can usually get them down to really really low like in the tens of nano amps so when these things going to like these low sleep states they can really take you know almost nothing at all I've seen people run microcontroller is on the coin sell for a year because they'd only wake up when it needs to wake up usually by an interrupt and then you have to pay attention to what peripherals because in certain states certain peripherals will be not available because they take too much power or or you might have to do certain things like you want to some peripherals will just draw power like if you set up a pin pull up and it's gonna pull it's going to take power because you're doing a pull-up everybody know where to pull up or a pull down is okay so generally if you have a pin and you send a high out it's high you know 3.3 volts 5 volts whatever happens to be 1.8 volts if you put low it's zero but if you don't do either one it's basically an indeterminate state and if it's in an indeterminate state and something tries to read it it could be anything it could be high it could be load it doesn't matter right it depends on inductances and all kinds of things you can't really control for so you have to pull up or pull down the the line usually with a resistor either to your VCC or to your ground in that way you keep your signal in a determinate state there there's the 30-second version some microcontrollers have the lovely ability to be put into a sleep state wait and unless you've remembered to tell it how to wake up it won't so that's probably good to remember anything else on that section any other questions okay programming this isn't like basically how to program one but like physically how to program one because you can't just like load a DVD or call up your editor on the microcontroller at some point in time we had to like erase them using UV light sources and crazy crap like that but nowadays generally all you need is a USB to TTL serial adapter like the one pictured and they're cheap even if you buy a name-brand and then you get development boards like the Arduino which you just plug a USB cable into so it doesn't get too much easier than that then there's something called an in an IC ESP in circuits serial programmer or in system programmer basically they allow you to click something into your board so you can program it if you don't already have if it doesn't already take like the serial TTL or a USB because it used to be you had to remove the chip and put it in a special programmer which probably cost a lot of money but now generally they've made it a lot easier then there's a JTAG which is joint action test action group whatever no one calls it that JTAG jtag connector has some number of pins and you can program and debug your code as a won't getting in this too much puts a nice fun thing about my controllers is once the code is running you have no idea what's going on in there there's no console right there so screen I mean sometimes it can be but the vast majority of times does not so there's all kinds of techniques you can do to debug them but I'm not covering that in this talk how are we doing on time I got 20 minutes ok vendor-specific programmers slash debuggers are available at mill ayase there's a nice open source one called one bit squares black magic probe for arm it's on the left the the pic microchip pic programmers on the right nowadays they're making it even easier to code like some of the dev boards like from Adafruit you plug them into USB and it mounts as a derive and you can use your favorite editor to edit usually it's a Python or a circuit python program you can edit it as soon as you save it it reboots it restarts to control the the board and your code is live I mean that's super simple it's a good place to start if you're not already in this kind of arena I mentioned debugging yeah debugging gets funny but in best case you can do things like breakpoints stepovers watches stuff like that like the black magic probe is see that thing in action it is like magic oh I did talk about this if you don't have hardware debugging you can do things like writing through a serial connection or toggling an LED or driving a 7 segment LD display and outputting like an error code the thing about this is they all take system cycles right so if it you're trying to do something timing sensitive and then you take time out to write something to an LED you're now messing up your timing and it's called it creates what we call heisenbugs uncertainty okay interrupts briefly basically we hardware software generated and they call what's usually called an interrupt service routine or interrupt handler code usually microcontrollers are simple like you have one interrupts and you go to the interrupt routine and you can't serve us another interrupt until you're done with that code are the ones offer priority interrupts or interrupts within interrupts but if you have to deal with interrupts within interrupts then your brain will hurt but then again if you don't handle your inter up quick enough you may miss the nest next interrupts Oh software interrupts can be generated by user codes stack overflows part of your code throwing a software interrupts and hardware interrupts are generally generated by peripherals such as GPIO like you want to know when data shows up right or a peripheral like your LED your inner IR peripheral receiver has received data and it wants to let your code know how does it let your code know it throws an interrupt and you grab the inter up and then you go grab the data interrupt driven code is basically how you want to do things all the ways you have to pull and you don't want to pull so learn interrupts if you don't already know them it's a little more complex takes a little more effort but it's the right way to go real-time operating systems basically are basically like kind of like the curling or scheduling portion of a like a full operating system that can run under my controller to kind of help you out if you're trying to juggle multiple real-time you know input outputs gently can't run them on the simplest of microcontrollers because they simply just don't have enough cycles there's a number of commercial ones and open-source ones so configuration bits so they are often called fuses or fuse bits and they're basically out-of-band non-volatile toggles that change the way your processor work everything from clock speed divider watchdog timers debugger enable like a lot of commercial products you buy will have JTAG disable debuggers disabled and it's a it's a permanent fuse so and the commercial product they'll disable all that so you can't go in there and hack it of course if they do you can't fix it and if they do enable it you might fix it or you can hack it so it's a double-edged sword I suppose yeah there are digi-key which is a popular distributor of all things electronics this seventy six thousand different microcontroller SKUs it's a little overwhelming basically there's arms and MIPS they license out their cores so for other people to manufacture I think the important thing to know about this is the IP that goes into a microcontroller can be used other places I'll get to that later and something called but peripherals and hardware abstraction layers vary a lot so you know your always gonna be reading to the datasheet we have the microchip at mill 80 mega and arm variants the ones you see in there do we know packet products a lot microchip pics I know a lot of people were really into pics for a long time TI makes a bunch that are popular like the am 335 which part was the Beagle boards the esp8266 and 80s P 32 are relatively new they're really great they have Wi-Fi and bluetooth especially SP 32 you can do a lot of fun stuff parallax propeller although I haven't heard from them in a couple years and a couple more SDM microcontrollers makes it really popular SDM 8 and SDM 32 lines now it brings us to the RISC V foundation people heard about these guys completely open-source course all kinds of opcode extensions and basically you can use them as long as you become a member of the Foundation which is you know a nominal cost is really great because all the chip designs used to be all proprietary but now we have a real successful core that's open source I kind of taught already talked about this sci-fi is a company that's been producing a number of open source boards using the open source risk risk 5 processors and everybody's getting on board like not a week goes by I don't hear about some big manufacturer like Western Digital and Vidya Sager Qualcomm all these people have have joined the foundation and are going to start using open source cores FPGAs is the last section hopeful of enough time so FPGAs are phil programmable gate arrays they're basically a unique type of IC which basically allows you to change what the chip does because you can change how the chip is basically wired inside how many people are familiar with FPGA is oh okay good y'all know so this is a comparison to basically general-purpose processors which you know they have their own defined op codes they have you know whatever whatever they do is the way you get it but in FPGA you can basically gonna quote reprogram to basically do what you want how you want and you're basically they laying out logic blocks you're not coding as in like C you're fundamentally changing the way the processor routes data inside the chip from logic block to logic block so FPGAs are used for developing development leading to a6 or directly in products sometimes where you don't have enough quantity to make an ASIC or it's just not the right there's no out of those 76,000 my microcontroller SKUs it's just one of them just doesn't fit your needs quite right sometimes it's a price or if you want to iterate if you have a you know a new product and you're iterating on that thing a lot fp8 FPGA is a way to go because you can just keep changing it and I guess you've had a bug you can fix the bug too versus whereas if there's a bug in your microcontroller it shows up the near router and it drives every developer past that point mad yeah always read the errata so here's some history they precursor started way back in the 1970s there's different variations I'm gonna skip all this stuff for now so we have time for questions I guess the thing I point out about this slide is generally they're measured in logic blocks and it comes kind of comes down to marketing and what the manufacturer wants to do sometimes they're called Luntz or labs or a CEO bees or logic box and everybody's idea of what a logic block is is different like how many NAND gates does it have how many end gates does it have well it depends on the manufacturer so you can't say oh look this one's got ten thousand logic blocks and the other one's got twenty thousand logic blocks these numbers are not comparable okay so FPGAs really started in the 1980s one thing different from some of the precursors is they're basically a blank slate on power-on so you have to pull in their configuration from some external memory you know some kind of non-volatile memory and that's what makes the fpga become whatever it is you want it to become every with me so far okay FPGAs are programmed in what's called a HDL hardware description language and this is the type of thing that actually arm licenses to the HDL are not the HDL but in an HDL the design of the core from like arm is what they licensed to other manufacturers who want to produce like an arm core and while some HDL look like code they're not compiled they don't they're not interpreted they don't execute the way you might think if you're a coder there's different HDL like Verilog or system very log or VHDL and there's a number of EDA tools electronic design can't remember what ETA stands for sorry the nice thing about FPGA is you can take your H you can take your code and run it in a simulator beforehand and there you can do something called formal Val verification which uses math analysis to actually guarantee that the what the expected output is will actually be the output I mean we never see this in regular coding right so you can run tests but this it verifies it formerly in math which is pretty good pretty good sign that it's gonna work here's some sample Vera log simply because it kind of looks like C but it's not the funny thing about most these things is all the code happens simultaneously unless you tell it not to so code execution does not go from top down or things like that it all happens yeah it's it's hard to wrap your brain around but it's really fascinating historically all the FBA fpga tool chains were all proprietary close source secret and stupid expensive and largely undocumented but now we have something called simple flow which is a completely open-source tool chain for programming a number of families of FPGAs which is pretty exciting because you can actually get an open source core from risk 5 and using an open source tool chain put it on an FPGA on the FPGA so far or not open source what we're getting closer and I've talked to some of these guys like the amount of effort that went into doing this tool chain is immense because they basically had to reverse engineer bit streams and this is a non-trivial task so if you see those guys thank them there's a number of open source FPGA poor it's like the Icebreaker fpga and so off like 9 minutes right i think so kind of touched on this some prostitue core such as risk 5 or arm or available in HDL so you can you can basically download that core to your FPGA and say it's a risk 5 without a floating-point and then you later you realize oh my application really needs floating-point just go grab a different core put that onto your FPGA and now you've got all the functionality you need so then if you're going to use like a microcontroller core or even a microcomputer core once you get to fpga running the core you want you would then you know connect to it and actually program it and see your load and you know so there's really two steps you have to program court and then you have to actually put your executable code on it so fpga is basically they're inherently multi processing because you can have any number of cores in there as many as you want really that will fit so they can be massively parallel basically have any peripheral you you you could possibly want flexible as i mentioned before you can reconfigure them they're a little bit slower generally they don't have the performance as a dedicated microcontroller they generally take more power and they're more expensive but you can get them now simpler ones for just a couple dollars each which is huge because they used to be like many hundreds of dollars some there's hybrids like some FPGAs come with hard block microcontroller codes embedded them in them so you can't change that part but you can change the FPGA part around them and then now some regular microcontrollers have what they call custom configuration logic or whatever on the marketing term they have for that brand and they have certain sections of your regular microcontroller you can configure to do certain things so it's interesting how there's now a like a spectrum of completely dedicated to completely flexible and various stages in between in fact even the new Arduino you know uno Wi-Fi includes some custom configuration logic blocks in there oh and that's me so I made it questions sure so the question is while our tosses can help you with real time especially when you have multiple real time things running if you move your want to move your car code from one microcontroller or to another all the as I mentioned before all the peripherals change all the ways to access them change so he wants to know are there peripheral libraries that can be used like abstractions that can be used across product lines and frankly I don't know of any I mean that's basically what our Duino does right for all the ones Arduino handles of course it's not an artist but they abstract so if you just said set pin one to output it has all these ways of trying to figure out which chip you're on what is actually pin one and then flipping all the bits that's why it's a little bit slower because it has to do all this figuring things out you know if if you really think you might be changing microcontrollers or whatever it's probably best to abstract in the code yourself and then you can do like pound defines if you if you have to support multiple microcontrollers at the same time but at least if you write your code modular and abstract all your i/o at least you have a fighting chance later on yeah agreed the learning impact going even learning one chip and how to access all its peripherals now if you're gonna use like open source tools and you're just going to use you know like C compiler and just your favorite text editor and stuff like that you're not going to get anything like that but if you use like at Mel's commercial IDE it usually comes with it's all kinds of bits of code in ways you can just drag and drop like routines to axis like I to see easier but that's all vendor-specific yeah I'm not sure if that help but anyone else okay good well hopefully I gave you a a good overview of what microcontroller architecture is like and what you're facing if you get into it and well thanks for coming
Info
Channel: Southern California Linux Expo
Views: 223
Rating: 5 out of 5
Keywords:
Id: M3blhel59Mc
Channel Id: undefined
Length: 54min 19sec (3259 seconds)
Published: Thu Apr 09 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.