微处理器硬件喂狗_硬件基础:微控制器到底是什么?

微处理器硬件喂狗

by Taron Foxworth

通过塔伦·福克斯沃思(Taron Foxworth)

硬件基础:微控制器到底是什么? (Hardware Fundamentals: what exactly is a microcontroller?)

At the fundamental level, a microcontroller is a just tiny computer.

从根本上讲,微控制器只是一台微型计算机。

Being a “tiny computer” doesn’t really tell us much, though. So let’s go deeper. Many people associate microcontrollers with Arduino. But it’s important to point out that Arduino is not a microcontroller. Arduino is a complete platform which spans across software and hardware.

但是,作为“微型计算机”并不能告诉我们很多。 因此,让我们更深入。 许多人将微控制器与Arduino相关联。 但是必须指出, Arduino不是微控制器 。 Arduino是一个涵盖软件和硬件的完整平台。

Arduino makes devices like the Arduino Uno:

Arduino制造像Arduino Uno这样的设备:

The Arduino Uno is not a microcontroller, either. It’s a breakout board based on the Atmel ATmega328P microcontroller.

Arduino Uno也不是微控制器。 这是一个基于Atmel ATmega328P微控制器的分线板。

Here is what the Atmel microcontroller looks like:

这是Atmel微控制器的外观:

If you were to have just the Atmel microcontroller in hand, as a beginner, it wouldn’t be very useful. This is where the breakout board comes in.

如果您只是手头有Atmel微控制器,那将不是很有用。 这是突破板的来历。

The breakout board “breaks out” the pins on the microcontroller into a larger device (like the Arduino Uno). This larger device makes the microcontroller easier to use.

分线板将微控制器上的引脚“分线”成更大的设备(例如Arduino Uno)。 更大的设备使微控制器易于使用。

For the Arduino Uno, the breakout board gives you the ability to insert a USB cord, give it power, program the device, and more.

对于Arduino Uno,分线板使您能够插入USB线,为其供电,对设备进行编程等。

Without the breakout board, for a beginner, this would be a daunting task. This problem is the very reason that Arduino exists — to make it super easy for you to learn about hardware.

没有初学者,这将是一项艰巨的任务。 这个问题正是Arduino存在的原因-使其非常容易让您了解硬件。

嗯,就像树莓派吗? (Ah, So it’s like the Raspberry Pi?)

Well, not entirely. Both the Arduino and the Raspberry Pi are still computers by definition. But the Raspberry Pi is considered a single-board computer. A single-board computer is a full computer built on a single circuit board.

好吧,不完全是。 顾名思义,Arduino和Raspberry Pi仍然是计算机。 但是Raspberry Pi被认为是单板计算机 。 单板计算机是建立在单个电路板上的完整计算机

Your laptop is also technically a single-board computer — just a powerful one. The Raspberry Pi is a simple version of the same hardware in your laptop. Just as your laptop runs an operating system (Windows, Mac, or Linux), the Raspberry Pi runs a Linux operating system.

从技术上讲,您的笔记本电脑也是单板计算机,只是功能强大的一台计算机。 Raspberry Pi是笔记本电脑中相同硬件的简单版本。 正如您的笔记本电脑运行操作系统(Windows,Mac或Linux)一样,Raspberry Pi也运行Linux操作系统。

Now, back to Microcontrollers. Microcontrollers can’t run an operating system. Microcontrollers also don’t have the same amount of computing power or resources as most single-board computers.

现在,回到微控制器。 微控制器无法运行操作系统。 微控制器也没有与大多数单板计算机相同的计算能力或资源。

A microcontroller will run just one program repeatedly — not a full operating system. We can see this in Arduino programs because they only need two functions: Setup and loop. Setup will run once and loop will run indefinitely.

微控制器将仅重复运行一个程序,而不是完整的操作系统。 我们可以在Arduino程序中看到这一点,因为它们仅需要两个功能: SetuploopSetup将运行一次, loop将无限期运行。

那么,什么是微控制器? (So, what’s a microcontroller?)

A microcontroller is a small computer with low-memory and programmable input/output peripherals.

微控制器是具有低内存和可编程输入/输出外围设备的小型计算机。

输入/输出 (Inputs/Outputs)

As you probably know, everything with a computer eventually starts with binary (0 or 1).

您可能知道,计算机的所有功能最终都以二进制(0或1)开头。

An input means that the microcontroller will read binary. An example input would be a sensor.

输入意味着微控制器将读取二进制。 输入示例是传感器。

An output means that the microcontroller will send binary. An example output would be to control a motor or LED.

输出意味着微控制器将发送二进制文件。 输出示例是控制电动机或LED。

为什么我们需要微控制器? (Why do we need microcontrollers?)

Well, these were “computers” before we arrived at the idea of the computers you know today. Microcontrollers stuck around because some computing tasks are incredibly trivial and require simple logic. For example, flipping a switch or controlling small components — like a LED light — don’t require the same resources we need for day-to-day tasks like sending an email.

好吧,这些是“计算机”,我们才想到今天知道的计算机。 由于某些计算任务非常繁琐,并且需要简单的逻辑,因此微控制器陷入困境。 例如,拨动开关或控制小部件(如LED灯)不需要像发送电子邮件这样的日常任务所需的资源。

We use them today because their low-powered and low memory makes them low-cost. Microcontrollers are part of the reason the Internet of Things is possible and successful today.

我们之所以今天使用它们,是因为它们的低功耗和低内存使其成本更低。 单片机是当今物联网得以成功的原因之一。

我如何得到一个? (How do I get one?)

Which microcontroller you’ll want to get depends on which problem you want to solve. If you are doing something simple — turning things on and off, or reading a sensor — pretty much any microcontroller will do.

您将要获得哪个微控制器取决于您要解决的问题。 如果您正在做简单的事情(打开或关闭东西,或读取传感器),几乎任何微控制器都可以做。

If you want to play games or have more complex ideas, you’ll need more compute power, so you’ll need to move up to single-board computers, like the Raspberry Pi.

如果您想玩游戏或有更复杂的想法,则需要更多的计算能力,因此需要升级到Raspberry Pi等单板计算机。

Adafruit and Sparkfun both have TONS of kits and hardware that are all amazing. You can also make use of their tutorials.

AdafruitSparkfun都有大量的工具包和硬件,它们都很棒。 您也可以利用他们的教程。

Losant also has some cool kits available. You could build your own door sensor — to be notified when a door is left open for too long.

Losant也有一些不错的 工具包 。 您可以构建自己的门传感器 -在门打开时间过长时收到通知。

If you don’t have a specific problem you want to solve, just grab some hardware and play around with it.

如果您没有想要解决的特定问题,只需购买一些硬件并试用一下即可。

Here are some things you can buy to get started:

您可以购买以下一些入门指南:

1.一个称为NodeMCU的板。 (1. A board called the NodeMCU.)

The NodeMCU is a board based on the ESP8266 microcontroller. This board is special because it’s cheap and WiFi enabled. It will only run you about $8.79 on Amazon and is even less on Ebay.

NodeMCU是基于ESP8266微控制器的开发板。 该板很特别,因为它很便宜并且支持WiFi。 它在亚马逊上的售价仅为$ 8.79,在Ebay上甚至更低。

Not all microcontrollers are WiFi-enabled. The fact that this one is opens the door to a number of projects you can build with this device. For example, you can collect data and send it to the cloud ☁️.

并非所有的微控制器都支持WiFi。 这个事实为您可以使用此设备构建的许多项目打开了大门。 例如,您可以收集数据并将其发送到云☁️。

2.您需要一些传感器 (2. You’ll need some Sensors)

You can’t have hardware without sensors. Sensors give you the ability to detect the environment and the world around you. They’re also a great tool for learning.

没有传感器就无法拥有硬件。 传感器使您能够检测周围的环境和环境。 它们还是学习的好工具。

3.您需要面包板跨接线(3. You’ll need a Breadboard & Jumper Wires:)

To connect a sensor and the microcontroller together, you’ll have to plug them into the Breadboard and use the Jumper wires to connect them.

要将传感器和微控制器连接在一起,您必须将它们插入面包板,并使用跳线连接它们。

Remember: everything is cheaper on eBay and AliExpress. You’ll just have to wait a couple weeks for shipping

请记住: eBayAliExpress上的所有东西都便宜。 您只需要等待几个星期即可发货

我应该建造什么? (What should I build?)

Again — and I can’t stress this enough — it’s way easier to start with a project in mind. Now that you understand what a microcontroller is and how to get one, take a different look at the world around you. What can you control? What can you automate? Once you start to answer those questions, you’ll find a project.

再次强调一下(我对此压力还不够大),从一个项目开始就比较容易。 现在您已经了解了微控制器是什么以及如何获得微控制器,现在换个角度来看一下周围的世界。 你能控制什么? 您可以实现什么自动化? 开始回答这些问题后,您将找到一个项目。

While thinking of projects, Hackster is your best friend. Hackster has a ton of ESP8266 projects and some cool Arduino projects:

在考虑项目时, Hackster是您最好的朋友。 Hackster有大量的ESP8266项目和一些很酷的Arduino项目:

For example, you can live out a childhood dream.

例如,您可以实现童年的梦想。

You can even build robots.

您甚至可以建造机器人。

The point is, you just need an idea.

关键是,您只需要一个想法。

Sometimes programming the real world is more fun than programming virtual ones.

有时,对真实世界进行编程比对虚拟世界进行编程更有趣。

下一步是什么? (What’s next?)

Microcontrollers are only the beginning. You have a world of hardware to explore. Happy Hacking ??

单片机仅仅是开始。 您需要探索许多硬件。 快乐黑客

进一步阅读: (Further reading:)

The Absolute Beginner's Guide to ArduinoOver the Christmas break from work I wanted to learn something new. I've been eyeing up Arduino for some time now, and…forefront.io

Arduino的绝对初学者指南 在圣诞节休假期间,我想学习一些新知识。 我一直在关注Arduino一段时间,并且… forefront.io

Taron Foxworth is a hardware hacker and the Developer Evangelist at Losant. His goal is to translate technology for people to learn, love, and be inspired.

Taron Foxworth Losant的硬件黑客和开发人员。 他的目标是为人们学习,热爱和激发灵感而翻译技术。

翻译自: https://www.freecodecamp.org/news/hardware-fundamentals-what-exactly-is-a-microcontroller-8a502a3650dc/

微处理器硬件喂狗

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值