|
|

楼主 |
发表于 3-12-2006 10:24 PM
|
显示全部楼层
原帖由 kelvinkiu 于 3-12-2006 10:03 PM 发表
哈哈,连他都没法子的话,我也没什么办法了。本来NIOS也只是student edition罢了,以前我们就发现他的不足。所以我的project就需要用两片NIOS板来操作。不知KBU买新的NIOS办了吗?如果还是用旧的话,我记得有一些板 ...
现在面对的这个问题,我明天会去问他,我把apex板借回家来做,现在一直试port那里都没有试output。
我用的是从altera FTP下载下来的Nios 3.2,应该是完整版吧。我拿到的板是新的APEX20K200E。
原来是学长,可以告诉我你叫什么名字吗?
Port数量的问题我也有发现到了,5V电压那里的接角已经不够控制一个8K x 8的RAM了,现在在找着资料如何控制3.3V电压那里的接角。 |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 6-12-2006 07:18 PM
|
显示全部楼层
|
port不能output的问题已经解决了,原来每次要output都要download nios进FPGA一次,有点麻烦。 |
|
|
|
|
|
|
|
|
|
|
发表于 6-12-2006 10:05 PM
|
显示全部楼层
|
哈哈,就是这样麻烦的啦。我以前也是这样熬过来的。3.3V的port好像是需要外接一样“东西”才能用哦。 |
|
|
|
|
|
|
|
|
|
|
发表于 6-12-2006 10:09 PM
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 7-12-2006 01:30 AM
|
显示全部楼层
原帖由 kelvinkiu 于 6-12-2006 10:05 PM 发表
哈哈,就是这样麻烦的啦。我以前也是这样熬过来的。3.3V的port好像是需要外接一样“东西”才能用哦。
3.3V的output需要接74244(tri-state buffer)吗?要input进3.3V那里之前要接什么converter或者regulator暂时还没有想到。
偷懒了一天,明天要测试input近5V的那里了,希望能成功读取,不然又要给Miss Chan和Mr. Andy催了~_~ 基本上我的part和另外一个的hardware part是没有问题了,只是还有两个group member还有一点不知所谓酱。
还有,我打算把3.3V的那区当output就好了,5V的那里做I/O。
原帖由 kelvinkiu 于 6-12-2006 10:09 PM 发表
忘了告诉你我是宽中95那届的,2000年毕业。
我是小你3年的学弟,2003年毕业。我的group member(你的另一个学弟)认识明达,他好像尝试跟明达拿你们的thesis,因为我们只找到你的另外两个group member交上去的CD,你跟明达的CD还在找着。
[ 本帖最后由 GuoHui 于 7-12-2006 01:44 AM 编辑 ] |
|
|
|
|
|
|
|
|
|
|
发表于 7-12-2006 08:12 PM
|
显示全部楼层
|
最好不要用74244,这样很可能会造成托电,会烧掉你的板。除非你的负载没那么大。否则建议你使用电晶体就好了。 |
|
|
|
|
|
|
|
|
|
|
发表于 7-12-2006 08:23 PM
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
发表于 7-12-2006 09:01 PM
|
显示全部楼层
跟明達講我是gandi...
忘了我這個小弟了哦...
哈哈... |
|
|
|
|
|
|
|
|
|
|
发表于 8-12-2006 12:37 PM
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
发表于 8-12-2006 06:22 PM
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 13-1-2007 11:51 PM
|
显示全部楼层
|
现在因为板上的记忆体还是不够,所以考虑用到SDRAM,因为板上已经有一个SO-DIMM的SDRAM slot,但是我不知道要怎样控制,请问有高手会吗? |
|
|
|
|
|
|
|
|
|
|
发表于 15-1-2007 02:27 AM
|
显示全部楼层
你们哦~ 在这里谈到津津有味~
还好我有来看看~ 呵呵
凯文。。。。。 你又一次摆我的名字上来啊。。。:@ :@ :@
很久没有见到你了。 
GuoHui,你的问题噢。。。
我没有尝试过 不过你可以参考这个 nios flash read/write 程式
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include "alt_types.h"
#include "sys/alt_flash.h"
#include "system.h"
#include "sys/alt_flash_dev.h"
#define NUM_BYTES_TO_WRITE 512
/*
* test_programming() is called by main to test a range of flash by
* writing incrementing patterns, then reading them back and comparing
* the result
* The start of the range to be tested is defined by test_offset, and
* the size of the range to be tested is defined by NUM_BYTES_TO_WRITE
*/
int test_programming( alt_flash_fd* fd, int test_offset)
{
int i,j;
alt_u8 data_written[NUM_BYTES_TO_WRITE];
alt_u8 data_read[NUM_BYTES_TO_WRITE];
int ret_code = 0;
int test_length = sizeof(data_written);
/*
* 30 iterations takes about 60 seconds
*/
for (j=0;j<30;j++)
{
for(i=0;i<sizeof(data_written)/2;i++)
data_written = j*5;
for(i=sizeof(data_written)/2;i<sizeof(data_written);i++)
data_written = (j*5)+1;
ret_code = alt_write_flash(fd, test_offset, data_written, test_length);
if (!ret_code)
{
ret_code = alt_read_flash(fd, test_offset, data_read, test_length);
if(!ret_code)
{
if (memcmp(data_written, data_read, test_length))
{
printf( "\nERROR: compare failed sector offset %#x iteration%#x\n",
test_offset, j);
return ret_code;
}
}
}
printf("*" ;
if (ret_code)
{
printf( "\nERROR: function alt_write_flash failed. ret_code %d\n",
ret_code);
return ret_code;
}
}
return ret_code;
}
/*
* test_get_info() is called by main to test that the regions, sector
* size, block size and number of blocks can be correctly read from
* the flash
*/
int test_get_info( alt_flash_fd* fd)
{
int ret_code = 0;
int number_of_regions=0;
flash_region* regions;
int i;
ret_code = alt_get_flash_info(fd, ®ions, &number_of_regions);
if (ret_code)
{
printf( "\nERROR: function alt_get_flash_info failed. ret_code %d\n",
ret_code);
}
/*
* If this is the development board check the number of regions etc.
*/
if (!strcmp("/dev/ext_flash_altera", fd->name))
{
if (number_of_regions != 1)
{
printf("\nERROR: number of regions is wrong\n" ;
ret_code = -EINVAL;
}
else if ( (regions->offset != 0) || (regions->region_size != 0x800000)
|| (regions->block_size != 0x10000) ||
(regions->number_of_blocks != 0x80))
{
printf("\nERROR: region info is wrong\n" ;
ret_code = -EINVAL;
}
}
else
{
printf("\n\rThis is www.icwin.net NIOSII Board Designed by flash Logic\n\r" ;
printf("Flash name %s\n\r",fd->name);
printf("This flash has %d erase regions\n\r", number_of_regions);
for (i=0;i<number_of_regions;i++)
{
printf("Start 0x%8x End 0x%8x Number of Blocks %3d Block Size 0x%8x\n\r",
(regions+i)->offset,
(regions+i)->region_size+(regions+i)->offset,
(regions+i)->number_of_blocks,
(regions+i)->block_size);
}
}
return ret_code;
}
/*
* Run various tests on a small section of the system flash.
*/
int main (void)
{
int ret_code;
int test_offset;
alt_flash_fd* fd;
alt_u8 write_data[100];
alt_u8 read_data[100];
int i;
fd = alt_flash_open_dev(EXT_FLASH_NAME);
if (fd)
{
printf("\n<----> Running Flash Tests <---->\n\r" ;
printf("-Testing flash info retrieval..." ;
ret_code = test_get_info(fd);
if (ret_code)
{
printf( "\n\rERROR: function test_get_info failed. ret_code %d\n\r",
ret_code);
goto finished;
}
printf(" passed.\n\r" ;
printf("-Testing flash write...\n\r" ;
printf(" 0x10000: " ;
test_offset = 0x10000;
ret_code = test_programming(fd, test_offset);
if (ret_code)
goto finished;
printf(" passed.\n\r" ;
printf(" 0x1ff00: " ;
test_offset = 0x1ff00;
ret_code = test_programming(fd, test_offset);
if (ret_code)
goto finished;
printf(" passed.\n\r" ;
printf(" 0x10100: " ;
test_offset = 0x10100;
ret_code = test_programming(fd, test_offset);
if (ret_code)
goto finished;
printf(" passed.\n\r" ;
printf("-Testing flash block erase..." ;
ret_code = alt_erase_flash_block(fd, test_offset, 0x10000);
if (ret_code)
{
printf( "\n\rERROR: function alt_erase_flash_block failed. ret_code %d\n\r",
ret_code);
goto finished;
}
else
{
ret_code = alt_read_flash(fd, test_offset, read_data, 100);
for (i=0;i<100;i++)
{
if (read_data != 0xff)
{
printf("\n\rERROR: erase compare failed. %d %#x\n\r", i, read_data);
goto finished;
}
}
}
printf(" passed.\n\r" ;
printf("-Testing flash block write..." ;
for(i=0;i<100;i++)
write_data = i;
ret_code = alt_write_flash_block( fd, 0x10000,
test_offset, write_data,
100);
if (ret_code)
{
printf( "\n\rERROR: function alt_write_flash_block failed. ret_code %d\n\r",
ret_code);
goto finished;
}
else
{
ret_code = alt_read_flash(fd, test_offset, read_data, 100);
for (i=0;i<100;i++)
{
if (read_data != write_data)
{
printf( "\n\rERROR: compare failed, expected %#x read %#x\n\r",
write_data, read_data);
goto finished;
}
}
}
printf(" passed.\n\r" ;
test_offset = 0x10003;
printf("-Testing unaligned writes....." ;
ret_code = alt_write_flash_block( fd, 0x10000,
test_offset, write_data,
100);
if (ret_code)
{
printf( "\n\rERROR: function alt_write_flash_block failed. ret_code %d\n\r",
ret_code);
goto finished;
}
else
{
ret_code = alt_read_flash(fd, test_offset, read_data, 100);
for (i=0;i<100;i++)
{
if (read_data != write_data)
{
printf( "\n\rERROR: compare failed, expected %#x read %#x\n\r",
write_data, read_data);
goto finished;
}
}
}
printf(" passed.\n\r" ;
printf("All Tests Passed!\n\r" ;
}
else
{
printf("Can't open the flash device\n\r" ;
}
finished:
alt_flash_close_dev(fd);
printf("Exiting Flash Tests\n\r" ;
return 0;
}
[ 本帖最后由 jefferylee 于 15-1-2007 02:31 AM 编辑 ] |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 15-1-2007 01:18 PM
|
显示全部楼层
这个是Nios II的program哦?
我大概看了,这个跟Nios的
int nr_flash_write_buffer
(
unsigned short *flash_base,
unsigned short *start_address,
unsigned short *buffer,
int halfword_count
);
差不多,都是写好了的function,不过还是谢谢了。
尝试用过DMA(Direct Memomry Access),不知道是我不会用还是不能用,一样也是不成功。 |
|
|
|
|
|
|
|
|
|
|
发表于 16-1-2007 08:21 PM
|
显示全部楼层
|
忠艺大哥,这是你的第几代弟子了?说你是NIOS的祖师爷都不过份呱。 |
|
|
|
|
|
|
|
|
|
|
发表于 19-1-2007 12:54 PM
|
显示全部楼层
不要這樣講等一下我去問他東西時他都不回我......我就olin.
我們到嫌在還是不會控制nios的sdram啊.... |
|
|
|
|
|
|
|
|
| |
本周最热论坛帖子
|