Show Posts
Pages: 1 2 [3] 4 5 ... 289
31  Community / Bar Sport / Re: Winter vs Summer on: August 19, 2014, 06:45:17 am
Saw a news item saying that they may get snow in the mountains of Scotland. This global warming thing is really getting out of hand, eh.
32  Using Arduino / Microcontrollers / Re: "Divide Clock by 8" fuse in order to use 16MHz RC oscillator for low voltage? on: August 18, 2014, 04:57:39 pm

I agree.  After rereading it my post is confusing.  I meant have the CKDIV8 fuse bit set and adjust the divisor in setup.  Initialization would be at 2 MHz.  Everything else would be at 8 MHz.

What can I say, I can't help picking nits.  Although a person might get away with it the other way around, I can't recommend it.
33  Using Arduino / Microcontrollers / Re: "Divide Clock by 8" fuse in order to use 16MHz RC oscillator for low voltage? on: August 18, 2014, 04:27:22 pm
The CKDIV8 fuse bit just determines the initial value of CLKPR.

Which means that @halfdome could change the divisor to two in setup resulting in the processor running at 8 MHz.  The processor would always be within specifications for 3 volts but the final speed would be more reasonable.

Well, the processor would be within spec except for the code executed before setting CLKPR  smiley-wink
34  Using Arduino / Microcontrollers / Re: "Divide Clock by 8" fuse in order to use 16MHz RC oscillator for low voltage? on: August 18, 2014, 10:26:52 am
I think the fuse bit only applies to the internal 8MHz clock.

Not so, see Reply #3 above. The CKDIV8 fuse bit just determines the initial value of CLKPR. If CKDIV8 is set, then CLKPR is set to divide by eight, else, it's set to divide by one.
35  Using Arduino / Microcontrollers / Re: "Divide Clock by 8" fuse in order to use 16MHz RC oscillator for low voltage? on: August 18, 2014, 10:16:18 am
I've wondered the same thing. So the question really is whether the oscillator is within spec e.g. at 16MHz and 3V, even though the CPU is within spec with the CKDIV8 fuse bit programmed.

PS: I think the answer is YES based on Note 3 on p29 of the datasheet:

Quote
3. If the crystal frequency exceeds the specification of the device (depends on VCC), the CKDIV8 Fuse can be programmed in order to divide the internal frequency by 8. It must be ensured that the resulting divided clock meets the frequency specification of the device.

That note is for the low-power XO and there are similar notes for the full-swing XO and for the internal RC osc.
36  Using Arduino / General Electronics / Re: How to distinguish between ‘reset’ and ‘real power loss’ ? on: August 18, 2014, 09:37:57 am
That sounds like "as designed."  Your sketch won't see EXTRF, because that's the one reason that invokes the bootloader code.
You should see PORF on power-on, though, and you know that WDRF means EXTRF, unless you've also turned on the WDT...

Thanks, that's what I figured. I am also using the WDT so I'll just go sans bootloader, no big deal really.

I see both BORF and PORF on power up, but that is consistent with the behavior without a bootloader.

Thanks very much!
37  Using Arduino / General Electronics / Re: How to distinguish between ‘reset’ and ‘real power loss’ ? on: August 18, 2014, 07:58:16 am
MCUSR normally has its contents corrupted by the bootloader.
If you get the newest version of optiboot from its source repository (https://code.google.com/p/optiboot/ ) you'll find a patch that permits optiboot to pass the original value of MCUSR on to the user application (and an example of what the application should look like to use that info: https://code.google.com/p/optiboot/issues/detail?id=66

I finally got around to compiling Optiboot 5.0 for ATmega328P and am not seeing the results I expected WRT the MCUSR value.  When pressing the reset button, I expected to see EXTRF set in MCUSR but instead I see WDRF. Any ideas?

PS: Maybe this is working as designed? See comment #2 at https://code.google.com/p/optiboot/issues/detail?id=66

Output
Code:
0 MCUSR=0x08 WDRF

Code
Code:
//copy the MCUSR value saved in r2 by Optiboot to a global variable.

#include <Streaming.h>    //http://arduiniana.org/libraries/streaming/

uint8_t mcusr __attribute__ ((section (".noinit")));
void getMCUSR(void) __attribute__((naked)) __attribute__((section(".init0")));

void getMCUSR(void)
{
    __asm__ __volatile__ ( "mov %0, r2 \n" : "=r" (mcusr) : );
}

void setup(void)
{
    Serial.begin(115200);
    Serial << endl << millis() << F(" MCUSR=0x0") << _HEX(mcusr);
    if (mcusr & _BV(WDRF))  Serial << F(" WDRF");
    if (mcusr & _BV(BORF))  Serial << F(" BORF");
    if (mcusr & _BV(EXTRF)) Serial << F(" EXTRF");
    if (mcusr & _BV(PORF))  Serial << F(" PORF");
    Serial << endl;
}

void loop(void)
{
}
38  Using Arduino / Sensors / Re: Is there a voltage regulated, level shifted I2C bus solution for AA powered unit on: August 16, 2014, 07:12:00 pm
@EKMallon, wow, quite a story! I'd say that's a good start on a book about the project. I'm curious about the total amount of data logged. It sounded like the 30-minute interval was maybe longer than optimal. What would a better interval be, and how many bytes of data are logged for each interval?
39  Using Arduino / Project Guidance / Re: USI Clock on: August 15, 2014, 07:31:32 pm
Toggling the clock is done by code, so the speed is dependent on how the code is written. I wrote an SPI library a while back (here) and estimated the clock speed to be about 1/10 of the system clock. Unrolling the loop should give a bit of improvement over that. There's also an example in the datasheet.
40  Community / Local Groups / Re: local group in Windsor, Ont or Detroit MI on: August 13, 2014, 06:29:23 pm
Hi, I'm in Shelby Township, near Utica Michigan.
Any action around here?

Howdy. I recently joined a new group in Flint, there have just been two meetings I think.  I also joined this group but have not attended a meeting yet. Duckie58 and I get together on an irregular basis.
41  Using Arduino / Project Guidance / Re: Arduino Oscillator on: August 12, 2014, 04:35:57 pm
Quote
Not usually. The oscillator is very low power, most scopes will load it  too much and either make it erratic or stop it completely.
Well I can on my 45 year old scope.

Don't make 'em like they used to eh smiley-wink

Is it important to use the right pin? XTAL2 is the oscillator output, so that might be the best one to measure?
42  Using Arduino / Project Guidance / Re: Arduino Oscillator on: August 12, 2014, 04:30:57 pm
i tried  this , but measuring 1/16  of the real signal  its not enough for me as i need to measure  the whole range , and using timers will only get me to 8Mhz max . (am i right?)

What "whole range"? The clock is a single frequency. Are you saying that 1 ppm isn't good enough? You must have some fancy test equipment. Slide-rule accuracy is usually good around here, haha smiley-grin  And yes, a timer will only get to half the system clock because it's toggling the output pin.
43  Using Arduino / Project Guidance / Re: Arduino Oscillator on: August 12, 2014, 02:08:44 pm
Quote
can it be done?  How can i do that ?
Just probe on the crystal with the oscilloscope.

Can this be done just by that? , because i tried that and the signal was erratic varying from 10 hz to 35 khz or so . Am i  connecting the probes wrong?

Not usually. The oscillator is very low power, most scopes will load it  too much and either make it erratic or stop it completely.

Try this sketch, it will output a square wave on pin 11 that is 1/16 the system clock frequency, so 1MHz.
44  Using Arduino / Networking, Protocols, and Devices / Re: Problem in Xbee Communication on: August 12, 2014, 10:38:45 am
Here is a demo I recently did, it uses a potentiometer attached to one Arduino to control a servo on another Arduino. It uses XBee ZB (S2) modules, but in API mode.
45  Using Arduino / General Electronics / Re: Wiring Arduino Micro with Xbee Radio on: August 12, 2014, 07:54:53 am
AVR HW serial idle; RX is INPUT and TX is HIGH
AVR SW serial idle; RX is PULLUP and TX is HIGH

Yeah I found that too, software serial got me to wondering. I don't use it much, haven't had a problem with it, but I've never used it with XBees (I use API mode and that just sounds like a bad combination). Not sure why SWS wouldn't mimic HWS in that regard though.

Quote
I wonder if a PNP transistor with the XBEE and a resistor to the grid switching the PULLUP to ground or not.....?  
Would be cheaper and a bit more static resistant.

PNP should work, meh.

Quote
Quote
7407s are old school, I'd bet it's hard to even find one. Use 74HC4050, 74HC125, etc.

How much current can I safely level with those? It looks like 10mA or less.
For signal, fine I guess but I won't be powering an SD on that. Maybe the choice there is a divider.

The IC is a much better choice. It's fine for the SD signals, everything is CMOS so very low current. Not used for the supply voltage of course.
Pages: 1 2 [3] 4 5 ... 289