Intel® FPGA University Program
University Program Material, Education Boards, and Laboratory Exercises
1157 Discussions

What im doing wrong using the Altera UP IP core USB

Honored Contributor II


i am using the Altera University IP core for the USB 2.0 controller. I followed the instructions here: 

My FPGA is a de2-115. I created a qsys design with: 

- 50Mhz clock 

- on chip memory  

- nios2/f cpu 

- interval timer 

- system id peripheral 

- USB Controller  


And made the pin planning in quartus, then i created a main.c file with exactly the code given in the PDF i linked. This should let me detect a usb mouse. 


The USB device is recogniced (after "alt_up_usb_open_dev" i have something with the right usb base adress). But the "alt_up_usb_setup" function never returns. Inside that function i enabled the port info and i can see on the uart terminal output: 



root_hub_port1 = 950095 root_hub_port2 = 960096  

port1_speed = 0 

port2_speed = 0 

Port 1 has USB device connected, assigning address 1...  


Even if no device is plugged in. I'm curious about the port speed of 0 and also the root_hub_port address is changing after each reset. Sometimes after reset a device HID is found but this is not an HID of a mouse and this HID is not always the same. Sadly there is not much documentation how to setup the USB core correctly regarding the pin planning and required qsys settings, so it is most likely that i'm missing something there. Two things i come over and was not sure if i did that right are:  

1. In Quartus Pin Planner i choose 3.3V LVTTL default was 2.5V but i read in the ISP1362 manual that 3.3V is used by the USB controller.  

2. I use the same clock for the usb as for the whole design (50Mhz) maybe i have to use a seperate clock with different speed?  


I also tryed something more smaller. I just assign a value to the HcScratch register and try to read that value than: 

do { alt_up_usb_hc_reg_write_16(usb, 0x28, cnt); test_data = alt_up_usb_hc_reg_read_16(usb, 0x28); if(test_data!=cnt){ printf("Error Encountered!!\n"); printf("Write:%4X, Read:%4X\n", cnt, test_data); error++; } cnt++; } while(cnt<4); if(error==0) { printf("\nNo error!!\n"); } else { printf("Total error : %d\n",error); }  


But the value read in the register is not the value i wrote. 


I would be grateful to any hint or advise..
0 Kudos
1 Reply
Honored Contributor II

Incase someone else comes over a similar problem.  

I found out the version of the de2-115 which i use have not a isp1362, it have a cypress cy7c67200.
0 Kudos