How to Use the Pmod Ports on the Arty

When working on a project that involves FPGA coding, it can be stressful especially if you’re a beginner. Luckily there ample resources out there to help out on your venture. In a previous post I talked aboutgetting started with FPGAS和提示从哪里开始。我假设您已经阅读了该帖子,这样我们就可以继续冒险。

几乎全部Digilent的FPGAs带有PMOD端口。PMODS,或外围模块是特殊的组件,已将其很好地包装在一起以易于使用。它们具有许多不同的形状和大小,并为您想做的任何项目提供了大量品种。有一些可以控制直流电动机,步进电动机,按钮,感官温度等。它们很棒,因为它们简单易用。但是,如果您是FPGA的新手,那么您可能不知道试图让PMOD上班时从哪里开始。让我们看看我们是否可以与Arty Board24410580859_b3a5dd8e02_c

The main way to get a Pmod working is through the Arty’s XCD file. This file is used to define all the different inputs, outputs, communication options and other stuff. Here is where we can activate Pmod ports. The Arty has 4 Pmod ports available for our use. Pmod port JA and JD are just standard Pmod ports while ports JB and JC are high speed ports. The high speed ports have faster communication between the Pmod and the Arty but don’t have any protection against short circuits. We are just going to use a standard port for today.

PMOD_PARTS

I want you you to go take a look at the Arty’s主XCD文件, which can be found on it’s资源中心。As you can see most of the code in this file has a ‘#’ in front of it. This is how a line is commented out or omitted from the code. Now lets find the Pmod JA port. It should have the line ##Pmod Header JA before the actual lines we will be focusing on.

n4v

根据PMOD,您实际上只能使用一定部分。PMOD上的最后一个引脚始终用作地面和功率,第一个引脚用于数据。使用12针PMOD,PINS 1-4和7-10是数据引脚,而6和12是VCC,PINS 5和11是地面的。

数字's PmodSTEP to drive a stepper motor.
Digilent的pmodstep驾驶步进马达。

查看这部分代码有点令人困惑,可能没有任何意义。因此,让我们尝试简化这条代码在做什么。SET_PROPERTY将将PIN设置为某个变量。该线的引脚是PMOD端口与PMOD端口相关的实际物理引脚。引脚1或JA端口与板上的G13绑在一起。该软件知道董事会,可以正确中断。对于我们正在做的事情,不应更改前两个项目。现在,GET_PORTS是将其放置在此处的位置,用于收集PMOD端口的值。该变量可以从程序中更改为您选择的变量。

由于PMOD连接器的引脚数(6或12)和数据线(通信协议)的位置不同,因此您需要找出要使用的端口。根据PMOD,您需要查看该特定参考页面。让我们看一下pmodstep。该PMOD有一个12针连接器,但我不需要将所有引脚用于我要做的事情。我正在使用4线步进电机,这意味着我只需要使用PMOD销的一排即可。这是销钉选择和激活变得重要的地方。由于电动机输出引脚是在第7-10引脚上的,因此,如果我使用信号引脚1-4,我只会将顶部的LED点亮,并且电动机没有信号。但是,如果我使用底部4个信号销7-10,我会收到其他LED和步进电机的信号。

You will need to check the Pmod’sreference指南甚至示意图,以确定您需要使用的引脚。一旦您开始使用PMOD端口,它将变得更加容易。当您开始时,您将能够使用PMOD做更多的事情。只是继续练习和学习!

0

关于Robert Prew

我正在爱达荷大学学习电气工程师。我一直对技术,视频游戏,科学和学习新事物感兴趣。我一直相信阿尔伯特·爱因斯坦(Albert Einstein)的说法:“如果您不能解释一下,您就不够理解它”。我渴望自我发现和学习有关自己的新事物。带来欢乐或让别人感到快乐,给我带来了极大的乐趣。通常,您可以让我对一项更具动力方法的活动感兴趣。我将永远努力成为我能成为的最好的人。

View all posts by Robert Prew →

One Comment on “How to Use the Pmod Ports on the Arty”

Leave a Reply

Your email address will not be published.