MyFPGA Forum
标题:
DE2_70 Hello World
[打印本页]
作者:
Frank
时间:
2009-4-20 00:12
标题:
DE2_70 Hello World
功能:1、在LCD 上分两行显示 “DE2_70”和“Hello”
2、在NiosII IDE的控制台上显示:“Hello from Nios II!”
C:\Documents and Settings\Frank\My Documents\My Pictures\1.jpg
硬件设计中的顶层文件MY_FIRST_SOPC.v如下:
module MY_FIRST_SOPC
(
//////////////////// Clock Input ////////////////////
iCLK_50, // 50 MHz
//////////////////// LCD Module 16X2 ////////////////
oLCD_ON, // LCD Power ON/OFF
oLCD_BLON, // LCD Back Light ON/OFF
oLCD_RW, // LCD Read/Write Select, 0 = Write, 1 = Read
oLCD_EN, // LCD Enable
oLCD_RS, // LCD Command/Data Select, 0 = Command, 1 = Data
LCD_D, // LCD Data bus 8 bits
);
// PORT declarations
//==================================================
//////////////////////// Clock Input ////////////////////////
input iCLK_50; // 50 MHz
//////////////////// LCD Module 16X2 ////////////////////////////
inout [7:0] LCD_D; // LCD Data bus 8 bits
output oLCD_ON; // LCD Power ON/OFF
output oLCD_BLON; // LCD Back Light ON/OFF
output oLCD_RW; // LCD Read/Write Select, 0 = Write, 1 = Read
output oLCD_EN; // LCD Enable
output oLCD_RS; // LCD Command/Data Select,
// 0 = Command, 1 = Data
//========== 16*2 LCD Module
assign oLCD_ON = 1'b1; // LCD ON
assign oLCD_BLON = 1'b1; // LCD Back Light
// Structural coding
//==================================================
DE2_70_SOPC u1 (
// 1) global signals:
.clk(iCLK_50),
.reset_n(1),
// the_lcd
.LCD_E_from_the_lcd(oLCD_EN),
.LCD_RS_from_the_lcd(oLCD_RS),
.LCD_RW_from_the_lcd(oLCD_RW),
.LCD_data_to_and_from_the_lcd(LCD_D)
);
endmodule
复制代码
锁定引脚:
C:\Documents and Settings\Frank\My Documents\My Pictures\2.png
然后compile/download
软件设计时,编写Hello_world.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "system.h"
void hello_lcd(void);
int main()
{
printf("Hello from Nios II!\n");
hello_lcd();
return 0;
}
void hello_lcd(void){
FILE *pLCD;
char szHello[] = "DE2_70\nHello\n";
pLCD = fopen(LCD_NAME, "w");
if (pLCD){
fwrite(szHello, strlen(szHello), 1, pLCD);
//fclose(pLCD);
}else{
printf("failed to open LCD\n");
}
}
复制代码
作者:
Frank
时间:
2009-4-20 00:14
图片怎么贴不上来呀?
作者:
sharon_ho
时间:
2009-4-20 13:57
2#
Frank
MyFPGA Forum » 帮助 » 我如何发表新主题
我如何实现发帖时图文混排效果[ 展开 ]
发表新主题的时候点击上传附件左侧的“[插入]”链接把附件标记插入到帖子中适当的位置即可。
http://www.myfpga.org/discuz/faq ... =5&messageid=17
作者:
Frank
时间:
2009-4-21 11:04
本帖最后由 Frank 于 2009-4-21 11:09 编辑
将缺的两个图补上来。
图一是系统整体架构图
1.jpg
(90.22 KB, 下载次数: 678)
下载附件
保存到相册
2009-4-21 11:04 上传
图二是DE2_70的Pin Location
2.png
(66.46 KB, 下载次数: 651)
下载附件
保存到相册
2009-4-21 11:04 上传
作者:
fanxingrong
时间:
2009-4-27 19:59
:$
作者:
xlbian
时间:
2009-5-24 13:41
学习了!
作者:
herman2
时间:
2010-3-3 08:52
Thanks for your sharing.
作者:
培培
时间:
2010-3-9 15:37
假如我现在不用函数hello_lcd();,只是在LCD上显示Hello from Nios II!,也就是说NiosII中的.c文件中的内容不动;
用SOPC建立的系统中加入一个Timer定时器,我想在LCD上循环显示Hello from Nios II!, 但是通过Quartusii和Niosii编译了下载到开发板上之后字符怎么不动呢?
欢迎光临 MyFPGA Forum (http://www.myfpga.org/discuz/)
Powered by Discuz! X3