Show Posts
Pages: 1 ... 134 135 [136] 137 138 ... 250
2026  Using Arduino / General Electronics / Re: Precision quartz guidance sought on: October 02, 2012, 01:54:07 pm
Quote
Well of course an external prescaler would be fine.

Internal prescaler works as well.

Quote
Note that an external timer clock input goes through a sampling circuit synchronized with the system clock. From the datasheet, section 11.3.3:

That's because timer0 is synchronous. Try an asynchronous timer instead. To make you more comfortable, there are plenty of AVR-based frequency counters that go way about 10Mhz, without an external divider.

OK, I'm confused. If the internal prescaler works on an external timer clock, then why does the datasheet say, "An external clock source can not be prescaled."

On an ATtiny45, T0 is synchronous, and T1 cannot be clocked externally, so I'm not sure where that leaves us but to use the external system clock with that chip. The ATmega328 is similar: While T0 and T1 can be clocked externally, both are synchronized with the system clock. I'm perfectly willing to believe that there are other AVR parts where this is not the case, but I don't have exhaustive knowledge of the Atmel catalog; perhaps you could suggest a part.
2027  Using Arduino / General Electronics / Re: Precision quartz guidance sought on: October 02, 2012, 01:25:06 pm
Quote
Earlier in the thread we determined that 10MHz was too fast for an external timer clock.

Not with a prescaler, built-in or otherwise.

Well of course an external prescaler would be fine.

Note that an external timer clock input goes through a sampling circuit synchronized with the system clock. From the datasheet, section 11.3.3:

Quote
However, due to variation of the system clock frequency and duty cycle caused by oscillator source (crystal, resonator, and capacitors) tolerances, it is recommended that maximum frequency of an external clock source is less than fclk_I/O/2.5.
An external clock source can not be prescaled.
2028  Using Arduino / General Electronics / Re: Precision quartz guidance sought on: October 02, 2012, 01:08:04 pm
You can directly connect it to an input pin - exactly which pins will depend on your impelementation. I would connect it to a timer/counter input pin.

Earlier in the thread we determined that 10MHz was too fast for an external timer clock. As the OP said, an external system clock is certainly an option. For an ATtiny45 as mentioned earlier, this would just involve setting the CKSEL[3:0] bits in the low fuse byte to 0000, and connecting the external oscillator to the CLKI pin (pin 2 on the DIP package).
2029  Using Arduino / General Electronics / Re: Eagle polygon isolate parameter on: October 02, 2012, 12:46:51 pm
Leave isolate=0 and stop worrying?  Set it to a stupidly large value and see what happens?

Ah yes, the stupidly large value, great idea, now why didn't I think of that! smiley-lol

I tried a 100 mil isolate. Not surprisingly, what happens is the ground plane falls apart into multiple polygons, breaking ground connections in several places. Airwires appear that make this obvious. But the risk may be that with a not-so-stupid-but-still-too-large value, the same thing happens and the airwires are so small they don't get noticed. This is one of my pet peeves with Eagle, very short airwires can be hard to see. But there's no excuse for not knowing they're there, because the ratsnest command indicates the number of airwires on the status bar.

Still confused on the language in the help item, "small gaps may result ... which may lead to problems during manufacturing" makes it sound to me like the gaps are undetectable or nearly so. But as long as an airwire gets created, even if it's hard to see, ratsnest lets us know it's there.

Thanks for the suggestion!
2030  Using Arduino / Programming Questions / Re: getting Xbee S1 to talk to other Zigbee modules on: October 01, 2012, 07:40:40 pm
XBee S1 modules (now called XBee 802.15.4) do not speak ZigBee.

Interestingly, a Google search for ZNM2405 returns only this post, and a few hits on license plate numbers smiley-eek-blue
2031  Using Arduino / LEDs and Multiplexing / Re: 74HC595 Source/Sink Current on: October 01, 2012, 07:29:37 pm
Following the link from the instructables parts list to Digi-Key, to the datasheet for the TI 74HC595, on the first page under features, it says, ±6-mA Output Drive at 5 V.

On page 5 under absolute maximum ratings (which are to be avoided) it says Continuous output current ±35 mA. Now if that is a per-pin number, it's a long way from 6mA. So there may be some room to abuse the chip a bit and get away with it, especially in a multiplexing situation.

But there is also an overall maximum for the chip: Continuous current through VCC or GND ±70 mA, and of course there are thermal limitations as well.

The video on instructables only shows one LED on at a time. Using 120-ohm resistors as outlined, current could be as high as 25mA per LED. So I wouldn't be surprised if when trying to light more than one LED in a column simultaneously, if the brightness of all of them were diminished. Worst case we could be talking magic blue smoke I suppose.

Took a quick look at the TPIC6B595N. Open-drain outputs, so yes, they would sink current only.

With the 74HC595, transistors could be added to increase the current capacity. Another solution would be a MAX7219, which can drive an 8x8 matrix and is built for the purpose. The MAX7219 would also simplify the MCU code, as the MCU would not need to do the actual multiplexing, it would just send the desired bit patterns to the MAX7219.

Edit: another option, I've driven 4-digit 7-segment displays direct from an ATmega328P, using transistors for the digit drivers, but driving the segments direct from the MCU, with current-limiting resistors in the segment lines. I was careful not to exceed 20mA per pin, but that was more than needed, anyway. Heck, an ATmega328P isn't much bigger than an ATtiny85 plus a 74HC595 smiley-grin

2032  Community / Bar Sport / Freebie from Mouser on: October 01, 2012, 02:56:22 pm
Arrived in the mail today, unsolicited.  63 pages.  A free copy can be requested at http://www.mouser.com/framfordummies/

2033  Using Arduino / General Electronics / Re: Breadboard Help on: September 30, 2012, 10:40:41 am
The long leg on the LED is normally the anode or positive end. Either reverse the LED, or connect the short leg to ground instead of to +5V.
2034  Using Arduino / General Electronics / Eagle polygon isolate parameter on: September 30, 2012, 10:36:48 am
The quote below is from the Eagle help file. I typically use polygons for ground plane pours and I'm pretty sure I've increased the isolate value to be larger than the clearances in the design rules and have not had problems. But evidently I don't know "exactly what I am doing" because I'm not quite visualizing what problems might occur, and whether they are detectable before having the boards manufactured. Can anyone shed any further light on this?

Quote
Isolate
Distance between polygon areas and other signals or objects in the Dimension layer (default: 0). If a particular polygon is given an Isolate value that exceeds that from the design rules and net classes, the larger value will be taken. See also Design Rules under Distance and Supply, respectively. Note that if you give a polygon an Isolate value that exceeds that from the design rules and net classes, small gaps may result between the calculated polygon and objects belonging to the same signal as the polygon itself, which may lead to problems during manufacturing! It is therefore recommended to leave this parameter at 0, unless you know exactly what you are doing!
2035  Using Arduino / Programming Questions / Re: Timers in assembly (Atmega328P) on: September 30, 2012, 07:02:12 am
Timers can be manipulated very easily in C, so no need for assembler unless it's just for its own sake. The C compiler handles accessing the 16-bit registers properly. See the datasheet, but basically: To do a 16-bit write, the high byte must be written before the low byte. For a 16-bit read, the low byte must be read before the high byte.

Dean Camera's "Newbie's Guide to AVR Timers" helped me tremendously:
http://fourwalledcubicle.com/AVRArticles.php
2036  Using Arduino / General Electronics / Re: Using Arduino with high voltages on: September 30, 2012, 06:53:41 am
Here is a circuit that worked very well for me:
http://arduino.cc/forum/index.php/topic,68944.msg523300.html#msg523300

For 220V, I'd use a 0.1µF 400V capacitor instead. Note that this circuit is meant to interrupt the MCU at the mains frequency. It's a pretty straightforward interrupt to deal with, but if a simple high/low logic level input were preferred, some RC circuit on the output side of the optocoupler could accomplish that, although there would be a bit of a delay involved due to the RC time constant.
2037  Using Arduino / General Electronics / Re: Precision quartz guidance sought on: September 26, 2012, 02:07:24 pm
Ah, right. I must have seen this but probably blanked it on the grounds that it required way more concentration than was available at that particular time. Thanks.

Haha, I'm sure that the same thing happened to me earlier. I may borrow that line if you don't mind smiley-grin
2038  Using Arduino / General Electronics / Re: Precision quartz guidance sought on: September 26, 2012, 07:50:55 am
However, due to variation of the system clock frequency and duty cycle caused by Oscillator source (crystal, resonator, and capacitors) tolerances, it is recommended that maximum frequency of an external clock source is less than fclk_I/O/2.5.

Good catch, there was this tiny nag in the back of my mind but I didn't listen to it smiley-red  I do believe that fclk_I/O is the same as the system clock. Hmmm, do they they make 1MHz OXCOs? Or just prescale it with hardware, a decade counter or whatever.

Quote
17.1 Internal Clock Source
The Timer/Counter can be clocked directly by the system clock (by setting the CSn2:0 = 1). This provides the fastest
operation, with a maximum Timer/Counter clock frequency equal to system clock frequency (fCLK_I/O).
Alternatively, one of four taps from the prescaler can be used as a clock source. The prescaled clock has a frequency
of either fCLK_I/O/8, fCLK_I/O/64, fCLK_I/O/256, or fCLK_I/O/1024.





2039  Community / Bar Sport / Re: SHOUT OUT if you are female. on: September 25, 2012, 09:32:33 pm
Rear Admiral Grace Hopper is a hero(ine) of mine.

Ditto, except I'm not sure about that COBOL business smiley-wink
2040  Using Arduino / Sensors / Re: Problems with ATTiny and it's ADC's on: September 25, 2012, 09:28:33 pm
Hmm, yes that is off a bit. As a test, I'd connect pins 2 and 3 together and then connect them to a single sensor. Or to a voltage divider or potentiometer. If they don't track very close, within a count or two, then I'd say the microcontroller has issues. If they do track, then I'd look to the sensor circuitry for differences. What sensors are being used, anyway?
Pages: 1 ... 134 135 [136] 137 138 ... 250