如何制作自己的微控制器?
如何制作自己的微控制器? 我已经使用 GAL 芯片完成了一些工作,并对芯片进行了编程以执行简单的命令,例如添加、加载、移动、异或和输出,但我想做一些更像真正的微控制器的事情。
我该怎么做呢? 我读过一些有关 FPGA 和 CPLD 的内容,但不是很多,因此正在寻找一些关于获得什么以及如何开始开发的建议。
How can I make my own microcontroller? I've done some work using GAL chips and programmed a chip to do simple commands such as add, load, move, xor, and output, but I'd like to do something more like a real microcontroller.
How can I go about doing this? I've read a little bit about FPGA and CPLD, but not very much, and so was looking for some advice on what to get and how to start developing on it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(9)
Xilinx 有一个 MicroBlaze 和 PicoBlaze FPGA 软控制器。 后者是免费的,而 IIRC、Microblaze 则需付费。
顾名思义,PicoBlaze 是一款小型处理器,有其局限性,但 OTOH 足够紧凑,可以在 CPLD 上运行。 无论如何,这是一个不错的处理器,可以帮助您入门。
Pablo Bleyer 有一个与 PicoBlaze 兼容的 PacoBlaze。 PacoBlaze 是用 Verilog 编写的(正如 Adam 所说,Verilog 不如 VHDL 常见)。
Xilinx has a MicroBlaze and a PicoBlaze soft controller for its FPGAs. The latter is free, while, IIRC, the Microblaze is to be paid for.
As its name suggests the PicoBlaze is a small processor, which has its limitations, but OTOH is compact enough to run on a CPLD. Anyway a nice processor to get you started.
Pablo Bleyer has a PicoBlaze-compatible PacoBlaze. PacoBlaze was written in Verilog (which, like Adam said, less common than VHDL).
您可以在此站点获取 pic 微控制器的免费样品。 我最后才知道,你甚至不需要支付运费。
http://www.microchip.com/stellent/idcplg?IdcService= SS_GET_PAGE&nodeId=64
You can get free samples of pic micro controllers at this site. Last I knew, you don't even have to pay shipping.
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=64
你需要一个大的fpga来配合一个小的mcu。
如果您需要 AD 之类的东西,您需要具有正确硬件模块的 FPGA。
你需要一个软核来放入fpga中。
但是在这个项目之前先尝试一下普通的 MCU 怎么样?
所以你知道你要去哪里吗? Atmel 的一些 AVR:s 怎么样?
You need a big fpga for a little mcu.
You need a fpga with the correct hardware blocks if you need things like AD.
You need a soft core to put into the fpga.
But how about to just play around with a normal MCU before this project,
so you kind of know where you are going? How about some AVR:s from Atmel.
请在此处查找一本优秀的 wiki 书籍。 我有一些在教电子工程时写的课程作业,但我找不到。 当我教学时,大多数学生都很乐意使用 Xilinx 基础包中的原理图捕获工具。 他们现在已经转向 ISE 和 WebPACK。 你可以免费下载WebPack,它很有用,它有原理图捕获和模拟功能。
如果您真的想脱颖而出,请学习 VHDL 或 Verilog(VHDL 在我工作过的地方似乎更常见,但这只是一小部分)并对设计进行编码,而不是通过 GUI 输入它。
如果您对数字逻辑设计(以及一些 HDL)有所了解,我认为您可以在大约 2 天内获得一个在 VHDL 中进行模拟的功能性 8 位微处理器。 在那段时间里,你不会构建出任何非常快或非常强大的东西,但这是一个很好的成长起点。 如果您必须学习数字设计,请花几天时间了解这些工具的工作原理并模拟一些基本逻辑电路,然后再进行 uP 设计。
开始学习数字系统的基础知识以及如何构建二进制加法器。 继续构建 ALU 来处理加法、减法、与、或、异或等,然后构建一个定序器来从 RAM 读取操作码并将其提供给执行单元。
您可以喜欢指令集设计,但我建议您从非常简单的开始,直到您了解正在发生的事情,然后将其扔掉并重新开始更复杂的东西。
一旦您对设计进行了很好的模拟,您就可以衡量其复杂性并购买适合的设备。 您应该查看适合您选择的设备系列的开发系统。 选择比您开发所需的设备更大的设备,因为能够在运行时添加额外的仪器来调试它是很好的,而且您几乎肯定不会在设备上使用的早期阶段优化您的设计。
编辑: Colin Mackenzie 有一个关于 uC 设计和一些 FPGA 板以及其他一些内容的很好的教程。
Look here for a good wiki book. I had some coursework I wrote when I was teaching Electronic Eng, but I couldn't find it around. When I was teaching, most of the students were happy to use the schematic capture tools in the Xilinx Foundation package. They've moved onto ISE and WebPACK now. You can download the WebPack for free, which is useful, and it has schematic capture and simulation in it.
If you really want to shine, learn VHDL or Verilog (VHDL seems to be more common where I've worked, but that is only a small smattering of places) and code the design rather than enter it through the GUI.
If you know ANYTHING at all about digital logic design (and some HDL) I rekon you can have a somewhat functional 8-bit microprocessor simulating in VHDL in about 2 days. You're not going to build anything blazingly fast or enormously powerful in that time but it's a good starting point to grow from. If you have to learn about digital design, factor in a couple of days to learn how the tools work and simulate some basic logic circuits before moving onto the uP design.
Start learning the basics of digital systems, and how to build a binary adder. Move on to building an ALU to handle addition, subtraction, and, or, xor, etc and then a sequencer to read opcodes from RAM and supply them to the execution unit.
You can get fancy with instruction set design, but I'd recommend starting out REALLY simple until you have your head around whats going on, then throw it out and start again with something more complex.
Once you have the design simulating nicely you can gauge its complexity and purchase a device to suit. You should look at a development system for the device family you've chosen. Pick a device bigger than what you need for development because it's nice to be able to add extra instrumentation to debug it when it's running, and you almost certainly won't have optimized your design in the early stages of getting it on the device.
EDIT: Colin Mackenzie has a good tutorial about uC design and some FPGA boards as well as a bit of other stuff.
您可能想看看 OpenCores.org,这是一个用于开源 IP 核开发的“锻造”网站。 另外,考虑给自己买一个像其中一个这样的开发板来玩。
许多工具生态系统都围绕 VHDL,尽管 Avalda 正在开发用于 FPGA 编译 F# 的工具。
You may want to have a look around OpenCores.org, a "forge" site for open source IP core development. Also, consider getting yourself a development board like one of these to play around with.
Much of the tools ecosystem revolves around VHDL, although Avalda is working on tools to compile F# for FPGAs.
要使用软核微处理器,我喜欢 Spartan 3 入门板 来自 Digilent 只是因为它有 1M 静态 RAM。 你知道,SDRAM 和 DDR RAM 更难使用。
LED、开关和简单的串行接口有利于调试和通信。
正如有人已经指出的那样,OpenCores.org 是查找工作示例的好地方。 我在大学期间使用 Plasma uC 写了一些论文。
To play with soft-core microprocessors, I like the Spartan 3 Starter Board from Digilent just because it has 1M of static RAM. SDRAM and DDR RAM are harder to get going, you know.
The leds, switches and a simple serial interface are a plus to debug and communicate.
As someone already pointed out, OpenCores.org is a good place to find working examples. I used the Plasma uC to write some papers while on university.
微控制器可以像 ROM 一样简单(指令*2^x +(时钟相位)是地址,输出是控制信号,就可以开始了)。 或者它可以是一个复杂的哈利野兽,具有三个手臂和分支预测支持硬件。
您能详细介绍一下您的愿望吗?
A microcontroller can be as simple as a ROM (instruction*2^x + (clock phase) is the address, outputs are the control signals, and you're good to go). Or it can be a complex harry beast with three arms and branch prediction support hardware.
Can you give more details about your aspirations?
在搜索了你们所有人的一些非常有用的链接后,我发现了这个维基学院课程。
第一句话是:“你有没有想过构建自己的微处理器?”
After searching some very helpful links by all of you, I came across this Wikiversity course.
One of the first sentences is, "Have you ever thought to build your own microprocessor?"
我曾经看过一本教科书,详细介绍了如何使用 TTL 芯片构建一台机器。 它具有与 PDP-8 相同的指令集,这非常 - 我的意思是非常 - 简单,因此实际的机器架构很容易以这种方式实现。
PDP-8 FAQ 提到了一本书:“数字设计艺术," 第二版,作者:Franklin Prosser 和 David Winkel(Prentice-Hall, 1987 年,ISBN 0-13-046780-4)。 它还提到人们在 FPGA 中实现它。
鉴于该 CPU 架构的极其简单性以及 PDP-8 代码或参考实现的可用性,它可能是一个很好的热身起点。
另外,我的一位熟人在 FPGA 上实现了拇指(砍掉 ARM),作为由 Steve Furber(著名的 Acorn 校友)运营的一个大学项目。 考虑到它可以被压缩成足够小的格式以供大学项目使用,这也可能是一个好的开始。
I saw a textbook once that stepped through building a machine from TTL chips. This had the same instruction set as a PDP-8, which is very - and I mean very - simple, so the actual machine architecture is easy to implement in this way.
The PDP-8 FAQ mentions a book: "The Art of Digital Design," second edition, by Franklin Prosser and David Winkel (Prentice-Hall, 1987, ISBN 0-13-046780-4). It also mentions people implementing it in FPGA's.
Given the extreme simplicity of this CPU architecture and availability of PDP-8 code or reference implementations it might be a good starting point to warm up with.
Alternatively, an acquaintance of mine implemented a thumb (cut down ARM) on a FPGA as a university project run by one Steve Furber (a prominent Acorn alumnus). Given that this could be compressed into a format small enough for a university project it might also be a good start.