Forum: µC & Digital Electronics Processing data from usb stick / Realtime processing

von Johannes K. (spaceman_spiff)

Rate this post
0 useful
not useful

I want to control a milling machine by computer under Windows XP SP2 in 
real time (For other reasons I cannot use Dos or Unix).
The amount of datapoint can be very large (up to GB).
So my idea was to store the data on a large USB Stick (not in real time) 
and then read and process the data it with a controller in order to 
generate the commands for the stepping motors (in realtime).

Is there any way I can do this? (PIC controllers prefered)

What hardware (Usb Stick + Interface to controller) can I use?

How can I realize a Communtication directly to the Controller via USB? 
What about PC Drivers?

do you have any examples that I can try out myself?

thank you,

Spaceman Spiff

von jrmymllr j. (jrmymllr)

Rate this post
0 useful
not useful
Many microcontrollers have USB interfaces, so it could easily read data 
off the USB drive.  I haven't used USB yet, but I often use PIC and TI 
ARM Cortex-M3 controllers and they both have it available.

von mizch (Guest)

Rate this post
0 useful
not useful
Simply having an USB interface is not sufficient.  Most Controllers 
equipped with an USB capability are slaves.  To read from USB mass 
storage, you need host (or OTG) capabilities which require a lot more 
than a simple slave device offers.

von mizch (Guest)

Rate this post
0 useful
not useful
Depending on your speed requirements, I'd try an SD Card.  SD card 
libraries are available for most µcontrollers and are much simpler to 
interface than an USB thumb drive.

von usb (Guest)

Rate this post
0 useful
not useful
You should have a look at STI100. Its an USB Interface, which can easily 
be used for reading / writing data on a usb Stick.

von Johannes K. (spaceman_spiff)

Rate this post
0 useful
not useful
Thank you for your replies!

do you mean this

Beitrag "USB-Stick-Interface STI 100"


the sti100 looks very promising but I need some time to try to think 
about it.

I like the SD card Idea as well. Do you have an example?

I do not know if an USB interface to the controller would handle the 
realtime problem. - a mass storage device would be better.

any other ideas, examples schematics, codes?

von Hartmut Semken (Guest)

Rate this post
0 useful
not useful
Storage is one option.
I think you need to calculate your data rate first: how much data do you 
need to read per second to control the machine?
If we are talking one GB per day its much different from one GB per 
minute, right?

I would probably go for an SD card as well, provided that the interface 
can handle it.
The SD interface comes in two flavors: simple, serial SPI and a much 
faster 4-bit parallel variant. The typical library only implements the 
serial variant.

Your actual problem I would probably address in a different manner:
- use one controller per axis
- use an SPI to feed data to the axis controllers from a machine 
- us a network interface to feed the data from the PC to the machine 

Depending on speed requirements the controllers could be:

machine controller: pollin AVR net-IO
or rather the Webmodule by Ulrich Radig

good starting points if speed requirements are not too high.

For higher data rates and larger memory buffers, I would consider a 
"larger" controller like

This can integrate the axis controllers as software (output to port pins 
directly) or use separate controllers to create loop-control and 
maintain precise timing.

The speed that the windows machine can transmit over Ethernet should be 
fast enough on /average/, even though Windows can not provide 
real-time behavior.
The machine controller can implement the buffer required to even-out the 
average speed to a constant speed.

Again: depending on your data rate, a small buffer (such as the Atmega32 
or 644 can provide with its internal RAM) may be sufficient, if a larger 
buffer is required for evening out the Windows processing jitter, the 
ARM controller with megabytes of space will be easier to fulfil the 

hope, this helps



Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]

Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.