Embedded - 107: Until They Are Spaghetti

Episode Date: July 1, 2015

We talked to Craig Cook about learning embedded systems. He recently attended an embedded edX course through University of Texas.   The microcontroller and boards used in the course Craig's next cou...rse will be Interactive Python through Coursera As we discussed Craig's alarm clock we mentioned many parts including: FM Module ESP8266 WiFi Module Electric Imp (Sparkfun or Digikey, don't forget the April breakout board) Chris has also been looking at Particle.io's Photon board for WiFi + cloud development. This will be mentioned on other shows (as well as on The Amp Hour).

Transcript
Discussion (0)
Starting point is 00:00:00 Welcome to Embedded FM, the show for people who love building gadgets. I'm Elisa White with Christopher White. Today we're going to talk to Craig Cook about getting into embedded systems. Before we get started, SolidCon went well. They took a video of my inertial sensor talk, and I will let you know when they post it. Probably in about three weeks. Hi, Craig. Thanks for joining us today. Hey.
Starting point is 00:00:32 Could you tell us a bit about yourself? Most of my career, I've been doing systems administration work, which is things like servers and desktops and operating systems. Some of you may guess, I used to pull my toys apart to see how they worked. And usually I got them back together again. It's always tough to get them back together again. I still don't succeed on that one. But you have a lovely accent. You're based in Raleigh, North Carolina now, but that's not a southern accent.
Starting point is 00:01:04 Where did you come from? It's sort of southern, but really south. I was born in New Zealand and also lived in Australia, so my accent is a mix of New Zealand and Australian accents. Cool. So you're not an embedded guy. You've got a background in IT, actually. Yes. I'm very new to the embedded systems world. a background in IT, actually. Yes, yes. I'm very new to the embedded systems world. Actually, that's what we wanted to talk about.
Starting point is 00:01:30 You took a class, an EDX class, which is one of these online mini-week classes. Could you tell us more about it? Sure. So there's a class called, or there's a site called edX, and it's known as a MOOC, a massive online open course. And from January to May this year, I did a class called Embedded Systems. And that was hosted by the University of Texas.
Starting point is 00:01:58 And partially sponsored by TI. Yes, TI and ARM. There was a mention of them at the start of the class, but we didn't hear anything more about them during the class. Oh, okay. So it wasn't an advertisement? No, not at all. Well, if it was, it was very subtle. I always worry about free things. Either I'm not the customer, I'm the product, or it's subtly an ad and I have to figure that out. So I don't really like free things as much as I should. There's an eight-hour class on why this chip is the best chip ever. Yes, I think I've been to that class.
Starting point is 00:02:35 But this is 15 weeks? So it's not just eight hours. And how many hours per week was it? The guidelines said between 10 and 15 hours but most weeks i probably spent more than 20 wow that's a serious commitment that's that's like you know grad school level of course contact yeah that's one real course it was a lot more intense than what i expected but yeah it was a lot of fun. And so what did you, what were the highlights of the course? What were the things you learned?
Starting point is 00:03:16 What was the best parts? I learned that embedded systems are complicated little things. Yes, exactly. And they're everywhere. They're in a lot more places than I ever expected, like things like your microwave and inside your printer. It's like, after you hear about that, it's like, oh, of course they are. But it's not something you think about every day. Well, not so much you, but yes, I actually spend most of my time telling people that embedded systems are computers that aren't actually computers. Well, it's, yeah, it's writing software for things that aren't actually computers. Well, it's, yeah. It's writing software for things that aren't computers. Exactly. And microwaves, I often use that as something people don't ever think have software in them. But of course they must.
Starting point is 00:03:56 So this class takes some, you got hardware too, didn't you? I mean, that part wasn't free. That was like 40, 50 bucks. Yeah, I spent around $50 on hardware. So that was a Texas Instrument board, a launchpad, and you bought that from various different sites. I ended up buying mine from Element 14. Which, of course, we approve of because they do sponsor our blog.
Starting point is 00:04:20 Why did you need to start the course? Had you done embedded systems before? No, had not touched any. Well, I'd played with a Raspberry Pi, but I hadn't done much with it, so not really. If you ask Alicia, that's not an embedded system. That's a computer. Why did you take the course? I've had this idea for a while that I want to build an alarm clock.
Starting point is 00:04:51 So the idea has morphed into building an open source alarm clock with sensors in it. So one idea is you can wave your hand at the clock, it detects your hand and it can do things, as well as showing the time and playing radio and music. Okay, you can make it easy to snooze or hard to snooze and things like that. Right. So maybe one swipe is let me sleep for five minutes and two swipes is let me sleep for half an hour. I don't know yet. Did the course cover everything you'd need to do that? No,
Starting point is 00:05:15 it gave me an introduction to a few different things, but it's going to be a steep learning curve to try and make this clock. So what did it, what did it teach you? Things like interrupts and how to write C code. And it was very focused on the ARM chip. So went through a lot of low-level details that if I decide to go down that path and don't have an OS on the board that I build, I've got some ideas on how to
Starting point is 00:05:47 put it together. So structurally, did they start with, we assume you don't know how to program, or did they say, assume you have some programming knowledge, but maybe not in C? How did they, how did they structure the course? Because I'm curious, it's difficult to get a course set up for a large number of people with varying backgrounds so that you don't, A, bore the people who have some experience or leave everybody who is maybe a little behind in the dust. The assumptions were that you had done some programming before, but you didn't have to know any C code.
Starting point is 00:06:27 And another assumption was you had done some things with electricity, like you knew what a resistor was, but you didn't have to know that in a great depth. Wow, that's tough because both as somebody who has never done this, you have to know two things that aren't really the same, but also from the professor side, from the teacher side, that's ground zero. Or you could spend the whole course teaching C. Or you could spend the whole course teaching Ohm's Law and all of its varied applications. Right, it was a brief introduction to a lot of different topics.
Starting point is 00:07:08 So, yeah, C was like one week, and the electricity piece was another week, and interrupts was one week, and DAC controls was one week. So it was basically broken up by weeks. Was that enough? It was a good start. I'm sure there's a lot I don't know, so it's given me somewhere to start. So I looked up the dev kit you had to buy, the Teva
Starting point is 00:07:35 series something microcontroller, and it's a Cortex M4 80 MHz processor. Yes, that was it. It looks like it had a fair amount of code that came with it, example code. Yes, but I don't think we used that. We had example code that the professors had written and gave us. So one thing they mentioned was, I think the examples from TI used C++ or a different variant of C. The version of C that we used was the plain version. A lot of the TI examples do have C++, so that makes some sense.
Starting point is 00:08:12 But that's disappointing because some of those existing libraries are such great examples. Did the professors have you write most of the low-level interrupt controllers dealing with the actual hardware and how to put it together, or did they have some layer where you said, I want an interrupt on pin 2, and don't make me worry about priorities of interrupts and whatnot?
Starting point is 00:08:41 Well, no. So for the interrupt controllers, we had to go through the seven steps to initialize a pin things like turn on the clock and then enable gpio and disable the alternate functions and steps like those so we had to go through all those steps for each register that we wanted and then you do the bit mapping and masking of the registers to say that, right, for example, PF4 is one register that I want to use, so I need to turn on this bit to activate PF4.
Starting point is 00:09:15 And then I don't want to use PF3, so I'm going to turn this bit off. So it was very low level, and we had to do all that stuff ourselves. Was it a shock coming from the IT side of the world? Yes, I don't normally worry about bits and mappings and masking and stuff. So that was a learning curve, yes. And then part of the fun was also learning the difference between positive and negative logic. Some ports were positive based and some ports were negative based. So if you had an example that said, hey, this port over here, and then all of a sudden we're using a different port,
Starting point is 00:09:48 you assume that, well, this example here works, I'll just use it over here. But if that switch was flipped in logic, then the code you wrote doesn't work. And it took me a while to figure out that, oops, I've got to read the data sheet to figure out that, yeah, this was actually inverted. With your day job as assistant admin and manager, you have this idea for a clock,
Starting point is 00:10:10 but why take an embedded course? Why not buy the clock or do something more with the Raspberry Pi level of things? Were you interested in this low-level stuff? I am. Well, I'm always curious about how things work. This is probably lower than what I was expecting, but it's also interesting to know. Well, I, of course, think it's fascinating. I like it when you can touch the world with software, where you can actually make lights turn on and motors move.
Starting point is 00:10:43 What were some of the labs that you had? There was one for a finite state machine that involved a lot of work. It was the traffic light simulator. That sounds really familiar. Yes, apparently there's a common scenario for finite state machines. And that was a lot of work, figuring out that cars go east in this direction, and then the lights had to cycle through at a certain speed and a red light can't be on at the same time as another red light, and that was involved. But you drive, so you knew most of these things intuitively.
Starting point is 00:11:17 Well, the concepts, yes, but in my car you pull up to traffic lights. I know there's some sort of electrical sensor under the road that detects a car is there, but other than that I know it sends a signal to the traffic light system to say, hey, I'm waiting go do something. But other than that, I've really never paid much attention to what happens behind the scenes. That's a really typical interview question for Embedded Jobs. It showed up in Alicia's book, I think, as one of the examples.
Starting point is 00:11:47 Oh, yeah. I use that one a lot. But it's a great example because it's not really programming. It's not really asking you about hardware. But it is asking you, how would you structure, at a high level, how an embedded system that does something which seems very basic work and you get into greater and greater details you go through as you add more things to it oh then now this is a left turn lane so you have to deal with the left turn light oh we want yellow lights and it just gets more and
Starting point is 00:12:15 more complex and to watch somebody solve that problem is very instructive because you see them either organize their thoughts in a way that makes sense, or just jump in and get really confused because they try to do everything all at once, instead of starting from, okay, well, we're going to start from a four-way stop that just does this, and then we'll add in these features, we'll add sensors in later. So it's a really good interview question, so I'm glad that they included that in the courses and exercise. Yeah, the example they gave us was the travel light system worked by itself. It would control traffic east and west. And then for the lab, they added in buttons.
Starting point is 00:12:54 So we pretended we had pedestrians waiting to cross the road. So the lab took the example and then added buttons to it, which obviously added small steps to the finite state machine and made it more complicated. Well, and that's what state machines do. They get ever more complicated until they're spaghetti. Right. And one annoying thing was that they said,
Starting point is 00:13:17 like, you're not allowed to use an if-then loop. You have to use the finite state machine method. I'm like, oh, this would be so much easier if I just forked this state here, but you wouldn't let to do that. Yes, well, that's the temptation. But if you do that too many times, pretty soon you come back three months later and you don't know what your code does.
Starting point is 00:13:38 Because you have to trace through from the start in order to get to the end. But if you use the more finite state machines and at least a switch statement, you at least have the idea that you have one starting space and then you go to where you want to and you don't have to read all of the code to get to the place that you're going. Right. Yeah, after you map it out with the circles and knowing that to get from this state to this state, these conditions have to be true, then once you see that the diagram and flow through, it have a full-time job, or you did as you were taking the course.
Starting point is 00:14:28 How did you find the time? Well, I asked permission from my wife first, and she agreed. So she helped me out immensely. But it was basically every weekend was consumed by the course, and then a few hours after work each each night to catch up as well so it was very time consuming i know it's hard a lot of times to do this level of education where you you are putting in all this time on an item that isn't necessarily your core competency or the direction you want to go did Did it change what you did at work at all?
Starting point is 00:15:06 I mean, was it applicable at all? No, I don't think so. I do know some Raspberry Pi controllers that people stick into data centers for temperature sensors, but I don't think I'd want to go down that path for any data centers that I work with. But no, I don't really think it's applicable to my day job. Even from an organizational standpoint,
Starting point is 00:15:31 I don't know how much they taught design and breakdown and that kind of stuff. But even from that standpoint, the stuff with finite state machines, I could see, I guess, I'm trying to think of an example in IT right now. Well, the state machine of the temperature is over temp, so what mitigation strategies do you take would be a state machine? Or even, not even a code state machine necessarily, but a process. A flowchart. Here's our process for dealing with a denial of service attack, and we could go through these options.
Starting point is 00:16:06 I don't know. I'm just spitballing. Interesting idea, but no, I haven't thought of it in those terms. What are you going to do next? I mean, are you going to use this information, or is it, it was interesting, I spent six months, and now I'm going to go do something else? I'm going to continue on and see if I can build this clock.
Starting point is 00:16:28 So we'll see how I go in the next couple of years. Are you going to use the Teva or are you going to use a Raspberry Pi? What's your plan for the clock? That is a piece that I don't know yet. So I need to research some different hardware chips, look at some Atmals and look at the Teva and look at the Pi and see which one makes sense. I do want to settle on a chip and then build some sort of custom board around it.
Starting point is 00:16:57 So I need to settle on a platform, figure out what I'm going to do, and then go from there. You're going to need a real-time clock as well as Wi-Fi, probably. Wi-Fi? Oh, he said he wanted Wi-Fi. Oh. Yes. I assume he wants to set it up via Wi-Fi because then you don't have as many buttons to deal
Starting point is 00:17:15 with locally. Okay. So if it has Wi-Fi, I will have it connected to NTP or Network Time Protocol. Right, okay. So that way, you'll always have an accurate clock, and when daylight savings happen, the clock changes automatically for you. And that's great, except there will be times when your router goes down but you don't want your alarm clock to die. And that's why you add a
Starting point is 00:17:39 real-time clock to it as well. And you believe NTP if you have it. Yes. Boy, there really are 10 different platforms you could go. All the way down to very, very simple stuff. Oh yeah, you could totally use the ESP. ESP or a photon
Starting point is 00:17:57 or an electric imp. Oh yeah. All the way up to Raspberry Pi, which is a problem with embedded systems. It's choosing. Pi, which is the problem with embedded systems, choosing. Well, one of the complicated things I also want to do is put a FM chip into it so I can receive a radio signal. So it's not going to be a trivial, just tell me the time type of thing,
Starting point is 00:18:17 and it needs to have a LCD display. Yeah, I know you could do that all Raspberry Pi BeagleBode level would be pretty easy I think the tuner chips are probably easy to interface with from anything I don't, okay so do you think the tuner chips you just tell it listen to
Starting point is 00:18:37 97 I'm sure they're just serial controlled and you set the frequency and then it's got an output that you put through an amplifier and probably has an antenna you have to route. Well, then you can use anything if it's just a serial interface. I mean, I don't think you need a CPU doing anything hard. It's not decoding MP3.
Starting point is 00:18:58 That's true. I mean, it's not like you needed digital in order to get radio. You should just use one of those little tuners that you roll. Hook a motor up with a stepper motor to adjust the frequency. Total analog solution. The Massively Online course. I have taken one, but I didn't do it when it was running. So I took it after. but you did it while they were
Starting point is 00:19:28 teaching it do you know how that's different yes one difference would be the piazza forums so piazza is a website that's designed for forums so during the, that was open to everyone in the class, and you could answer questions and post answers to various things or various topics that you're working on. So if you're doing this after the course, you may not have access to a whole lot of people working on the same problems as you at the same time. And so did you do study groups where you met a few people and you worked together often? Or was it all these forums where you're working with the whole class every time? I didn't participate in a study group, but at the start of the course, you were encouraged to join a study group based on your time zone. Since this was a worldwide class, there wouldn't be much point in me joining a study group with someone in Australia because we wouldn't have any time zone. Since this was a worldwide class, there wouldn't be much point in me joining a study group with someone in Australia, because
Starting point is 00:20:28 we wouldn't have any time together. But yes, you're encouraged to join study groups because different people have different insights to the material, and it's a lot easier to learn. Yeah, just like any other course, even not online, it's always good to bounce ideas off of other people. I have a question about motivation. Because I took an online course a few years back, not in anything technical, it was actually in music.
Starting point is 00:20:56 It was a small course, it wasn't a massively online course. And the only way I stayed motivated in that class was that we had to submit videos of our performances to get graded by the teacher. But that's not really something that can happen in a massively online course. How, how did you keep your motivation up without getting a lot of feedback or, or did you have graded assignments somehow that kept you, you know, honest?
Starting point is 00:21:28 We had, at the start of the course, the entire course was laid out except for the very last module, which hadn't been written yet, Lab 16, which was Internet of Things. So at the start of the class, there was a guideline saying that, for example, at the end of the first week, you should have finished lab one. At the end of the second week, you should have finished lab two. And then did these go to graders so that you could verify that your lab was correct? Yes. So the professors wrote an extension to Kyle,
Starting point is 00:22:00 the embedded compiler, and that's what the software we're using. So you use Kyle in the simulator to debug your code and get it working. After it was working, you then ran the grading system, and then it went through and interrogated your code and then gave you a grade. After you had that grade, you then punched that back into the edX site, and then it accepted that. And so, right, that 70% mark is a passing grade, and you're good.
Starting point is 00:22:31 Okay, so it's all automated. Yes. Yeah, that wouldn't work for me. I need to have an actual human yelling at me. Did you interact with the professors at all? No, not at all. There was 28,000 people registered for the class, and there was around about 4,000 people who actually passed at least one lab on the real board. So with that number of students,
Starting point is 00:22:59 I wouldn't expect any time with a professor. How many people do you think finished the course? I don't know. That's a great question, but I haven't seen those numbers, expect any time with a professor. How many people do you think finished the course? I don't know. That's a great question, but I haven't seen this number, so I don't know. I suspect it was far fewer than 4,000. Oh yeah, I'm sure. Oh yeah, yeah. I mean, this is sort of, because it's free, it's easy to drop out. It's hard to keep the motivation to continue the whole time. Especially for something that long. Yeah, 15 weeks is a long time.
Starting point is 00:23:31 Were there any shortcomings in the class? Was it missing anything that you were hoping for? I'm still at the stage of I don't know what I don't know. So I'm still early in my embedded systems journey. So the course was good as far as I know. What were the hardest parts to learn? I mean, what was the most difficult part? One thing that tripped me up was the DAC controller, the digital audio controller.
Starting point is 00:23:59 So in the example text, they had a three-bit… Sorry, I think it's digital to analog controller. Digital to analog, sorry. But it was probably being used for audio, so that makes sense. Yeah, digital to analog controller. Digital to analog, sorry. But it was probably being used for audio, so that makes sense. Yeah, digital to analog controller. So in the text, we were given an example of a 3-bit DAC, and for our lab, we had to do a 4-bit DAC. So I'm like, well, adding one more bit, how hard could that be? So I approached it trying to take shortcuts,
Starting point is 00:24:21 and it turned out to be a very difficult thing, trying to take shortcuts. So eventually, when I scrapped it and started again, I figured it trying to take shortcuts and turned out to be a very difficult thing trying to take shortcuts. So eventually when I scrapped it and started again, I figured it out. Had you used C before the class? No, I'd done nothing in C. What languages do you usually program in? Normally use Shell or Perl. That makes sense from sysadmin perspective. What was the worst part of C for you? Being very finicky
Starting point is 00:24:52 with syntax and structure. From Perl? To C? Perl can be very lazy when you're writing. I guess so. There are 97 ways to do something in Perl can be very lazy when you're writing. I guess so, yeah. There are 97 ways to do something in Perl. Right, and it's very compact, and yes, and right, and it's not... Yeah, I can see that. And it gets idiomatic. If you know Perl really well, you know how to do these things really easily in one line.
Starting point is 00:25:22 Yes. But in C, there are a few idioms, but nothing like Perl or Python. In Perl, you can call libraries to do things for you, whereas in C, for what we were doing, we were writing our own. Yes, and that's less true in general. I think most of us working in embedded systems find, these days at least,
Starting point is 00:25:42 that libraries are a big part of it, especially from the vendors. They'll tend to provide lots of useful libraries with their chips and system on chips to do all kinds of things. But you do need to know how to set up the GPIOs because those are the parameters to those libraries. And if you don't understand pull up versus pull down versus float you're it's really going to be very hard for you even doing an arduino you need to kind of understand some of
Starting point is 00:26:11 that so how'd you so you mentioned uh raspberry pi have you looked at any of the arduino stuff i have looked at the arduinos but i haven't done anything with them yet, no. Makes sense. So back to C in language. Pointers. Pointers are the part where everybody thinks that C is very hard and that it doesn't make sense to people who use, I hate to say this, more modern languages. Were they troublesome? I'd used pointers before, so I understood the concepts.
Starting point is 00:26:48 When I was in England on a contract, I'd just started and there was a need for a small program to be written. So I said, hey, I can use Perl for this. So that weekend I went to the bookstore and bought the Perl in 21 days book Read that and then by the following week I had a functioning program So I learned how to dereference pointers and debug Pearl rather quickly
Starting point is 00:27:17 So yeah, I had a concept of what the pointers were doing It probably didn't come up that much in an embedded course. I don't know. It depends on how they treated registers. Right. Well, that's true. Because those are pointers, but a lot of times they don't talk about that. What other courses have you taken?
Starting point is 00:27:38 I'm doing a MOOC on Python at the moment. What are the applications? Well, Perl is getting to be an older language and Python seems to be what the new kids are playing with, so I need to learn Python. But what are the labs for it? The labs, it's game focused. So for one lab we did was a stopwatch. You have to click on a start button and let it run for a certain number of seconds, then stop it. And there's another one that you had to click on a start button and let it run for a certain number of seconds, then stop it.
Starting point is 00:28:06 And there's another one that you had to guess a number between 1 and 100 and do a binary search on it. Okay, that makes sense. Perl and Python do share more history than, well, I guess C's in there too, but they always seemed more similar to me, but that may be because I use them both, but very sparingly. So I always have to look up whatever I'm doing. Is Python closer to your, I don't know, mental landscape than C was?
Starting point is 00:28:37 Yes. Python's easy for me to understand because it's closer to Perl, which is one thing that I do know. And it is very library-based. Most of my Python work tends to be, what module do I need to import to type this one function name that will do everything I need for the script? Do you know there's a whole library to go from SREC to binary? I'm sure. And so you can just totally mess with all of your downloadable files and do exactly what you want and add the CRC that you particularly want.
Starting point is 00:29:09 I was amazed and pleased. Yeah, Python's great, except that I think it makes people lazy. I worry that in 10 years, nobody's going to know how to program anymore. They're just going to click on buttons to import. Well, you know, the whole Python 2.7 versus 3 keeps me on my toes because I have both installed and I have to decide which one I'm using today. Are you having fun with the new course? Yeah, the Python course is fun. We have some good games at the end of it too.
Starting point is 00:29:43 Does it make you want to do your alarm clock in Raspberry Pi? Because that is a great Python platform. That is a consideration. But one catch is I don't know if the Pi is going to be small enough to put inside a case. And the other catch is with the Broadcom chip, I can't buy them by themselves and stick them in my own board. So I don't know if the Pi is going to be a suitable platform. There are a lot of cases out there for the Pi. So you might be able to find something,
Starting point is 00:30:16 even the Pi with a screen. Depends on how small you want to make it. Yeah. So what do you think they could have done better? At the end of this course, you probably had some complaints and thoughts on how well various parts worked and how not well some other parts worked. What would you have liked to see?
Starting point is 00:30:38 I mean, from somebody, this is a unique opportunity because we don't usually get to talk to people who have just started learning about embedded. And when we're mentoring folks or encouraging people to go into embedded systems, sometimes it's hard to figure out the right approach to teach. So do you think this was the right approach? I think it's on track. So one thing I would like to have seen is sort of a hybrid model of a MOOC where the material is posted and then there's local user groups that come together and discuss the concepts each week. But I don't know if that's feasible given the scale of these things. into how I think colleges will be in 10 years, 15 years, where instead of going to UCLA, what you do is you sign up for UCLA courses
Starting point is 00:31:33 through the internet, and then you go to whatever apartment building that's local to you that everybody else has signed up for that. That's weird. Well, no, I mean, because part of the important part of college is the people you meet and the interactions you have and the shared experience. And if you could decrease the cost of actually attending
Starting point is 00:32:02 while still getting those features, just if we're going to do online courses, we can't get rid of the interpersonal aspect entirely. That's why I think universities will still exist. I think it'll be a hybrid where they do the inverted classroom sort of thing, where you don't go to lecture. And there is a professor or TAs, but those are separate. You do your work, your in-class work with them there,
Starting point is 00:32:30 your homework in class and your study at home. But he was saying if they had local, I mean, if there was a local hacker place where you could go and talk to people who are taking the same class and actually touch the same hardware. I mean, I could see how you could somehow blow your board with ESD or plugging it in wrong and it's broken. And if you're at home by yourself, that's really hard
Starting point is 00:32:59 to figure out for sure that this is toast or, oh, all I have to do is turn this around and it works. You can get some of that from the forums, but there's something special about it. No, it's really hard. That's what he was saying about the study groups too, right? I mean, which you didn't really get to participate in, but I think that's helpful. Yeah, I can see how the study groups would be more useful. Were there other things that you thought could have been done better or would have worked better for you personally no i think that was the biggest one was the interaction with others would have been helpful but i don't know how you can do that unless you have a high concentration of people
Starting point is 00:33:34 in your city or in your local area yeah and that kind of requires the course to be even more massive to get enough people in every region to have that work. Or if you're an engineer, you go to Silicon Valley and you take it with the other people in your apartment building. I'm telling you, this whole dorm, college, remote thing, it'll totally work. And then you say, I graduated from UCLA, Silicon Valley. I graduated from the King's Arms Apartments on El Camino Avenue.
Starting point is 00:34:09 Yes, exactly. Yes. I think it'll work. Let's start buying apartment buildings. At the end of the day, it's do you have the certification and can you do the work? It doesn't really matter how you got there. And so this class was free, but you could pay to be certified. Did you do that? I did. I paid about $50 for it, but that was more of a token gesture because I certainly got a lot more value than that from the course. That's kind of cool. And now that you have a certification,
Starting point is 00:34:47 you can put that on your resume as I passed this and I'm certified. Right, yes. That's a pretty common thing to do in sysadmin land where you get certified with Windows and Cisco and all of these other things. Yes, vendor certification is highly valued. But because this is a MOOC, it's a different sort of certification.
Starting point is 00:35:11 Right. I guess the value of the MOOCs is yet to be determined. Yes, and which MOOC and which study group and whether you take it offline or online. Well, it depends on who's behind them too. Like with the Cisco and Microsoft stuff, Cisco's created this course. They license people to administer it,
Starting point is 00:35:32 but it's their material, and they kind of say how it works. So Cisco's behind this. Microsoft's behind this. Random MOOC might not have the cachet yet. Well, this was University of Texas. Right, right, right. So that's helpful.
Starting point is 00:35:48 Yeah, I think having them establish the universities is... I mean, Coursera. If you take a Coursera course, that's probably not going to have as much value as something that's backed by a university. I think most of those are still backed by a university. Okay. Udacity is not backed by a university,
Starting point is 00:36:02 but they are trying to do their own making sure it is a very good course trying to find a negative example here well it's not I mean you can go to YouTube and find random courses by people but even those people don't teach courses just because it's lucrative
Starting point is 00:36:18 and it depends on what you're looking for if you're looking for a certification or if you're looking to learn you can always learn yeah if you take the time and if you're looking for a certification or if you're looking to learn. You can always learn. Yeah. If you take the time and if you manage the motivation. I understand doing courses like this when you're unemployed because it's a really good way to stay sharp. Yes. Although when you're unemployed it's hard to commit to a long-term thing because you may get a job and then
Starting point is 00:36:44 you can't do that. But I think it's impressive Craig made time for the class with a busy schedule and a family. Well, with things like the Cisco certification and Microsoft certification, that helps you when you're looking for your next job because your resume goes to an HR person and they are probably looking for, right, I need a network person who's Cisco certified. If you have that certification, there's more chance your resume will get passed
Starting point is 00:37:15 to the hiring manager. So there is some benefit to certification, but it depends on what it is and the value behind it. So that's a very fuzzy area. Yeah, and embedded systems, if I was looking at resumes and somebody had, I have a certificate from blah, blah, blah for embedded systems, that's not a thing like a Cisco certification. If I see CCIE and I'm hiring for IT, I know what that is.
Starting point is 00:37:40 So I think it'll be interesting to see how things change and if some, you know, you almost need an acronym that says this is. This is so different than the hack schools. Hack schools? Hack Bright is the one that I think of. But there are a whole bunch of, you pay a huge amount of money for 10 weeks of class. And then you're now a programmer. And I didn't really understand those. I mean, that's another certification thing. But if I was looking at a
Starting point is 00:38:14 resume, I think I would want six MOOCs completed with the $50 certification instead of one blitz. But then I tend to want college because I know what that means. Which I guess is just an artifact of me knowing what it means because that's what I did. Well, I think that's true of all of us right now. Yeah. Are you looking for someone who's shown continuous learning? That I always want, yes.
Starting point is 00:38:40 And I think that is one of the reasons the MOOCs are good on resumes because it's a continuous learning thing. It's that combined with something else. If somebody came in with, I took a MOOC, just that. It doesn't seem like enough. Yeah. But somebody said, well, you know, I was a lawyer or a banker, and I gave that up, and I spent four years going through,
Starting point is 00:39:02 or two years, or a year, some appreciable stretch of time going through all these courses, and this is what I've done, and here's a project I've done. I think I'd listen. Yeah, I like projects. Projects help. And I guess there are MOOCs that if you said, I went through this one MOOC, it would be enough for me. Like the Stanford Machine Learning MOOC mooc is wow that was really hard math and code and more code and more math so was there anything from this course that you said well
Starting point is 00:39:34 you know what that really interested me i should take another course on that particular area i don't think so no because i'm still on the learning intensity stage, so I've got lots of new things to, lots of areas to research. Sure, but anything you want to focus on? Or is it just still like, here's this pile of stuff, and I haven't quite had it become cohesive yet? One area that I want to dig into is circuit design, but I know that that is basically an industry in itself so I don't know if I want to jump into that just yet. Yeah, and it's not easy.
Starting point is 00:40:16 This course probably was a good introduction to what the things are you're going to need to know, but then you end up needing to know a lot more than just the electronic side, the EE side. There's the whole manufacturing. Actually, did this course talk at all about manufacturing and what to do after you've built the widget? No, there was nothing about manufacturing.
Starting point is 00:40:43 Yeah, that's contextual electronics is the electronics course where they go beyond the EE. Here's how resistor networks work, and here's the math associated with it, and talk about here's how you do schematic capture, and here's how you actually ship boards, which is not something you get from a college class usually. Well, that's, I mean, even for embedded systems course,
Starting point is 00:41:05 source control management, release management, those things nobody teaches. Yeah, you learn those in the School of Hard Knocks. And manufacturing tests and how important it is that your board needs to tell whether or not it's going to be a good board. So I sent you my book to compare with the course. Did you get a chance to look at it?
Starting point is 00:41:25 I did. That was a very interesting reading, yes. A course is good because the homework and discussion help with understanding, but a book is very different. Yes, your book is a very different style to the edX course. So with your book, I can imagine a junior embedded systems person being given a copy along with a requirements document and says, here, read these two things and go build it. And after they've read your book, they've got some ideas on, well, I'm going to need to do interrupts and I'm going to need this type of processor. whereas with the edX course it was more hands-on and in some areas it went into a lower level and was also focused on the M4 chip.
Starting point is 00:42:12 Which isn't a bad chip. I mean, it was a good one to choose. It's a very flexible and broad chip. But yeah, courses like that don't tell you how to choose chips because the chips change so fast that you couldn't make a sheet that tell you, well, if you need this, then do that. That would be out of date in moments, so you can't keep that up to date. I tried once. Yeah, I liked your dinosaur example of your electronic chip that you had in your book.
Starting point is 00:42:44 Yeah, in the chapter about reading data sheets. Yes. Did you find, coming from more of a computer science background, that the electrical engineering was more difficult, or that the computer science parts of embedded systems were more difficult? The electrical part was more difficult because I haven't done physics before. So the whole Ohm's Law thing I've heard about and got some basic ideas, but I'm not really that good at figuring out that voltage versus current equals this thing, and here's how you choose this size resistor.
Starting point is 00:43:18 So that was also a challenge. It's still a mystery for people who have physics backgrounds, so don't feel bad. Well, I mean, that's electrical engineering electronics, where you learn that by blowing things up. It's the easiest, best, and most fun way to learn it. Learning by blowing up. Learning by doing. No, no. Learning by doing. No, no. Learning by undoing. It's really a lot.
Starting point is 00:43:46 It sticks with you better if it's matched with the smell of burning things. So with my alarm clock project, what type of chips should I be looking at? So you said you wanted to have Wi-Fi, which narrows it significantly. Are you focused on Wi-Fi, which narrows it significantly. Are you focused on Wi-Fi or Bluetooth? Probably Wi-Fi would be better than Bluetooth. Because of the network time protocol. And then he doesn't have to write
Starting point is 00:44:13 an app or something. Sensors, a screen, and then the clock functionality. I don't think you need anything big deal. I think... Well, so... Do you want a screen screen or do you want 8-bit LEDs, 8-bit numbers? I was imagining an actual screen and possibly like a touchscreen.
Starting point is 00:44:37 Okay. Okay, so there's a bunch of dev kits for Wi-Fi-based little system on chips. They're very cloud-focused, though, so I don't know if they're too cloud-focused to be interesting or if you just kind of ignore that part. So the Photon is the one I'm working with just for fun right now. That's from Particle, which was formerly Spark.io. And that's a little Cortex-M3 with a Broadcom Wi-Fi
Starting point is 00:45:07 and a smattering of digital and analog and serial things. So you could connect everything you need to that and control a display over SPY. That would work. You'd be programming in Arduino-like. Actually, probably Arduino, whatever its language is. Which means you get a number of libraries for nearly free, and the compiler's not expensive.
Starting point is 00:45:34 And it's a small chip. It's about the size of two postage stamps. And it's made to be socketed into a breadboard. There's a lot of other similar stuff like that. Electric Imp is very similar. Cloud-based, although you're not writing in any normal language. You're running in their scripting language. Which is Squirrel, and it's sort of C-like,
Starting point is 00:45:55 but it's not C-like enough that you don't have a learning curve. You do have a learning curve. What else has Wi-Fi? Oh, ESP. So the other option would be ESP8266, don't have a learning curve you do have a learning curve uh what else has wi-fi that's oh esp so the the other option would be the esp8266 which probably has a higher learning curve well it does have the arduino interface now so the learning curve isn't quite as bad as it was to go track that down but yeah but it is really cheap at like four or five or six dollars i've seen that chip and that was definitely on my short list to look at, yes. It's a nice chip and it would do everything
Starting point is 00:46:27 you wanted. Maybe. But it is not going to be as easy to use and it's not going to have quite as much commonality as with the one you did with the Chorus. I would tend to go with something bigger. I mean, if you use a BeagleBone, they have these beautiful touchscreens that just socket right onto your BeagleBone.
Starting point is 00:46:56 And then you don't have to look at spinning the board. You just buy a case for it. And there are a number of cases. It's so overpowered, though. It is totally overpowered, and at like $70, it's pretty expensive. It's like turning a laptop into a clock. That is essentially what it is.
Starting point is 00:47:13 What about Arduino with a Wi-Fi shield? There are a whole bunch of Wi-Fi shields, although many of them now are ESP8266s using serial. Yeah, but if you don't have to think about it, then... So that would be a pretty simple way to go. But the Arduino display touchscreen makes it a lot harder.
Starting point is 00:47:34 So here's a question for you, Craig. How much do you want to learn? And how much do you want to spend? I don't know what... Well, I don't mind spending money on the development stage, but I want to try and keep the price relatively affordable for an end clock. And so do you want to build more than one of these?
Starting point is 00:47:53 Yes. My plan at the moment is to try and build, well, buy one to get a prototype, prove it works, then see if I can sell 10 of these things on Tindy to see if there's some sort of market. If that goes well, try and sell 100 on Kickstarter. Okay, so that's a different prospect then. Because if you're making one-off for yourself,
Starting point is 00:48:14 that changes the choices significantly. I totally rule out Raspberry Pi and BeagleBone. I do too. I would probably rule out the Photon and ElectricAmp because the Wi-Fi... You're going to want direct Wi-Fi for NTP and stuff, and I'm not sure how to do that with those because they're cloud-based.
Starting point is 00:48:33 Well, ElectricAmp has a way to get to clock services. But they're more oriented to things that you want to control from the internet a lot and get to from your phone. So this is mostly Wi-Fi for setup and for NTP. I wouldn't rule Electric Gimp out on that one.
Starting point is 00:48:52 Okay. It's a reasonably cheap board. Well then so is the Photon. I mean they're... You were using the Photon. I haven't opened mine yet. Solid gave them up for free
Starting point is 00:49:05 so I got a couple they're $19 for the dev kit okay I didn't know how to do a screen on either one of those spy a touch screen?
Starting point is 00:49:17 yeah okay I don't know I mean touch screens have serial interfaces you probably have to maybe have a UART but they've all got enough ports.
Starting point is 00:49:26 That's true. But if you were going to make, I guess, if you had plans to make in the 10s, I would actually say you should think about the ESP-D8266 to start with, because the cost is lower and you'll have more control. And if you want to make your own boards and things, that's something that's probably easier to integrate
Starting point is 00:49:45 there are a couple of folks talking about how to make boards with ESP 8266 and it's pretty straightforward because they even talk about how to do the antenna on the board without needing to know RF magic but that is going to be a harder spot to start needing to know RF magic. But that is going to be a harder
Starting point is 00:50:08 spot to start. If you could start with the photon instead and build your 1 or 10 with the photon. But nothing carries over. The design carries over. And I think the design is going to be one of the hard parts. I mean, it seems simple.
Starting point is 00:50:23 You wave at it. It has a screen. It talks to the internet. But I don't know. I don't know if we've answered his question. It doesn't seem like it does it. With the ESP chip, that wouldn't be the only chip on the board, though, would it? You'd pair it with something else. It's a small, it's a Cortex-M0?
Starting point is 00:50:43 No, it's smaller than a Cortex-M0? No, it's smaller than a Cortex-M0. Oh, is it? It's their proprietary, but it has everything you'd need to run this, probably. Probably. The screen, depending on the resolution of the screen. So you would have a screen controller as a separate chip, which you would just interact with as a dumb device. You would send it spy commands or UART commands,
Starting point is 00:51:09 and it would tell you things. So that is another chip on the board. The ESP8266 would be the chip you programmed for that you had to put code into. And what else would you need on the board? I guess you'd need another sensor for the waving on an ultrasonic or something.
Starting point is 00:51:32 Or if you didn't want to wave at it, you just wanted to pick it up, you could put an accelerometer on there. Those are great. Either for tap detection. Smashing is nice. Drop it on the floor. I would look up the ESP8266. How would you look it up for the, is it Esbruino?
Starting point is 00:51:51 The Arduino-ization of it? There was a link in last week's show notes to a great Maker make article about how to set that up. Definitely look at that, and then I would look at Photon and Electric Imp, and then just kind of, you know, decide which you think is best to start with from that standpoint.
Starting point is 00:52:10 But I would also do an RTC on there because those are cheap. You can buy one from Adafruit for just a couple of bucks. Right. And then when you make your own board, they're still really, really cheap. Some of the processors that we're talking about would be able to have RTCs on board, but there is some simplicity with having it external and battery
Starting point is 00:52:32 backup. Sure. What about an RTOS? You probably don't need it. Yeah, you don't need it unless you're going for Raspberry or BeagleBone Black. And those, as we said, they're great for doing a one-off, but if you want to build 100 of these, they're too expensive. So the ESP8266 handles Wi-Fi on their firmware that's on there somehow. So, I mean, you do kind of need an RTOS-like thing to handle Wi-Fi,
Starting point is 00:53:02 but most of these chips we're talking about do that under the covers. So the Photon, I think it actually might be running free RTOS underneath. I'm sure ElectricCamp has something like that, because for Wi-Fi and things, you have to have timers and respond to asynchronous events. But your code
Starting point is 00:53:19 probably wouldn't run in an RTOS, per se. It would just be a while loop. I mean, while I haven't gotten any commands from Wi-Fi, while I haven't had my screen touched, you just handle each thing individually, an event loop. Sure, just interrupts. Unless you want to learn an RTOS and then go for it.
Starting point is 00:53:43 Well, not really, no. Yeah, because, I don't know, RTOS is one of the hard parts is the setup, getting it configured the way you need and getting your code configured. As you're looking at all of these, one other thing to ask is what compiler are they using? You used Kyle and I bet you used the free version.
Starting point is 00:54:06 Yes, limited to 32K. You probably don't need a lot more space than that, but you might. And if you do, it ends up getting really expensive to buy Kyle. I think it's like $2,000 or something. And the IAR is not any cheaper. Well, none of these target. The three chips we're talking about don't use any of that.
Starting point is 00:54:26 That's true. But if he goes off and he starts, if he falls in love with a Cortex-M0 or something, because there are plenty of Cortex-M0 system on a chip, Wi-Fi modules. I can't think of any off the top of my head, but I'm sure they exist. I can only think of the Bluetooth ones off the top of my head.
Starting point is 00:54:46 I mean, again, it depends on how bare bones he wants to start. Yeah. So my advice there was also consider what compiler you're going to be using. If you're using the chips Christopher suggested, the Photon or Electric Imp or ESP8266. Everything's free. Those all have free environments. Right. But if you start looking at other chips, make sure the compilers are things you can deal with. Okay. So the ESP chip
Starting point is 00:55:20 can also handle the audio? Or will I need to get some sort of audio controller as well? If you're just doing a beep, you can do that with PWM. Well, I was thinking more like FM. Yeah, FM. That's going to be a pair of... That's a separate chip. That's a separate chip,
Starting point is 00:55:35 and then so you'd control it from the ESP, and then the audio would probably go through the FM chip. I haven't looked at FM chip data sheets, but I'm assuming how they work is they have a front-end interface where you control them, and then they have audio output that goes to an amplifier. Right, so I'd need an amplifier on the board as well. Yes, an audio amplifier.
Starting point is 00:55:56 Yeah, SparkFun has a little boardlet, tiny. Oh, it's got a radio IC, and that's probably the place to start to look at that. At about $10, you get FM control, and it does all sorts of cool stuff. I don't know how you could... Oh, so I2C and SPI control interfaces from an auxiliary processor would do that. Sounds good. Yeah, there's even a tuner evaluation board for $20 that you just plug in your speaker, although probably headphones,
Starting point is 00:56:34 so you'd still have to look at amplification if you want to build speakers. Okay. I recommend going to SparkFun and Adafruit and building this with boards initially don't start with the idea of I should make my own circuit board because that is a separate skill set and it's not an easy one
Starting point is 00:56:56 and if you can build a breadboard first it'll be so much easier later and you'll actually finish it without stopping in frustration at least that's what happens to me when I get too ambitious. Oh, I'm going to do this from scratch and build this. And then, no. Well, and then we both get a little frustrated and stop when we get to the mechanicals. I mean, I like working with wood and plastic, but it never comes out as pretty as I want
Starting point is 00:57:25 in my head. And so making cases is sort of tough. Be aware of how much that might stop you and maybe start making friends with a mechanical engineer now. Buy them lunch. Exactly. Alright. Well, did that answer your question well enough? Yes, thank you. Appreciate it. Okay, great.
Starting point is 00:57:49 Craig, do you have any last thoughts you'd like to leave us with? I'd just like to thank you for doing these podcast series because I've learned a lot. And thanks for having me on. Sure, thanks for being here. My guest has been Craig Cook, IT systems engineer and manager. Craig's looking for an IT management job in Raleigh, North Carolina. If you know of anything, you know, contact the show and I'll pass something along. Thank you as always to Christopher White
Starting point is 00:58:17 for co-hosting and producing. And thank you for listening. I do have a final thought. This one from John Carmack. Program not a zero-sum game teaching something to a fellow programmer doesn't take it away from you

There aren't comments yet for this episode. Click on any sentence in the transcript to leave a comment.