Skip to main content
Topic: Slow 8 channel USB analog data logger (Read 5543 times) previous topic - next topic

Slow 8 channel USB analog data logger

This seems like a easy and cheap project to do, and even at 10KS/s sampling rates it would find many uses, especially for people starting in electronics design.
Purpose:
To allow a user to simultaneously watch and compare up to 8 analog signals in real time on the computer.
Make it as cheap as possible. 
Build.
A singe MCU is all that is needed to both read the channels and pipe the data through the USB.
I think pic 24F have a sampling rates of 500KS/s, the PIC32 1MSps.

Minimum amount of external components, probably only a few resistors for the voltage divider and a few switches or mosfats to change the range. 20V 2V would probably be sufficient, although if needed a few channels could have a analog front end to read down to 200mVs.
A external reference would be used to allow greater precision

Have the USB connector broken out to pins to allow internal motherboard connection.

Question, how fast could a PIC24F and PIC32F read 8 channels and send the data to the computer, what kind of sample rates could I expect, I am also interested if the sample rates could be increased by lowering the amount of inputs.
best regards FIlip.

Re: Slow 8 channel USB analog data logger

Reply #1
i have been drafting something that includes the capabilities you have asked for

 

Re: Slow 8 channel USB analog data logger

Reply #2
sweet, I've been reading some data sheets and basically the limitation is the USB bandwidth that is possible by a MCU only.
Has anyone tested Microchips stack for continuous stream of sequential data.
The MCU should read 8 channels then send 8x16bits over the usb, and then repeat the process.
I get that this is not the best way to utilize the full potential of the USB protocol, but I don't think the MCU has the memory required to fill a full frame and then sent it in one go. I could be wrong since I am new to USB design.
best regards FIlip.

Re: Slow 8 channel USB analog data logger

Reply #3
i am actualy using an 8051 running at 100MHz,

the ft232 can be pushed to 12Mbaud, sufficant for 8 ch at 50K samples/s


Re: Slow 8 channel USB analog data logger

Reply #5
[quote author="arhi"]if you go with 245 mode you can get high bw using parallel communication .. 2232H will get you bw way faster then any pic adc can handle :D[/quote]

i have a dev board built up using one od DP qfp protoboards.

i'm using a serial to the ft232 right now, but have enough pins left, that i can use a parallel connection to a ft2232, and still have the serial port available for debugging.

Re: Slow 8 channel USB analog data logger

Reply #6
I was talking about using the on board USB of the PIC, not the external FTDI versions
best regards FIlip.

Re: Slow 8 channel USB analog data logger

Reply #7
[quote author="arakis"]I was talking about using the on board USB of the PIC, not the external FTDI versions[/quote]

i'm not sure, about utilization with on board USB.

the interrupt and support routines for parallel on the 8051 are fairly small.

50K/s x 8ch @ 12bits = 800KBytes/s or 6.4Mbits/s just data. plus other functions planned. 12Mbit should be fast enough.

i have been thinking about a dual channel usb chip, the second channel can be used for programming and debug.

Re: Slow 8 channel USB analog data logger

Reply #8
If using a FTDI chip the bottle neck is how fast it can send the data via USB and not how fast the UART can work at. These are only FULL SPEED devices and not HIGH SPEED. I seriously doubt that you are going to get any better than 2Mb/s device to host. I don't think that the FTDI chips are even that fast.

Likewise with a native USB PIC again they are only FULL SPEED devices and a good USB stack aught to give compatible results or slightly better than a FTDI chip.

You certainly will get far, far greater bandwidth with a PIC24 than a PIC18. PIC32 may offer greatly diminished returns over the PIC24.

Getting a high enough bandwidth from FULL SPEED USB for say even 25K/s x 8 ch @ 12bits is not trivial and you would have to be at least looking at a PIC24, forget a PIC18.

Re: Slow 8 channel USB analog data logger

Reply #9
[quote author="JTR"]If using a FTDI chip the bottle neck is how fast it can send the data via USB and not how fast the UART can work at. These are only FULL SPEED devices and not HIGH SPEED. I seriously doubt that you are going to get any better than 2Mb/s device to host. I don't think that the FTDI chips are even that fast.[/quote]

It really depends on the ftdi chip. If you go with 2232H for e.g. it can transfer up to 60 megabytes / second (60MHz 8 bits in parallel !!)

Re: Slow 8 channel USB analog data logger

Reply #10
[quote author="arhi"][quote author="JTR"]If using a FTDI chip the bottle neck is how fast it can send the data via USB and not how fast the UART can work at. These are only FULL SPEED devices and not HIGH SPEED. I seriously doubt that you are going to get any better than 2Mb/s device to host. I don't think that the FTDI chips are even that fast.[/quote]

It really depends on the ftdi chip. If you go with 2232H for e.g. it can transfer up to 60 megabytes / second (60MHz 8 bits in parallel !!)[/quote]

if you subtract the over head you will less.

i am also looking at the new atmel sam4 or the stm32f4xx ,but it depends on their analog capabilities.

Re: Slow 8 channel USB analog data logger

Reply #11
[quote author="arhi"][quote author="JTR"]If using a FTDI chip the bottle neck is how fast it can send the data via USB and not how fast the UART can work at. These are only FULL SPEED devices and not HIGH SPEED. I seriously doubt that you are going to get any better than 2Mb/s device to host. I don't think that the FTDI chips are even that fast.[/quote]

It really depends on the ftdi chip. If you go with 2232H for e.g. it can transfer up to 60 megabytes / second (60MHz 8 bits in parallel !!)[/quote]

Yes, they do have some HIGH SPEED chips suffixed with a H. I thought as much but when I went to double check it seems that I ended up a the 2232D page. Sorry about that.

I was also going to suggest that cypress chip CY4013 or something like that. It is the standard one used in the USBee and the like logic analyzers.

Re: Slow 8 channel USB analog data logger

Reply #12
@JTR, I'm not a big fan of cypress :( but I have to admit they do have some interesting chips.... that are used in almost all "big time" usb app's.

@sqkybeaver, not really, You can transfer 8bit data at 60MHz if your host computer can take it. The major issue is with buffers on the ftdi and the host computer, I did some tests sending 100megabytes at 60MHz and I ignored the "busy" line, I only had few bytes lost!! It is just important that your host has enough time to fetch all data from usb so that buffers don't fill up.

Re: Slow 8 channel USB analog data logger

Reply #13
[quote author="arhi"]@sqkybeaver, not really, You can transfer 8bit data at 60MHz if your host computer can take it. The major issue is with buffers on the ftdi and the host computer, I did some tests sending 100megabytes at 60MHz and I ignored the "busy" line, I only had few bytes lost!! It is just important that your host has enough time to fetch all data from usb so that buffers don't fill up.[/quote]

there must not be as much overhead as i was originality thinking.

Re: Slow 8 channel USB analog data logger

Reply #14
different transfer types have different overhead, ft2232H has that ft245 mode (or something similar not sure attm) that accepts the parallel data at 60MHz speed .. it works very good. If you have 2232H you can try :)