玩转FPGA山寨版

看了《玩转FPGA》,写的不错,写写山寨版和大家交流!

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

昨晚一位朋友给我一块电路板让我帮他调试,现在的问题是板子时而工作时而不工作。看了看PCB板,挺复杂的,看样子他花了不少心血。板子上有两块控制芯片,其一是Altera 公司的FPGA,Cyclone II系列EP2C8;其二是Amtel 公司的单片机。

看着PCB板我也无从下手,只能通电断电,真的像他说的,时而工作时而不工作。当然电源指示还是一直亮着的,为了调试的方便,他在FPGA和单片机的IO口上各引出来一个脚接LED,FPGA和单片机是否正常工作只需要看LED是否闪烁。通电FPGA的LED和单片机的LED都没有闪烁,呵呵,来机会测试了。

对于FPGA首先看电源是否OK,3.3V,每个VCC都接上了,没有问题,GND都接地,OK!用示波器看晶振的输出脚,示波器上显示31.994MHz,波形像是sin波,不是正规的矩形波,大概是示波器采样的问题,32MHz啊!

FPGA不工作,单片机也不工作,在电路图上找了找,单片机没有接晶振,可能使用内部RC,突破口还是放在FPGA上面。启动能正常工作,以后就能正常工作,启动不能正常工作就不工作了,难道FPGA的EPCS芯片有问题,不对,应该是bootloader有问题,FPGA有时候不能从EPCS读取程式。示波器的测试点放在EPCS芯片的DATA引脚上,通电断电……,发现FPGA正常工作时,示波器上有波形,不工作是就没有波形。仔细查看EPSC那块的电路,发现端倪了。

DATA引脚上面接一个R25,没什么问题啊?只有51欧姆,短接再说,再搜索……

MSEL0,MSEL1  接1K下拉电阻,嘿!不对啊,记得好像直接接地的……,查芯片手册……

Figure 4–2. Cyclone FPGA Configuration in AS Mode (Serial Configuration Device Programmed Using Download Cable)
(Note 4)

Notes to Figure 4–2:
(1) VCC = 3.3 V.
(2) Serial configuration devices cannot be cascaded.
(3) Connect the FPGA MSEL[] input pins to select the AS configuration mode. For details, refer to the appropriate FPGA family chapter in the
Configuration Handbook.
(4) For more information about configuration pin I/O requirements in an AS scheme for a Cyclone III FPGA, refer to the Configuring Cyclone III Devices
chapter in volume 1 of the Cyclone III Device Handbook.

MSEL[]为00,1K下拉电阻,MSEL[]未必是低电平,短接R18,R19再说,通电断电、通电断电……每次两个LED都闪烁,成功了!为了PCB的美观,上面电阻都是0805封装的,就换成0欧姆0805封装的电阻。

看看数据手册上怎么写的

MSEL Pin Settings
The MSEL input buffers are powered by the VCCPD

ower supply. Altera recommends you hardwire the MSEL[] pins to VCCPD or GND.
The MSEL[3..0] pins have 5-k internal pull-down resistors that are always active.
During POR and during reconfiguration, the MSEL pins must be at LVTTL VIL and VIH
levels to be considered logic low and logic high, respectively.

 To avoid problems with detecting an incorrect configuration scheme, hardwire the
MSEL[] pins to VCCPD or GND without pull-up or pull-down resistors.
Do not drive
the MSEL[] pins by a microprocessor or another device.

为了避免错误识别配置,硬件要将MSEL接VCC或者GND,不是接上拉电阻和下拉电阻

posted on 2010-07-05 20:10  Neddy11  阅读(1519)  评论(1)    收藏  举报