Well I must say that using IntervalTimer and 'sleep()' won't work as expected, i guess I should said this earlier. When going to 'sleep()' the bus is 2MHz so some IntervalTimer register values will be wrong. This can fixed by resetting the register values before sleeping to get the correct timing. I'll put an example up later today to show you a way to do that.
The datasheet says LPO could be off by as much as 10% (100,000 ppm). I've measured LPO frequency error on 10 or so teensy's, and worst I saw was 18000 ppm (18 ms on 1khz)LPO is 1kHz, so maybe +-1 msec? That might be ok.
The datasheet says LPO could be off by as much as 10% (100,000 ppm). I've measured LPO frequency error on 10 or so teensy's, and worst I saw was 18000 ppm (18 ms on 1khz)
I don't think there is any hardware calibration to correct the LPO frequency. It varies from chip to chip, so you might be able to do some software calibration. With my testing, using an ISR gets far worse frequency error, because I had to disable LPTMR, clear TCF flag and restart timer, which loses ticks?? my LPO measurements were from a free-running LPTMR/LPO. The anecdotal frequency data is atOh, that's a lot of error. Is there a feasible way to compensate for the error? Will the error always be the same, or is it variable?
Are you just changing the cpu speed in the Arduino IDE? Did you try to use the ADC library in the loop function at those speeds to see if there is still the noise?If you get around to this, I'd be interested.
With T3.2,
I tried 2MHz, but my sketch failed, maybe the interrupts couldn't finish in time.
I tried 4MHz, it works but the sensor is a little noisy.
8MHz and 16Mhz aren't allowed with the ADC library.
I tried 24MHz, it works and the noise is gone.
I noticed that for T-LC, there is no option below 24MHz.
May not hurt to ask Pedvide why he does not allow those speeds, I did a quick search and found nothing.With T3.2,
8MHz and 16Mhz aren't allowed with the ADC library.
.
adc = new ADC();
pinMode(EXT_SPO2_PIN, INPUT);
pinMode(EXT_PPG_PIN, INPUT);
adc->setAveraging(1); // set number of averages
adc->setResolution(8); // set bits of resolution
// it can be ADC_VERY_LOW_SPEED, ADC_LOW_SPEED, ADC_MED_SPEED, ADC_HIGH_SPEED_16BITS, ADC_HIGH_SPEED or ADC_VERY_HIGH_SPEED
// see the documentation for more information
adc->setConversionSpeed(ADC_VERY_HIGH_SPEED); // change the conversion speed
// it can be ADC_VERY_LOW_SPEED, ADC_LOW_SPEED, ADC_MED_SPEED, ADC_HIGH_SPEED or ADC_VERY_HIGH_SPEED
adc->setSamplingSpeed(ADC_VERY_HIGH_SPEED); // change the sampling speed
What kind of power usage can I expect from teensy at various MHz? I tried searching but couldn't find the info although I think I've seen it before.
I found those posts but there's no info on below 20MHz, or either it was about special power down modes.
I'm using onehorse's charging circuit which I imagine bypasses the voltage regulator. Is it comparable to the murata product?
It uses this:
http://www.st.com/en/power-management/stbc08.html
Yeah sorry I didn't provide much info:
This is the one I'm referring to:
https://www.tindie.com/products/onehorse/stbc08-high-current-lipo-battery-charger/
View attachment 9946
A lipo battery is the power source for the teensy. But I'm not sure if the power is delivered to the 3.3V input or the normal USB power source. That's probably important considering what you said.
edit: It doesn't look like I could power the murata chip with a lipo as it requires 7V minimum.