I've been working on a project that reads data from 4 analog inputs, and pairs this with location and time data from a gps, and stores this to an SD card, while also using the gps speed info to control a motor.
Despite the relatively powerful processor on the DUE, the program only loops at about 2Hz.
I need a bare minimum of 5Hz, and ideally 10 or 20.
I read that the prescaler on the DUE is 512, presumably to save power?
I'd like to significantly reduce this, but I don't know how.
Has anyone experimented with changing the prescaler? I know it has been done for the ATmega based boards.
Other suggestions for improving the loop speed would also be greatly appreciated!
So far I have set the gps baud rate to 115200, and gps data is stored in variables so multiple queries per loop don't occur.
Yes, reading 4 analogs, requesting GPS data and writing data to SD card with a timestamp and controlling a motor based on GPS data hardly sounds like it would raise a sweat for the DUE, even a lowly AVR should handle this without a problem.
Maybe you have a few delay(..) hiding in your code that need to be removed.
Maybe you are doing unnecessary looping.
Maybe you are blocking your code while waiting for response data from some device such as the GPS.
Like MarkT infers, maybe your code could be written better, but are not able tell as we can't see it.