主题中讨论的其他器件:ADS127L01EVM、 ADS127L01
工具/软件:Code Composer Studio
大家好:
我 开发的 DAQ 系统使用的是 ADS127L01,采样速度可达512K,这意味着可以输出512k *8*3=12.228Mbps 数据。(一个 ADC 数据使用3字节)。 ADS127L01EVM 使用 TM4C1294NCPD+USB 高速 外部 PHY USB3320C-EZK、我使用 libusb API 在 Linux 中编写应用程序代码、测试批量传输、但速度仅为431*8*3kbps=10.344Mbps、ADS127L01需要
DRDY 引脚。 我不知道如何使用 DMA 通过 SPI 端口进行采样,我不使用 DMA,当 USB USB_EVENT_RX_Available 触发时,我对 ADC 代码进行采样 当主机应用程序发送赞扬时,我需要更高 的传输速度? 如何操作? 请帮我,谢谢。
以下代码:
案例 USB_EVENT_RX_Available:
{
sendDataToHost(); //将样本发送到主机应用程序
中断;
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
无效
sendDataToHost(空)
{
char *p=NULL;
p=strstr (g_pui8USBRxBuffer、"REGMAP");
if (p){
readRegs (g_pui8USBTxBuffer);//读取 REGMAP
USBBufferDataWritten (&g_sTxBuffer、(8));
}
p=strstr (g_pui8USBRxBuffer、"Collect");
if (p){
while (readblock (g_pui8USBTxBuffer、3、adc_data_NUM));//读取示例代码
USBBufferDataWritten (&g_sTxBuffer、ADC_DATA_NUM*3);
}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
内联 uint8_t readblock (uint8_t * RxData、uint8_t blocksize、uint32_t NUM){
uint32_t index=0、rx_index=0;
sendCommand (reset_opcode_mask);
sendCommand (start_opcode_mask);
sendCommand (RDATA_OCODE_MASK);
// UARTprintf ("blocksize=%d\r\n"、blocksize);
for (index=0;<NUM;index++){
while (nDRDY_REG);
// UARTprintf ("IDEX=%d\r\n", 索引);
RX_index=3*索引;
// UARTprintf ("rx_index=%d\r\n"、 rx_index);
switch (blocksize){
case single_adc:{
HWREG (SPI_base + SSI_O_DR)= 0x00;
while (!(HWREG (SPI_base + SSI_O_SR)& SSI_SR_TNF));
HWREG (SPI_base + SSI_O_DR)= 0x00;
while (!(HWREG (SPI_base + SSI_O_SR)& SSI_SR_TNF));
HWREG (SPI_base + SSI_O_DR)= 0x00;
while (!(HWREG (SPI_base + SSI_O_SR)& SSI_SR_TNF));
/*等待数据出现*/
while (!(HWREG (SPI_base + SSI_O_SR)& SSI_SR_RNE));
/*获取该数据*/
RxData[0+Rx_index]= HWREG (SPI_BASE_SSI_O_DR);
// UARTprintf ("%2X\r\n"、 RxData[0+Rx_index]);
while (!(HWREG (SPI_base + SSI_O_SR)& SSI_SR_RNE));
RxData[1+Rx_index]= HWREG (SPI_BASE_SSI_O_DR);
// UARTprintf ("%2X\r\n"、 RxData[1+Rx_index]);
while (!(HWREG (SPI_base + SSI_O_SR)& SSI_SR_RNE));
RxData[2+Rx_index]= HWREG (SPI_BASE_SSI_O_DR);
// UARTprintf ("%2X\r\n"、 RxData[2+Rx_index]);
// UARTprintf ("--\n" );
中断;
}