S08E16 1h 04mSeason 8

Episode Summary
This episode centres around Andy Clark’s journey into the world of embedded systems and the .NET nanoFramework. Andy shared his programming origins, starting with the ZX Spectrum and progressing through work on cruise and container ships to his current focus on warehouse logistics – all utilising message-based systems. This experience led him to experiment with electromechanical devices, ultimately leading him to explore .NET nanoFramework as a means of building projects with a higher level of abstraction than traditional microcontroller development offered. He enjoys building projects as prizes for his team, fostering a culture of experimentation and fun within the workplace.
.NET nanoFramework provides a smaller version of the .NET framework designed to run on microcontrollers, abstracting away many of the complexities of low-level programming. Previously, developers working with microcontrollers often had to contend with assembly language and direct hardware manipulation. Andy highlighted how nanoFramework simplifies this process, allowing developers to utilise familiar C# syntax and NuGet packages, even on resource-constrained devices. This dramatically reduces the learning curve and enables rapid prototyping and development, bypassing the need for intricate, device-specific toolchains and SDKs.
A key theme was the power of constraints in fostering creativity. Both Jamie and Andy discussed how limitations in memory and processing power can force developers to think differently and prioritise efficient solutions. Drawing parallels to early computing and even cooking, they emphasised that working within restrictions can often yield more innovative and elegant designs. Andy explained that the need to optimise for low resources pushed him to look into techniques such as code generation and carefully managing memory usage, skills applicable to larger-scale software development.
The conversation also touched upon the importance of community support in the .NET nanoFramework ecosystem. Andy highlighted the collaborative nature of the project, with many contributors building drivers and libraries for a growing range of hardware platforms. While specific device support requires some initial setup, pre-built images and the availability of community contributions can significantly ease the process. This collaborative approach also allows developers to focus on their applications without having to spend time on low-level hardware intricacies, speeding up development cycles.
Episode Transcription
But I was looking for something that I could give to some of my team members as prize for a hackathon that they completed and I basically I didn’t want to didn’t want to force them down that route of having to solder their own stuff. So I found um a little board with a a display on it um and various other capabilities um and then and realised that I could put the nano framework on it.
Hey everyone, and welcome back to The Modern .NET Show; the premier .NET podcast, focusing entirely on the knowledge, tools, and frameworks that all .NET developers should have in their toolbox. I’m your host Jamie Taylor, bringing you conversations with the brightest minds in the .NET ecosystem.
Today, we’re joined by Andy Clark to talk about .NET Nanoframework, how he came to find out about it (pro tip: there’s a wonderful circular moment in the episode, see if you can spot it), and why he chose to look into embedded systems in the first place.
And I think it’s the the same kind of applies to software which is if you’re doing the same things over and over again you almost kind of blinker yourself into working in particular ways.
Along the way, we talked about the importance of both constraints on software design, and in looking around at what other systems and frameworks do and use. We also took a walk down memory lane for me, as what we were talking about reminded me of my college days.
So let’s sit back, open up a terminal, type in dotnet new podcast and we’ll dive into the core of Modern .NET.
Jamie
Before we get started with the topic at hand, which is a very interesting one, I have to admit - would you be willing to give the folks a brief intro to yourself? You don’t have to go as deep as, well, I was born in a log cabin, but things like I’ve been programming since this time and my main interests are this, that, and the other.
Andy
In my spare time I build electromechanical devices, and there’s a crossover between the work and the hobby, which is what we’re having a chat about today.
Jamie
I can imagine that even just the first part of your history there would be different. The logistics and shipping industry - as you said, shipping things around the world - that has its own challenges, right?
Andy
Jamie
Andy
Jamie
If folks haven’t caught on already - it’s in the episode title - we’re going to be talking about .NET nanoFramework, experimentation with embedded systems, and similar things. We did have a couple of people on talking about nanoFramework and IoT in the past, but for folks who haven’t heard those episodes, could you give a 10,000-foot overview? If you were saying to someone, “Hey, this is my project and this is how it works,” what are you saying to them?
Andy
The big difference between a microcontroller and a microprocessor is that typically the package has a bunch of other functionality contained within it, such as input/output and memory management. In the case of the one I was looking at, it also has a Wi-Fi capability, so it could talk to the internet.
Jamie
But if I’m dealing with a microcontroller, am I doing literally everything myself? Freeing memory, worrying about memory management as you said - am I also worried about overloading the CPU? I don’t even know if this is the right term anymore, because it’s been so long since I did my computer science degree - thrashing or flip-flopping. Is that the stuff I need to worry about?
Andy
Over the years, things have got a bit more sophisticated. We’d typically see C used on these microcontrollers, and quite often MicroPython as well. By putting the nanoFramework on it, things like memory management and abstractions around a lot of the hardware are already in place for you, so you don’t have to worry about interrupt handlers nearly as much as you would if you were bare-metaling it, as they call it when you write directly to the raw processor.
Jamie
Everything you were saying there about pages and pages of code just to do Hello World, or just to turn an LED on - you didn’t say LED, but that was one of the things I had to do. The only thing I remember about each of those program listings was that the very last thing you had to do was trap hash 11, and I do not know why. That was all in assembler.
Then we moved on to using PICs with low-level C. If any of your credit cards have one of those chips for chip and pin, it’s essentially what a PIC is. A SIM card is something along those lines too. You’ve just unlocked all of these memories.
Andy
Rather than what they call bit toggling - where you’re basically saying “go high, go low” to communicate something - you can now say at the hardware level, “Hey, serial port, do some stuff for me,” and the serial port takes on those responsibilities, rather than having to literally go high and low on various devices.
Jamie
Then, like you said, the hardware abstractions came along - you’re just saying to the port, to the device, “Hey, give me the value of this,” or “Set the value of this.” It’s completely alien from what we do as .NET developers every day. We don’t have to worry about setting up memory mapping for our apps, and if we’re using full .NET - if that’s the right term - we don’t have to create our own HTTP clients or TCP clients to do stuff over the wire. But in that IoT world, pre-.NET nanoFramework, you did have to, right?
Andy
Jamie
Andy
To a large extent, that’s still the case. Although the processor end is a lot more sophisticated, the target ends are still effectively quite low-spec devices. If you’re talking to a temperature sensor, for instance, you’d be setting a register and then checking a different register to see the current value for that temperature, and quite often you have to worry about what order the bytes are in and how that temperature is represented. There is still quite a lot of low-level work to worry about when dealing with microcontrollers.
Jamie
Andy
Jamie
Andy
Just to recap on how I got into the whole thing: I like to mess about with electronics, solder bits and pieces, and build projects from the ground up. I was looking for something to give to some of my team members as a prize for a hackathon they’d completed, and I didn’t want to force them down the route of having to solder their own stuff.
I found a little board with a display on it and various other capabilities, and realised I could put the nanoFramework on it. I ended up with this device with a touch display - I think it’s also got audio and Wi-Fi - that I could present to them and say, “Here you go, go write C# code and have some fun with this.”
Jamie
First off, regardless of whether those folks in that team appreciated it, I appreciate it, right? Because we need to bring some fun back into what we do. It is so easy to fall into the trap of “I will make a forms-over-data app, I will build an API, it will be enterprisey, I will add unit tests,” and so on. Life gets very businesslike - I’m reticent to say the word boring, but you know what I mean. There’s not much in the way of immediate blasts of joy.
Being able to turn to someone and say, “Here’s this really cool thing - go build something fun with it,” and just watch them go off and do it - I think that’s a wonderful thing in itself.
Andy
It’s a lot of extra stuff to learn. If you’re doing that full time, that’s fine, because you learn it once and then you’re using it daily. But in the business world, remembering which SDK to use and which tool to use with particular devices can be quite complicated.
Jamie
I think it’s more fun to do those projects, and - this is a very hot take - more important than doing the standard code-cutters, because it brings the joy back into the work. Otherwise it becomes monotonous. If you can take a break and do something completely different, it helps reset your brain, and it also introduces you to new ways of thinking about the work you do on a daily basis.
Andy
I think the same applies to software. If you’re doing the same things over and over again, you blinker yourself into working in particular ways. By going off and experimenting - whether that’s a back-end developer trying front-end, or experimenting with microcontrollers - it gives you a different perspective, which you can then bring back and apply to your day-to-day work.
Jamie
Like you said, it lets you see things from a different perspective - why do we do things the way we do, and how do others do things differently? How might that fit better?
Andy
Jamie
The reason it’s so eminently portable is because he abstracted away the constraints of those early PCs from the very early ’90s. The reason a million Doom clones exist and a million different Doom engines exist is because they’re all programming to the same constraints via those same abstractions. So the Doom clone developer doesn’t have to worry about the hardware constraints, but the person porting it to another device does.
I genuinely feel that working to those constraints can make you a better software developer. I was talking to someone just yesterday about music - I’m very much an amateur musician in that I play bass guitar. Someone asked me, “How many effects pedals do you have?” I said, “None.” They said, “Can’t you be more creative with effects pedals?” I said that what would happen is I’d spend a couple of hours fiddling around with them, listening to the cool sounds, which would be fun - but if my goal is to learn a piece of music, I won’t learn the piece of music. I’ll spend hours fiddling around with effects pedals and VST plugins or whatever.
I feel that applying constraints allows you to be more creative in how you think about things. Removing the effects pedals, removing the VST plugins, and just focusing on the constraint of “I have this thing and I need to make it sound like that” - or, in your case, “I have 512 kilobytes of memory and I need to make this thing do that.”
Andy
What I ended up having to do was write chunks of screen at a time, copying bits and pieces in. That raises another interesting constraint: on desktop apps, fonts are available to you without much thought, but on these devices a font is an optional extra. You have to take your font and compile it into something called the TinyFont standard. You can even go as far as saying, “I only need the letters from A to Z in capitals,” so you’d only have 26 glyphs. You pick your size to match your requirement, create your font file, and then you can use it for writing to the screen. Luckily, you don’t have to draw out the individual characters - that’s been abstracted away - but you basically say, “Here’s the font and here’s the text, put it on the screen in this position.”
Jamie
The inefficiency - that might not be the right word, but it’s the one I’m reaching for - of having to download megabytes of data to show a small thing on screen. Whereas you have to plan in advance: what messages do I want to display, which characters or glyphs do I need, how big must they be? It’s a completely different world.
Andy
One thing that is quite useful, though, is that you have your programme space and then you have your RAM space. If things are not changing, you effectively write them into the programme side - the flash RAM is where the programme lives, and the static RAM is where your variables and temporary storage live. There are techniques you can use to push things into that static side, which saves you a bunch of storage.
Jamie
Andy
Jamie
Andy
Jamie
Andy
I think probably the biggest difference is networking - we just didn’t really have that back then, whereas even some very low-end microcontrollers now have built-in Wi-Fi stacks.
My next project is probably going to involve a protocol called Zigbee, which is used for transmitting things like temperature data. Hopefully I’ll be able to get .NET nanoFramework onto a different microcontroller and get that project working: an automated greenhouse where we send data from the greenhouse to an e-ink display. The idea with e-ink is that you write to the screen and then kill the power, and the image stays on the screen.
I actually ended up experimenting with e-ink displays at work for some of the stores, and I’ve since brought that back into my hobbies for things around the home.
Jamie
E-ink is fantastic. For folks who haven’t used it, it’s literally as Andy described: you switch the screen on, write to it, switch it off, and it just stays there. I’ve seen them at bus stops, in stores - I’m actually writing on an e-ink screen as we record this. I’ve got several e-ink devices for reading books. They are genius, right? Whoever created them is a fantastic person. Because you only turn the screen on to update it, they require almost no power, and they can hold the image practically indefinitely.
Andy
Jamie
Andy
Jamie
Andy
There is one big gotcha, which is that it’s quite version-sensitive. Some of the code that ends up on the device is basically version-locked, so when you pick your packages you have to get the matching package for what’s already on the machine. They’ve drawn the line such that the low-level stuff is actually written in C or using the SDKs from the particular microcontroller vendors, and then some of it is written in C#. All that complexity is handled by the people doing the platform work, so adding something new - like a new protocol - can be done in native C# code, stuff that people are already used to.
I think that’s what I like about it from an IoT perspective. You could potentially have a full stack - from the sensors through the controllers and hubs out to the front end - all written in C#, which would be brilliant.
Sponsor Message
Today's episode of The Modern .NET Show is brought to you by RJJ Software: strategic technology consulting for ambitious SMEs.
You know me as the host of this podcast, but here's what you might not know: I'm also a former Microsoft MVP who's helped businesses from Formula 1 teams to funded startups transform technology from a cost center into a competitive advantage. At RJJ Software, we specialize in three things that matter to growing businesses:
- AI that actually delivers ROI: not hype, just practical implementations that pay for themselves
- Developer Experience optimization: we've helped teams achieve 99% faster deployments and 3x productivity gains
- Strategic technology decisions: from architecture reviews to fractional CTO services
The difference? We don't just advise. We ensure successful implementation through knowledge transfer to your team.
If you're an SME leader wondering why your technology investments aren't delivering, or you're facing critical decisions about AI, modernization, or team productivity, let's talk.
Visit rjj-software.co.uk/podcast to book a strategic consultation.
Now, let's back to today's episode...
Jamie
Does that mean I have to use very specific devices when building software with .NET nanoFramework? Is there some kind of one-time setup that says, “This project is for an Arduino XYZ and it has this particular breadboard attached”? Or is it just a case of, “Whatever - the tooling team will figure it out and load the right stuff”? You may or may not know that, of course.
Andy
So I ended up using one of the community packages, and that sorted me out. It’s very similar to the Arduino world - there are a lot of people writing the low-level stuff and dealing with the actual processors and SDKs, and then there are people who are more consumers of that, writing the higher-level stuff that provides the apps and devices you see out in the world. It truly is a full community effort.
Jamie
Andy
Just to loop back to what you said about specific devices: there are a number of community images you can use, but those are locked to a subset of microcontrollers. If a completely new microcontroller came out, there would be some work needed to get the low-level stuff in place. I’m using a microcontroller called the ESP32, and that comes in lots of different variants. Typically, if a new variant comes out, it’s probably just a case of setting a few flags and parameters to produce a new version. But if somebody brought out a totally new tech stack - say, a RISC-V processor or something like that - then somebody would have to do a lot of work to get .NET nanoFramework up and running on it.
Jamie
Andy
Jamie
What I’m trying to get at is: if someone is listening and thinking, “I want to try out .NET nanoFramework and I’ve got an idea in mind,” are they going to be limited by the devices available? Will they have to choose between, say, four different types of device? How do they choose the right one? Because it could be a considerable amount of money involved in buying these devices.
Andy
I thought, “I’ll get them for the team.” I actually think I heard about it on this very show - that .NET nanoFramework was a thing - and wondered, “Oh, will nanoFramework work on this board I bought?” So I discovered it that way.
Looping back to your question about selection: because of the nature of .NET nanoFramework, it does require a fairly high-spec processor compared to a lot of what’s out there. If you’re just blinking an LED, there are probably processors available at sub-cent prices to get that up and running. But the processors they primarily support - there are probably about three or four key ones. I think this is the STM32 and the ESP - I don’t know if they do ARM just yet. I know there have been some discussions around it. There’s a board called the Raspberry Pi Pico that has ARM on it, which a lot of people are interested in.
Jamie
I wonder if I’ve overstepped by asking about ARM, because I do know there’s a licensing agreement that hardware vendors have to sign when they release an ARM device. Maybe ARM is a bit much to hope for, but who knows what the next year or so will look like.
With the increasing hardware shortages and the increasingly inflated prices of RAM and things like that due to AI-based data centres, maybe embedded systems is the future. Maybe reusing slightly lower-spec hardware to get the work done is the way forward. Maybe we need to learn to constrain our apps a little more, right?
Andy
Jamie
You said you can’t run generative models on the edge where the embedded devices are, but you can do inference-based work from the outputs of those generative models. You might be able to do video but it’s a bit laggy - well, if you’re happy with laggy video, you can do it. You don’t need a thousand pounds’ worth of computer sitting in your back garden recording videos and detecting birds or whatever. You can use an embedded or IoT device. I keep mixing those terms up - maybe they’re different.
Andy
But I have a funny feeling that if you were trying to detect something like a blue tit flying down to a table, it’ll be gone by the time you detected it. Potentially, though, you could use a simpler model: if something which I know is not background appears in this video frame, start recording. You could then do offline processing and determine that, actually, that wasn’t a blue tit, so you can throw the recording away.
Jamie
I think that’s maybe where we need to go as an industry: more constraints, so we can actually focus on what we’re doing, rather than just building things that are potentially bloated and don’t necessarily solve the problem. I don’t know - I’m getting ranty again. I’m sorry, Andy.
Andy
Jamie
Andy
Jamie
That’s the thing, right? Applying lessons from outside your work to your work. I’ve been watching a lot of videos by cooking YouTubers - restaurant YouTubers, perhaps - about how they actually do their day-to-day work, what a three-hour shift in a kitchen looks like. Just-in-time doesn’t work in a kitchen, right?
I watched a video just before we recorded about this, and they were talking about trying to quickly service all of these orders when suddenly an order came in that required egg mayonnaise. They didn’t know egg mayonnaise was on the menu, and it takes ten to fifteen minutes to make from raw ingredients. The whole chain slowed down by ten to fifteen minutes because one person had to make it from scratch - whereas if they’d known ahead of time, they could have made it ahead of time.
That fits with what we’re saying: if I know my processing pipeline needs to process a log that comes in, look for a very specific thing, then immediately send it on, I need to know ahead of time what that thing is. I might not be able to generalise it, because maybe I only have 512 kilobytes of RAM. The overhead of reflectively instantiating a new class, calling a method on it, and passing that through the pipeline - even just that overhead might be too much, right?
Andy
Jamie
Just the innovation of it. We are - you are - standing on the shoulders of giants.
Andy
Jamie
Andy
Jamie
Andy
Jamie
One of the projects I had to work on at college - there were two that really stuck in my mind, both with the 68000 board. One of them was to simulate a washing machine, so it’s interesting you’ve brought that up. What I did was write something that would, at compile time, bring in a script that laid out the order of operations. I had a bank of eight LEDs - eight bits, so 256 possible combinations - I only needed about 12, right?
It was like: this one represents that it’s switched on, this one that the door is locked, this one that it’s spinning, this one that it’s filling with water, this one that it’s draining. I was able to simulate an entire wash and drain cycle with eight LEDs. It was fantastic.
Then the other project I remember: I had to use an air rifle to measure the speed of a pellet. I rigged up this arrangement - not in any way health-and-safety friendly, because I nearly shot myself in the head - with two strips of silver foil. It’s a simple test: you fire the gun and have your embedded system pass a voltage over both strips via crocodile clips. As soon as that voltage stops for either one of them, you either start or stop a timer. The device then knows how much time passed between breaking the first strip and breaking the second. You tell the embedded device how far apart the strips were, and then - speed is distance over time, right? You’ve got how fast the pellet is flying. You don’t need gigabytes of RAM to calculate that.
Andy
Jamie
Andy
On the software side, it’s pretty much what you have day-to-day: either Visual Studio Code or Visual Studio. You install a plugin and off you go.
Jamie
Are there any other quick hints and tips for getting started that folks ought to know? Then, how can people connect with you to keep an eye on what you’re up to in the public space?
Andy
I’ve done that by looking at C code and thinking, “Well, if it’s written in C like this, then in C# it would look like that,” and a lot of it is almost line-for-line - just adding the occasional semicolon and so on. I would recommend: as well as buying an off-the-shelf dev kit, buy off-the-shelf sensors too. Rather than worrying about whether you’ve connected everything correctly, you just plug things in and get started. Once you’re a bit more confident that your software works, you can then swap your hardware out for hand-soldered equivalents.
The idea is that you’re not fighting on two fronts at once - you’re dealing with either just the software or just the hardware. With my own projects I always say I’m going to focus on software, hardware, or mechanical, but I nearly always end up using all three at once. I find myself wondering: is the motor turning? Is the driver not working? Is the software that talks to the driver not working?
If you can isolate your problem space, that makes things a lot easier.
As for where to contact me: my work space is TechieChap London - you’ll see me around GitHub and various other places. My hobby stuff is Workshop Shed. I’m on most of the social media platforms, there’s a blog, and there’s a GitHub repo where you can find all the good stuff.
Jamie
Wrapping Up
Thank you for listening to this episode of The Modern .NET Show with me, Jamie Taylor. I’d like to thank this episode’s guest for graciously sharing their time, expertise, and knowledge.
Be sure to check out the show notes for a bunch of links to some of the stuff that we covered, and full transcription of the interview. The show notes, as always, can be found at the podcast's website, and there will be a link directly to them in your podcatcher.
And don’t forget to spread the word, leave a rating or review on your podcatcher of choice—head over to dotnetcore.show/review for ways to do that—reach out via our contact page, or join our discord server at dotnetcore.show/discord—all of which are linked in the show notes.
But above all, I hope you have a fantastic rest of your day, and I hope that I’ll see you again, next time for more .NET goodness.
I will see you again real soon. See you later folks.
Useful Links
- Andy’s Website
- .NET Nanoframework
- M5Stack boards
- .NET Nanoframework docs for ESP32
- Supporting the show:
- Getting in touch:
- Podcast editing services provided by Matthew Bliss
- Music created by Mono Memory Music, licensed to RJJ Software for use in The Modern .NET Show
- Editing and post-production services for this episode were provided by MB Podcast Services