Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20707 Discussions

USB Device Controller ISP1362

Altera_Forum
Honored Contributor II
1,734 Views

Hi, 

 

I'd like to ask if anyone knows how to transfer more than 64 kBytes between the Device Controller (in chip ISP1362 placed on my DE2_Board) and the Host controller (my computer). 

I'm not able to write more then 64 kbytes into the buffer of the OUT endpoint. 

 

I access the register of the endpoints in PIO mode.  

 

Maybe I have to change the configurations of the 2 endpoints I use, for example to ISOCHRONOUS one (that i don't really know what it is)?  

 

I hope I have been clear enough, 

if anyone would give me even a little suggestion it would be a great help for me! 

 

thank you, 

 

Paola
0 Kudos
21 Replies
Altera_Forum
Honored Contributor II
917 Views

You surely didn't mean 64 kB. Actually the maximum packet size for bulk transfer is 64 byte by USB specification. This isn't a speed limitation, cause multiple packets may be transferred during an USB basic time interval of 1 ms, up to the maximum full speed USB capacity. I'm not particular familiar with ISP1362, but as far as I understand the manual and embedded programming guide, you can place multiple packets into a buffer in advance, as usual with other USB controllers. Bulk transfer is the recommended and most effective method for regular data transfer and e. g. used with mass storage device class (MSC). Isochrone transfer is, as the name suggests, for data that must be delivered continously in time, e. g. audio streams.

0 Kudos
Altera_Forum
Honored Contributor II
917 Views

Hi, 

 

thank you for your answer!  

yes you're right, it's 64 bytes not 64 kBytes and the better mode of transfer is the Bulk transfer. 

 

I found that the Device Controller of the ISP1362 is a core based on Philips ISP1181 Device Controller and the ISP1181 has 2-bit address bus.  

 

So I realized when I try to write to the endpoint an array with 4 elements (1 element=2 bytes) it's all ok, instead when I try to write to the endpoint an array with more than 4 elements I can read from the USB host (my PC) only the first 4 elements, the left ones are all zero...  

 

so that my solution is to implement a FOR loop that write to the endpoint 4 elements per time, but I think there will be a better solution, even if I haven't still any idea about it. 

 

Paola
0 Kudos
Altera_Forum
Honored Contributor II
917 Views

Hi, 

 

I'm using the code from DE2_NIOS_DEVICE_LED demonstration and I'm not able to send more than 8 bytes...  

 

Here is what I changed 

 

In void config_endpoint(void) of MAINLOOP.C: 

 

/*port2 is IN*/ 

Hal4D13_SetEndpointConfig( 

D13REG_EPCNFG_FIFO_EN| 

//D13REG_EPCNFG_DBLBUF_EN| 

D13REG_EPCNFG_IN_EN|  

D13REG_EPCNFG_NONISOSZ_16, <------- All I want is 16 bytes 

EPINDEX4EP02 

); 

 

Now in my main loop: 

static unsigned char bbuf[16]; 

... 

Hal4D13_WriteEndpoint(EPINDEX4EP02,&bbuf, 16); 

 

And in my program in C#: 

[DllImport("EasyD12.dll")] 

private static extern byte ReadPort2(byte[] pData, int iLen); 

ReadPort2(buff, 16); 

 

 

My fisrt 8 bytes are correct but the 8 others are like copy of the 8 first..  

 

Please help!
0 Kudos
Altera_Forum
Honored Contributor II
917 Views

Hi! 

 

I have the same problem... 

I believe the problem is the address bus: it is only 2 bit large, so I cannot write more then 8 byte per time... 

when i try to write more then 8 bytes, the left bytes are all zeros! 

bye 

paola
0 Kudos
Altera_Forum
Honored Contributor II
917 Views

Humm.. 

 

I don't know why you tell that... 8 bytes = 64 bits 

 

 

--- Quote Start ---  

it is only 2 bit large, so I cannot write more then 8 byte per time... 

--- Quote End ---  

 

 

it's 64 bits not 2 ...
0 Kudos
Altera_Forum
Honored Contributor II
917 Views

for example: 

 

if i want to write an array of short, i'll be able to write to the endpoint buffer only the first 4 elements of the array, because with an adrress of 2 bit i can only deal with 4 addrresses... 

 

is it correct?  

 

that's a problem, because the speed is so low for a USB!  

 

bye bye 

paola
0 Kudos
Altera_Forum
Honored Contributor II
917 Views

Ok I understand! 

 

Because my program must work tonight :) I'm sending different message to send all my data
0 Kudos
Altera_Forum
Honored Contributor II
917 Views

hello all, 

I have DE2-70 board and I need to work with USB device.I am now working with a domo  

project "E2_70_NIOS_DEVICE_LED"on DE2-70 board.I download *.sof file and then in  

NIOS II IDE I build and run it.I think it should ask for driver for ISP1362 but it donot. 

I think my system should recognize USB-device as it recognize USB-Blaster.but it is not. 

I am lost and desperate.I have put my one week on it and no results. 

Pleaes guide me how you people working with it. 

give me simple tips and ideas initially to start working with ISP1362.I am not expert in c but I have much work with VHDL and FPGAs. 

Farhat
0 Kudos
Altera_Forum
Honored Contributor II
917 Views

Yes, I also want to have some guides to work with the ISP1362... 

Now I can read from the ISP1362 the packet from the host PC 

but I cannot send anything to the host PC (PC side receive no packet)
0 Kudos
Altera_Forum
Honored Contributor II
917 Views

Hello friends, 

 

I am currently using DE2 70 board. I was trying to use the DE2 board's device property( DE2 boarda as a USB device). I started with the DE2_LED demonstration.unfortunately I am not able to install the USB driver for ISP1362 USB controller driver. I am using Win Xp Operating Sytem. It does not detect my De2 Board and it never ask for the driver as said in the READ me text in the DE2_LED demonstration. 

 

I also facing another interesting situation. Now I am not able to down load any .sof files to my DE2 70 board. It shows an error, JTAG server cant find the device.  

 

Can any one help me in this reagrd???Thanking you in advance.. 

 

Mahesh
0 Kudos
Altera_Forum
Honored Contributor II
917 Views

Hello friends, 

 

I am currently using DE2 70 board. I was trying to use the DE2 board's device property( DE2 boarda as a USB device). I started with the DE2_LED demonstration.unfortunately I am not able to install the USB driver for ISP1362 USB controller driver. I am using Win Xp Operating Sytem. It does not detect my De2 Board and it never ask for the driver as said in the READ me text in the DE2_LED demonstration. 

 

I also facing another interesting situation. Now I am not able to down load any .sof files to my DE2 70 board. It shows an error, JTAG server cant find the device.  

 

Can any one help me in this reagrd???Thanking you in advance.. 

 

Mahesh
0 Kudos
Altera_Forum
Honored Contributor II
917 Views

Dear Farhat, 

 

I also had a similar experience.I could not install the ISP1362 river for one month. I solved the problem recently. You try connecting both USB cables( Blaster and Device ) from the begining. Also do this while building the project.after build is complete rmove the USB cable from Device port aand run the C program, once u get a message chip ID XXX, u connect back the Device USB, your DE2 board will be detected by the OS as a new device and it will prompt you to install the driver.  

I hope this will help you... 

 

Regars, 

Mahesh
0 Kudos
Altera_Forum
Honored Contributor II
917 Views

 

--- Quote Start ---  

Yes, I also want to have some guides to work with the ISP1362... 

Now I can read from the ISP1362 the packet from the host PC 

but I cannot send anything to the host PC (PC side receive no packet) 

--- Quote End ---  

 

People there, 

Since I have the similar goal (to use DE2 board as a USB device) I would really like some guidelines for ISP1362 controller. How to use it, how to program it... 

Please share with me any ideas... 

Regards, 

Bojan
0 Kudos
Altera_Forum
Honored Contributor II
917 Views

Hello, 

 

I'm using the wsiausb of Tonyslagle. You search wisiausb.zip in the web and use the code in your DE2 o DE2-70 board.  

 

I am now working in a project which needs to make the DE2-70 board as a USB device and the host is the PC.  

 

When I try to probe the system, I found these problems: 

 

1) If I connect both the blaster cable and the device cable to the pc or only the blaster, the host  

shows initially the blaster, then I download the firmware to the FPGA and the system do the Enumeration and initialization  

process and the ISP1362 is recognize by the host PC. But, if I disconnect the blaster cable, the system  

is not respond, then I reset the driver by the firmware and the device is doesn't show by the host. 

I am using the VISA USB Raw of National Instrument and its driver in the host. 

 

2) If I work with both the blaster cable and the device cable connected, the system can transmit data 

from PC to device successful, but when I try to send data from device to host PC, it show me a timeout error. 

I check the firmware step by step and it apparently work correctly. 

 

Please, if you can probe and solve these problem, you say me.. 

 

Thanks...
0 Kudos
Altera_Forum
Honored Contributor II
917 Views

Mr, I really can not find Tonyslagle wisiausb.zip drivers on the Internet ! 

Can you, please send it to me or tell me where to find them ? 

 

Thank you very much! 

Bojan
0 Kudos
Altera_Forum
Honored Contributor II
917 Views

Hi! you can search in google or in www.sourceforge.net/projects/wsiausb

 

That's a version 0.1. You should review, and debugg it. I'm working with that too.
0 Kudos
Altera_Forum
Honored Contributor II
917 Views

Hi everyone, 

 

i notice some of U had using the code from DE2_NIOS_DEVICE_LED demonstration(DE2 board CD) and modify it to send 64 bytes data . 

 

Can i know how you modify the coding? 

 

I'm using DE2 board, and i had modify the coding from  

ISR.c (void Isr_Ep01Done(void) ;void Isr_Ep02Done(void))  

and  

mainloop.c (void config_endpoint(void)) 

but i still can't make it send 16 bytes data block. 

 

Please give me some suggestion...... 

thanks.....  

 

Summer
0 Kudos
Altera_Forum
Honored Contributor II
917 Views

hi, 

 

I'm modifying the coding from DE2 board CD -> DE2_demonstrations -> DE2_NIOS_DEVICE_LED. 

For the firmware of device controller for ISP1362 chip, there got six related coding: MAINLOOP.C, CHAP_9.C, D13BUS.C, HAL4SYS.C, HAL4D13.C AND ISR.C. 

 

Where HAL4SYS.C and HAL4D13.C is hardware abstraction layer; 

ISR.C is interrupt service routine; 

CHAP_9.C and D13BUS.C is protocol layer; 

MAINLOOP.C is mainloop. 

 

Does anyone knows which firmware coding need to be modify and which one remains if I want to change the USB data block transfer to 16 bytes data block? 

 

Thanks and regards, 

Summer
0 Kudos
Altera_Forum
Honored Contributor II
917 Views

Hi summer, 

 

I'm doing exactly what you did 2 years ago. " I'm modifying the coding from DE2 board CD -> DE2_demonstrations -> DE2_NIOS_DEVICE_LED." 

 

Instead, Im using DE2-70, but Im having trouble with compiling the project in NIOS II IDE 9.1. Did you have any issues with that? Is there any useful information about modifying the code that you could tell me ? 

 

Thanks 

Ricardo
0 Kudos
Altera_Forum
Honored Contributor II
814 Views

 

--- Quote Start ---  

hello all, 

I have DE2-70 board and I need to work with USB device.I am now working with a domo  

project "E2_70_NIOS_DEVICE_LED"on DE2-70 board.I download *.sof file and then in  

NIOS II IDE I build and run it.I think it should ask for driver for ISP1362 but it donot. 

I think my system should recognize USB-device as it recognize USB-Blaster.but it is not. 

I am lost and desperate.I have put my one week on it and no results. 

Pleaes guide me how you people working with it. 

give me simple tips and ideas initially to start working with ISP1362.I am not expert in c but I have much work with VHDL and FPGAs. 

Farhat 

--- Quote End ---  

 

 

Hi Farhat, 

 

Im currently experiencing the same problem like you, Did you solve that? 

 

Thanks, 

Ricardo
0 Kudos
Reply