Hi Gary,
Thanks for your work, which unveils some clues in my application.
In my application, raw data acquiring from DAQ system (24 bits * 64 channels (at least) each block with 2k sample rate) is going to transmit into mbed through SPI interface and pass through USB interface to an Android-powered device through Android Accessory Protocol.
Since the data is not in a SD card but from a FPGA, SSP interface (SPI in TI mode) seems to have higher performance for continuous bits stream. My question is that:
1. How much data rate in your test? And what is the peripheral of mbed in your test.
2. Do you use GPDMA in your test in order to get a high speed? (In LPC1768, there are eight GPDMA channels, and it's possible to configure one channel worked in peripheral to memory mode. More detail information about that is available in Table 564 (Page 605 of 840).)
(P.S. In my app, Mbed is going to act as a master and DAQ system end with FPGA is going to be a slave.)
3. Do you have any suggestion of the following condition?
When I tested the AndordAccessory example from cookbook, I found that this program does not implement real USB host but make a trick with a method that using serial-USB port and all data transceiver under serial protocol instead of USB protocol for simplicity.
I suppose that USB host protocol is still under developing in mbed, and no reliable and stable library is available for directly using by now. Furthermore, UART3, one of the LPC1768 UARTS, is connected to USB port in mbed board and a library for mapping serial data between USB data is available in mbed library. Then a trick is made for simplicity.
In this way, if building a stable library in mbed part, there is the possibility that reach a higher speed rate like 777.216 Kbytes per second (24 bits * 128 channels * 2024 sample rate) or just a few modification in USBSerial also could achieve this goal.
In a word, if I want to implement a data link from SSP bus to USB with at lease 777.216 Kbytes per second, what should I do in your opinion?
This reply is a little late, but you can get a continuous bit stream by using TI mode on the SSP controller. The simplest way on mbed is to declare it and set it up as if it were SPI, but jam it into TI mode before you transmit.
SPI device (p11, p12, p13);
.
.
.
// Configure TX data port
device.format(8, 0); // SPI 8 bit mode 0
device.frequency(2000000); // SPI bit rate
LPC_SSP0->CR0 |= 0x0010; // Switch to TI mode
.
.
.
while (i < len) {
while ((LPC_SSP0->SR & 0x0002) == 0x0002) {
LPC_SSP0->DR = xmt_msg[i];
i++;
}
}
while ((LPC_SSP0->SR & 0x0001) == 0x0000);
for (i=0; i<20; i++); // Allow extra time to clock out the last few bits
Regards,
- Gary
Hi,
I'm trying to generate a very high speed constant bitstream on a MOSI pin of one of the SSP interfaces and I noticed that after each byte (or word) there is a small delay of about one SCLK tick. Is this normal or am I doing something wrong? This even happens when I use GPDMA to move the data to the peripheral.
Thanks,
--Ivo