Bulk protocole for USB communication (LPC1769)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Bulk protocole for USB communication (LPC1769)

1,272 Views
vivienpac
Contributor I

Hello everybody,

 

I am using the microcontroler LPC1769 and I communicate with a smartphone thanks to the protocole bulk and the function send_data(). This function comes from "Example_Keyboarddevice", available on the NXP website. I would like to send pieces of data every 10 microseconds. I only manage to send it every 1ms with the bulk protocole. I tried to change some parameters but i still cant transmit data as fast as I want.

Do you know if it's possible the change the data transfer, and how I could procede?

Best regards,

Pac.

 

Tags (3)
0 Kudos
9 Replies

974 Views
vivienpac
Contributor I

sorry for the late answer, you should find the header file bsp.h in the directory BSP

0 Kudos

974 Views
jeremyzhou
NXP Employee
NXP Employee

Hi vivien pac,

How is going on about this issue? whether you had already fixed it.
Have a great day,
TIC

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

974 Views
vivienpac
Contributor I
0 Kudos

974 Views
jeremyzhou
NXP Employee
NXP Employee

Hi vivien pac,

Sorry for reply late because of Labor Day holiday.
I find that it has some errors after compiling the demo.
pastedImage_1.png
The keyboard demo illustrates a board will enumerate on the PC as a HID Keybaord device after connect to a PC when is demo is running
For your implemenation, the board will become the host, and it need to do some modifications, however I don't find these modification in the attachment.
Whether you can introduce them in details.

Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

974 Views
vivienpac
Contributor I

In fact the master is the microcontroler LPC1769, and the slave is the smartphone .This is the link to retrieve the compile-able demo :

https://www.dropbox.com/s/rjldi5vbcvq5oaw/code%20npx.zip?dl=0

0 Kudos

974 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,

Whether you share a download link of Google drive, as I can't open it.

Have a great day.

TIC

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

974 Views
vivienpac
Contributor I

Yes, that’s it. I want to send data to Endpoint whose type is Bulk at fixed period (10μs)

I can send this data every 1ms, but I’m not able to reduce this period.

 

I changed the clock to go to the RIT_timer every 10µs, and that works fine. I’m able to switch on/off a port every 10 µs:

 

void RIT_SetTimerInterval(uint32_t time_interval)

 {

       uint32_t cmp_value;

 

       /* Determine aapproximate compare value based on clock rate and passed interval */

       cmp_value = (500) * time_interval; //(50000)=1ms

 }

 

 

And in the RIT_timer, that’s what I do:

 

void RIT_IRQHandler(void)

{

      interrupt_rit++;

      uint8_t buff1[2];

       /* Clearn interrupt */

       RIT_ClearInt();

       echantillon=echantillon+1;

       if (echantillon>4095){

             echantillon=0;

       }

      uint32_t interupt_enabled0 = *(uint32_t*) LPC_ISER0;

      uint32_t interupt_enabled1 = *(uint32_t*) LPC_ISER1;

      *(uint32_t*) LPC_ICER0 = ~(1<<24);

      *(uint32_t*) LPC_ICER1 = 0;

      *(uint32_t*) LPC_U2FCR &= 0xFFFFFFF7;

      *(uint32_t*) LPC_U2TER = UART_TER1_TXEN;

      UART_IntDisable( UART_IER_THREINT);

      DataStream[0]=(echantillon & 0x0F00)>>8; 

      DataStream[1]=(echantillon & 0x00FF);

      *(uint8_t*) LPC_FIO0SET2+=0x40; //Allumage LED

 

       send_data();

        //Compteur=0;

 

      *(uint8_t*) LPC_FIO0CLR2 += 0x40; //Clear LED

 

       *(uint32_t*) LPC_ISER0=interupt_enabled0;

       *(uint32_t*) LPC_ISER1=interupt_enabled1;

}

Even when i try to decrease the send intervalle (i.e. i go to the RIT_Timer faster), the data is sent every 1ms and this time seems to be incompressible.

0 Kudos

974 Views
jeremyzhou
NXP Employee
NXP Employee

Hi vivien pac,

Thanks for your reply.

In my opinion, the USB bus transfer and receive operation is in the charge of USB host.

As the USB slave, it shouldn't take the initiative in transfer or receive USB frame.

So I was wondering if you can share a compile-able demo, as I'd like to run it with MCB1700 board.

TIC

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

974 Views
jeremyzhou
NXP Employee
NXP Employee

Hi vivien pac,

Thank you for your interest in NXP Semiconductor products and 
the opportunity to serve you.
According to your statement, you want to send data to Endpoint whose type is Bulk at fixed period, it it correct?
If yes, I'd like to you can share the more information about this implementation, such as program flow, demo code, testing steps, etc.
Have a great day,

TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos