Forum Discussion
Altera_Forum
Honored Contributor
17 years agoDE2 board USB communication
Hello people,
I'm curious to know is there anyone who have experience with DE2 board USB communication ? There is some ISP1362 USB-OTG controller which must be appropriate configured in order to communicate with USB device plugged into DE2 USB connector. Does anybody worked with this controller using VHDL programming language ? Is there a lot of problem to configure ISP1362 USB-OTG controller ? Thank you very much, Bojan34 Replies
- Altera_Forum
Honored Contributor
Hi,
I’m modifying the firmware coding of device controller which found from DE2 CD. My target is to send 16 bytes data block per transmission. I had modify the coding from ISR.c and mainloop.c But I still fail to make it transfer 16 bytes data per packet. (this is the coding from interrupt service routine,ISR.c) void Isr_Ep02Done(void) { unsigned char bbuf[16]; int i = 0; Hal4D13_GetEndpointStatusWInteruptClear(EPINDEX4EP02); Hal4D13_ReadEndpoint(EPINDEX4EP02,&bbuf, 16); //error was found here : passing arg 2 of //'hal4d13_readendpoint' from incompatible pointer type. if( sendCount < length) { Hal4D13_WriteEndpoint(EPINDEX4EP02, data + sendCount, 16); Hal4D13_GetEndpointStatusWInteruptClear(EPINDEX4EP02); sendCount += 16; if(sendCount > length) { sendCount = 0; length = 0; for( i = 0; i < 65; i++) data[i] = 0; } } } Can anyone give me suggestion on how can I debug this error? I’m stuck…. Thanks, Summer - Altera_Forum
Honored Contributor
According to the function prototype
the correct syntax isUSHORT Hal4D13_ReadEndpoint(UCHAR bEPIndex, UCHAR * buf, USHORT len);
It has nothing to do with NIOS II, just a basic C syntax issue.Hal4D13_ReadEndpoint(EPINDEX4EP02,bbuf, 16); - Altera_Forum
Honored Contributor
Hi all,
Now, i am building SOPC system to make communication between PC and USB in DE2 using USB chip controller philips ISP1362. I read in such tutorial (lower version of NIOS II 9.0) that I have to make interface to the NIOS II Processor by choosing "Interface to User Logic" in the subtree "Legacy Components". But I didn't find that interface in NIOS II 9.0 IDE. What is the name of that interface in the NIOS II 9.0 IDE? Thank you... - Altera_Forum
Honored Contributor
hi,
i'm doing finnal year project now, the project title is: doing an USB communicatin in VHDL, it is same with your project, DE2board, ISP1362... I haven't learnt VHDL before, so i have no idea about it. Have you finish your project? I need you help...Thank you very much^^ - Altera_Forum
Honored Contributor
I think you should learn about VHDL programming first, then you try to implement simple design in FPGA. After that you move to your true project. One of recommended books to learn VHDL is Circuit Design with VHDL by Volnei A. Pedroni.
- Altera_Forum
Honored Contributor
thanks, but i only have 2 weeks to finish the project, and it is too busy right?!
- Altera_Forum
Honored Contributor
I think that learning VHDL and use it to implement the USB protocol in two weeks is a bit optimistic, yes.
- Altera_Forum
Honored Contributor
aaaa:(, then how to do now, i'm crying la
- Altera_Forum
Honored Contributor
while (tmp = '0') loop
if (buffer_full = '0') then tmp <= '0'; elsif (buffer_full = '1') then tmp <= '1'; end if; end loop; Error: loop must terminate within 10000 iterations Error: can't elaborate top-level user hierarchy anyone who can help me find where is my mistake? thanks veryu much - Altera_Forum
Honored Contributor
you don't have any pause in your loop, so if buffer_full is 0, then you will get stuck in the loop indefinitely.
What are you trying to do?