Hi,
I have been trying to implement USB data transfer and haven't been so successful. Could you tell me what to do and how to transfer data?
I am running the HSADC at 80MSPS (I am not sure how to check this), further, I am transferring the data from the HSADC to the FIFO using the DMA. I want to transfer the data in the FIFO using bulk transfer USB instead of UART that I am using now.
I do not know how to connect the microcontrollers for data transfer, neither have I worked on this before.
It would be really helpful if you could assist me a bit on this.
Thanks!
Regards,
Vish
Hi Vish,
I would recommend to check and download LPCOpen software for LPC43xx product from here.
The LPCOpen software provides the ADC and USB example demo.
I think customer could refer [usbd_rom_bwtest] about USB module bandwidth test.
[usbd_rom_cdc_vcom] example shows how to us USBD ROM stack to creates a virtual comm port.
Wish it helps.
Have a great day,
Mike
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hi!
Thanks for the reply. I have used the example to find that the code does compile but I am not able to get the connection done. If you could refer the example:
#include "board.h"
#include <stdio.h>
#include <string.h>
#include "libusbdev.h"
/* The size of the packet buffer. */
#define PACKET_BUFFER_SIZE 4096
/* Application defined LUSB interrupt status */
#define LUSB_DATA_PENDING _BIT(0)
/* Packet buffer for processing */
static uint8_t g_rxBuff[PACKET_BUFFER_SIZE];
int main(void)
{
/* Initialize board and chip */
SystemCoreClockUpdate();
Board_Init();
/* Init USB subsystem and LibUSBDevice */
libusbdev_init(USB_STACK_MEM_BASE, USB_STACK_MEM_SIZE);
while (1) {
/* wait until host is connected */
while (libusbdev_Connected() == 0) {
/* Sleep until next IRQ happens */ -----------> The code keeps staying here. The usb never gets connected.
__WFI();
}
while (libusbdev_Connected()) {
if (libusbdev_QueueReadDone() != -1) {
/* Dummy process read data ......*/
/* requeue read request */
libusbdev_QueueReadReq(g_rxBuff, PACKET_BUFFER_SIZE);
}
if (libusbdev_QueueSendDone() == 0) {
/* Queue send request */
libusbdev_QueueSendReq(g_rxBuff, PACKET_BUFFER_SIZE);
}
}
}
}
If you could give a step by step explanation of what to do, it would be very helpful for a lot of people like me.
Hi,
Could you guide me which LPCOpen software package you are using?
And which USB example you are referring? Thanks.
best regards,
Mike
I am using the usbd_rom_libusb example, the code I pasted was for the lpc4370 device, from the libusbdev_main.c program.
-Vish
Hi Vish,
Thank you for the info.
I checked you submitted a new thread about this issue.
Please check our support from here. Thanks.
best regards,
Mike