Pinguino Forum
hid - Printable Version

+- Pinguino Forum (http://forum.pinguino.cc)
+-- Forum: General (http://forum.pinguino.cc/forumdisplay.php?fid=5)
+--- Forum: Frequently-Asked Questions (http://forum.pinguino.cc/forumdisplay.php?fid=9)
+--- Thread: hid (/showthread.php?tid=3201)



hid - keghn - 18-12-2011

hello.

I want to do data acquisition and control,
using laptop and usb.
On a good day, around how many bytes per second
can my laptop read from pinguino digital i/o, or gpio?
How many byte per second can it write?
What is a good board to use.

I am using ubuntu 11.10.
Are there any gcc or g++ libraries?
Are there any exampe code like:

//reading pinguino digital i/o

//compile with gcc pinguino_read.c -opinguino_read -lpinguino

int main(void)
{

int indata;

pinguino_read_dio( indata);

printf( "dio is %x\n",indata);
return 0;

}

I am not interested in a/d, b/a I2C, SPI, or UART.
From my laptop running my c/c++ program I
want to send and read digital bytes or bigger
from a 16 bit registers on the pinguino gpio.
Writing power level to a 12 bit register, that
is not on the pinguino board, but one inch
away.
And then reading position value from a 15 bit register.

Thank for any help.

keghn@netscape.net


RE: hid - pingotg - 18-12-2011

How long is a piece of string? LOL

You can read a LOT of data per second over USB as far as a half-way decent laptop is concerned so probably you're limited to how fast you can supply it or can process it.

Summary: probably more data than you need or want Smile

John


RE: hid - Alfred - 18-12-2011

You can use a serial line over USB (CDC), that will probably be the easiest way to do this. I'd suggest the PIC32 Pinguinos, they have a built-in USB controller, 24 pins for digital operation, and you can write your code directly in C (using GCC and crosscompiling for -t mipsel). Look around the forums, the Wiki, there is also plenty of code available elsewhere for Arduinos (all the digital and analog read is the same).

PS I had some analog reading code here, it is easy to use it for digital too: http://forum.pinguino.cc/showthread.php?tid=3125


RE: hid - tochinet - 20-12-2011

The better question is "how often do you NEED to record" ? (every x ms), and "how many channels".

When using a serial interface, that will probably be the limiting factor. Even with a small 8-bit PIC you should be able to start.
Guarantee you won't be able to read the screen. With an Arduino Mega (8-bit), I made a 16channel scope with 57600 serial debug, writing 16 analog values (10-bit) on an LCD 320x240 + float conversion to Volts, and it makes more than 1 cycle/second without any optimisation.