[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Arduino to octave
Giorgio De Nunzio
Re: Arduino to octave
Fri, 14 Oct 2016 18:23:14 +0200
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0
Il 10/10/2016 13:00, Andreas Weber ha scritto:
Am 09.10.2016 um 17:57 schrieb address@hidden:
I've recently been working on data acquisition from an arduino by the
serial channel and the Instrument Control package.
It was not so easy: it seemed that some data were missed from time to
time, but I've never understood why. I now perform some error checking and
sometimes I lower the baud rate.
I've used serial communication between AVRs (for example ATMega32) and
GNU Octave with baudrates of 500 kbaud without any problems. Do you use
interrupt driven serial out on the AVR side? Is the output buffer big
enough? For reading the data in GNU Octave I suggest reading bigger
chunks at once (perhaps 500 Bytes) and then split it, put the rest back
in the input buffer and draw then.
Help-octave mailing list
I am using an arduino and its serial library from C, so I don't know
exactly how data sending is organized at low level.
Anyway I'll soon begin experimenting again (taking your suggestions into
consideration), so as to understand where my mistake was. I'll ask on
the List, if necessary.
I find interesting the idea of type casting to use binary data: till now
I have always sent text messages, which is not necessarily practical.
Just one note: I realized that the buffer is not emptied when read
(arduino sends, octave reads: if I stop octave script and start it
again, data are reread).
Is this normal? Is it possible to forcefully empty the buffer (from the
pc side) so that only new readings are read from that point on? It was
just a rapid test I did, so perhaps I am missing something.
Dr. Giorgio De Nunzio PhD
Dipart. di Matematica e Fisica "Ennio De Giorgi", Univ. del Salento
INFN Sezione di Lecce
DReAM (Laboratorio Diffuso di Ricerca Interdisciplinare Applicata alla Medicina)
ADAM (Advanced Data Analysis in Medicine) srl
tel +39 0832 297084-297051
fax +39 0832 297100
mobile +39 320 3829845
Questa e-mail è stata controllata per individuare virus con Avast antivirus.