I am trying to implement an efficient DAQ using Arduino, with high data transfer speeds. I found out that the Arduino has a maximum baud rate of 115200. Is there any other way to get much higher speed?? Can i do away with this kind of serial communication and use some other modes of communication ??
SPI or I2C.
Depends how far it has to go.
You can get serial to go nearly 500kbaud.
SPI will do 8 MHz transfer with ICs.
How fast is your DAC?
CrossRoads:
SPI will do 8 MHz transfer with ICs.
How fast is your DAC?
I am using the on board ADC of the ARDUINO MEGA 2560. I found out that the sampling rate of the ADC is 9600 samples/s when used at 10 bit resolution (for a prescale factor of 128). But when i serially send the data to matlab, the serial communication has become a bottleneck because at max baud rate (i.e. 115200 baud), i get a final sampling rate of 1960 samples/s. How to improve this ?
sbright33:
You can get serial to go nearly 500kbaud.
How can i get this 500kbaud ?
You can up the serial rate to
Serial.begin(230400);
as standard usage.
Faster than that, you might have to start playing with software stuff.
See Section 20 and Table 20-7 in the ATmega328 datasheet
Thanks a lot cross roads !! 230400 baud is working fine. I am trying out other baud rates also.
Is there a way that i can send data to my computer with SPI instead of using the normal serial communication. So that i can get very high speed.
Yes, get an external UART with an SPI interface and run it at a faster baud rate.
Rob
Such as this one. Can clock data into it with SPI at 4 MHz rate.
The SC16IS752/SC16IS762 is an I2C-bus/SPI bus interface to a dual-channel high
performance UART offering data rates up to 5 Mbit/s, low operating and sleeping current;
it also provides the application with 8 additional programmable I/O pins. The device
comes in very small HVQFN32 and TSSOP28 packages, which makes it ideally suitable
for hand-held, battery-operated applications. This chip enables seamless protocol
conversion from I2C-bus/SPI to RS-232/RS-485 and is fully bidirectional.
The SC16IS762 differs from the SC16IS752 in that it supports SPI clock speeds up to
15 Mbit/s instead of the 4 Mbit/s supported by the SC16IS752, and in that it supports IrDA
SIR up to 1.152 Mbit/s. In all other aspects, the SC16IS762 is functionally and electrically
the same as the SC16IS752.
The SC16IS752/SC16IS762’s internal register set is backward compatible with the widely
used and widely popular 16C450. This allows the software to be easily written or ported
from another platform.
The SC16IS752/SC16IS762 also provides additional advanced features such as auto
hardware and software flow control, automatic RS-485 support and software reset. This
allows the software to reset the UART at any moment, independent of the hardware reset
signal."
Need 3.3V & signal buffering on control signals to it.
SC16IS752_SC16IS762.pdf (477 KB)
Table 8 gives some ideas of possible frequencies.
For example, 11.0592 MHZ crystal and divisor of 20 will yield:
552,960
USB2 can do 2 Mbits/sec? Have to play and see what works reliebly with your PC application.
If you are trying to send the data to a PC, why not use a Teensy or Arduino Leonardo and send the data directly over USB instead of via the serial interface?