Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
16 years ago

usb transfer for ISP1362 on DE2 board

hi everyone:),

I'm trying to modify the firmware coding for DE2_NIOS_DEVICE_LEDI from DE2_demonstrations.

But I had problem to modify the coding to send more than 8 byte data per block.

I had modify the coding from ISR.c

void Isr_Ep01Done(void)

...(got coding here)

Hal4D13_ReadEndpoint(EPINDEX4EP01,(data + offset), 16);

offset += 16;

c = Hal4D13_GetEndpointStatusWInteruptClear(EPINDEX4EP01);

...

Hal4D13_WriteEndpoint(EPINDEX4EP02, data, 16);

Hal4D13_GetEndpointStatusWInteruptClear(EPINDEX4EP02);

printf("\n");

...

void Isr_Ep02Done(void)

{

unsignedchar bbuf[16];

int i = 0;

Hal4D13_GetEndpointStatusWInteruptClear(EPINDEX4EP02);

Hal4D13_ReadEndpoint(EPINDEX4EP02,&bbuf, 16);

if( sendCount < length)

{

Hal4D13_WriteEndpoint(EPINDEX4EP02, data + sendCount, 16);

Hal4D13_GetEndpointStatusWInteruptClear(EPINDEX4EP02);

sendCount += 16;

...

and also had modify the coding from MAINLOOP.c

void config_endpoint(void)

{

...

/*port1 is OUT*/

Hal4D13_SetEndpointConfig(

D13REG_EPCNFG_FIFO_EN|D13REG_EPCNFG_NONISOSZ_16,EPINDEX4EP01

);

/*port2 is IN*/

Hal4D13_SetEndpointConfig(

D13REG_EPCNFG_FIFO_EN|D13REG_EPCNFG_IN_EN| D13REG_EPCNFG_NONISOSZ_16,EPINDEX4EP02

);

but still, i can't get it function correctly...

Can anyone help me??:confused:

I'm new in these, please help me...

THanks~~~~

summer
No RepliesBe the first to reply