LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Editing firmware to reduce clock speed

So I have decided to use the Arduino on my bachelor's project for measuring power produced by an implantable glucose fuel cell. I chose the Arduino because of the convenient LabVIEW interface software.

One of my main problems have been getting accurate enough readings. I preferably need to measure changes as low as 10 microvolts. I have been experimenting with the analog reference voltage (AREF) and got this down to 0.57 Volts before it stopped measuring. This was with the LIFA firmware. When I made a test program witht the Arduino sketch program, I managed to get the AREF down to 0.22 Volts by reducing the clock speed. I suspect the reason why the AREF is affected by the clock speed is due to the Arduino using successive approximation in the DAC.

I tried editing the LIFA firmware to do the same as my sketch program, but without success. I think my added commands are being overwritten somewhere, but I don't know where. What I did was entering this into the void setup() section:

void setup()

  // Initialize Serial Port With selcted baudrate

      Serial.begin(38400*2);  

      // Clock prescale

      clock_prescale_set(clock_div_64);

      // Clock prescaler, "111" = div128, "000" = div2

      ADCSRA |= (1<<ADPS2)|(1<<ADPS1)|(1<<ADPS0);

}

Does anyone know where this is overwritten or have an alternative solution to my problem?

(I could of course try with a higher resolution DAC, but then I would have to edit the firmware again)

0 Kudos
Message 1 of 2
(3,641 Views)

I would suggest using a higher resoltion DAC.  They are relativly cheap and would be a much better solution at the end of the day (although some additional work upfront).

-Sam K

LIFA Developer

0 Kudos
Message 2 of 2
(3,159 Views)