Regarding PSoC5LP USBUART.

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
YuMa_1534086
Level 7
Level 7
Distributor - Macnica (Japan)
500 replies posted 250 sign-ins 10 likes received

1. USBUARTの受信バッファは

USBUART receive buffer is,

(a) 何Byte有るでしょうか。

   How many bytes is it?

(b) そのバッファー数は、マクロか何かで知ることか出来るでしょか。

    Is it possible to know the number of buffers with a macro or something?

(c) そのバッファー数を変える事可能でしょうか。

   Is it possible to change the number of buffers?

2. USBUARTは受信で割り込みを発生できるでしょうか。

  Can USBUART generate an interrupt on receive?

Best Regards.

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
Ekta_N
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hello YuMa_1534086

1. a) and b) The USBUART is nothing but a USB component behaving as a UART. The USB endpoints are configured as BULK Endpoints with a maximum size of 64 bytes. The Host will be sending the data in the Bulk IN endpoint and the PSoC device can send data to the Host from Bulk Out Endpoint. Can you please confirm if this is what you were asking by number of bytes of USBUART receive buffer.

1 c) Can you please clarify by number of buffers do you mean the USB endpoints or do you mean a software buffer?

2. Yes it is possible to generate interrupt on receive. Each endpoint of the USB has a associated ISR in the USBUART.episr file in the generated code. These interrupt sources trigger whenever the host completes communication over the corresponding data endpoint. They are available only when an endpoint is utilized by the device.

Please refer to the attached document for more details handling the interrupts associated with the USBUART (USBFS) component.

Best Regards

Ekta

View solution in original post

3 Replies
lock attach
Attachments are accessible only for community members.
Ekta_N
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hello YuMa_1534086

1. a) and b) The USBUART is nothing but a USB component behaving as a UART. The USB endpoints are configured as BULK Endpoints with a maximum size of 64 bytes. The Host will be sending the data in the Bulk IN endpoint and the PSoC device can send data to the Host from Bulk Out Endpoint. Can you please confirm if this is what you were asking by number of bytes of USBUART receive buffer.

1 c) Can you please clarify by number of buffers do you mean the USB endpoints or do you mean a software buffer?

2. Yes it is possible to generate interrupt on receive. Each endpoint of the USB has a associated ISR in the USBUART.episr file in the generated code. These interrupt sources trigger whenever the host completes communication over the corresponding data endpoint. They are available only when an endpoint is utilized by the device.

Please refer to the attached document for more details handling the interrupts associated with the USBUART (USBFS) component.

Best Regards

Ekta

YuMa_1534086
Level 7
Level 7
Distributor - Macnica (Japan)
500 replies posted 250 sign-ins 10 likes received

Ekta-san.

Thank you for your response.

1 c) Can you please clarify by number of buffers do you mean the USB endpoints or do you mean a software buffer?

>>Customer’s question is about a software buffer.

   They would like to know if the buffer size of USBUART software buffer can be changed.

Best Regards.

Yutaka Matsubara

0 Likes
Ekta_N
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hello Yutaka-San,

I guess by software buffer the customer means the user defined buffer in the application which is used to store the incoming (or outgoing) data to (or from) USB Endpoint. Yes, it is possible to change the the size of the buffer.

As you can see in the image below:

pastedImage_0.png

In the USBUART configuration box > under the Endpoint descriptor , the Max Packet Size denotes the size of the USBUART receive or transmit buffer and can be set by the user. It is limited to 64 bytes in case of BULK endpoint as mentioned in the previous comment.

The data received in the OUT (receive) Endpoint by the USB device can then be transmitted to the a user defined software buffer using the USBUART_GetAll(uint8* pData)  This function gets all bytes of received data from the input buffer and places them into a specified data array

Here, pData: Pointer to the data array where data will be placed

The size of this software buffer (data array) is user defined.

Please let me know if you have further queries related to this issue.

Best Regards

Ekta

0 Likes