Show Posts
Pages: 1 [2] 3 4 ... 8
16  Using Arduino / Microcontrollers / Re: Multiple libraries that use same Timer on: May 10, 2013, 12:52:33 pm
You are right @Joe - we do not need timer for sonar.

There's another library that needs timer though, it is the "klik aan klik uit" library for ISM-band RF. The decoder library needs to work directly with AVR timers.
17  Using Arduino / Microcontrollers / Re: Multiple libraries that use same Timer on: May 10, 2013, 09:29:41 am
Adding clarification, that this is not exactly on Arduino HW using 328p or the likes, but using attiny85, which has only 2 times (8-bit).

The Tone library is not the standard Arduino tone library, and well, my usecase, does require Tone and Range-finding to work together (range of obstruction determines tone being played). The libraries in their original form, are certainly mutually exclusive, but idea was to find a way to change that.

@joe, looks like you've been there and done that, but I'm afraid that I don't understand the explanation completely, especially the part about subtracting the "500-600us dead time" bit. Some code could certainly help, but elaboration would also be quite okay.

Thanks for the answers folks.
18  Using Arduino / Microcontrollers / Multiple libraries that use same Timer on: May 10, 2013, 08:26:41 am

My understanding of the innards of Timer interrupt handling and programming are somewhat limited, however, my impression is that interrupt handlers can be chained. Firstly, is this true ? And if so, can I expect to be able to have multiple libraries that use the same Timer (say Timer1) to coexist ?

For example, there's a Tone library that uses Timer1 and an ultra-sonic ranging sensor library, that too uses Timer1. By, default, I believe one cannot use both libraries in same Arduino sketch, right ? The idea is to merge the library code to be able to do so.

Any best practices ?

19  Using Arduino / Microcontrollers / Mechanism for installation specific configurable parameter - EEPROM ? on: May 08, 2013, 07:49:10 am
My project involves multiple sensor nodes. The sensors need to behave somewhat differently based on certain parameters that are configured on a per sensor node, including calibration information. One easy way is to create different firmware for each instance.

I am wondering if it would be a good / recommended way, to use EEPROM, to store the configuration values, such that all the sensors are able to run the same firmware. That way, I only need to write the specific words in EEPROM, without touching firmware ?

However, with this approach, I'm running into a bit of problem that on my target uC (attiny85), I shall fall short of needed number of GPIO pins, if I reserve the ISP header pins, for it's subsequent programability (to write to EEPROM). Is this then something, that I should use jumper-pins to shunts to work around ? I.e. when I need to program uC, the jumper-settings are changed to connect uC pins to ISP pins (MISO, MOSI, SCK), and post programming jumpers are reset to allow them to function as GPIO ?

Keeping the sensor device circuit simple and low-cost is a key goal.
20  Using Arduino / Microcontrollers / Re: Installing arduino-tiny in 1.0.3 IDE on: April 25, 2013, 06:03:00 am
Immediately after posting my query, I found this:

Does this work on the newer IDE's ?
21  Using Arduino / Microcontrollers / Installing arduino-tiny in 1.0.3 IDE on: April 25, 2013, 06:00:52 am
Downloaded the arduino-tiny today. While I'd somehow managed to install it in 022 in past, but I'm a bit lost on how to do it with 1.0.3 version of the IDE. Searched around a bit here, but the search function wasn't very helpful. A pointer would be very useful.
22  Using Arduino / Microcontrollers / ATtiny85, WDT max periodicity on: April 21, 2013, 12:45:00 pm
Was reading this article on using the ATtiny's sleep mode to conserve battery power, and it appears that the maximum time for which WDT can be set is 8sec. Is there no way to set it up for something like 15mins ? Or do I have to indeed wake up every 8 sec, add to an accumulator and go back to sleep, until accumulator value is 15mins ?
23  Using Arduino / Microcontrollers / Arduino on ATtiny - which core ? HLT, or Arduino-tiny or another? on: April 19, 2013, 01:53:38 pm
Okay, I am getting back to Arduinos after a while, and I've programmed ATtiny's before, and I have used both High-Low Tech and Arduino-tiny and a smaller and even faster (claimed) library sometime back. Today when I checked, I found that there's been no development on Arduino-tiny since mid 2012, but HLT seems (perhaps) a bit more active. I'd be working mostly with the Attiny85's, I do have a good number of Attiny2313's which I could use. From what I understand, HLT doesn't support Attiny2313's, while Arduino-tiny does. Also, I remember some subtle differences between capabilities of the 2 approaches, with certain libraries working with one, but not the other - usage of Timer0 vs Timer1 etc.

If someone has the latest bearings on this, would appreciate if you could share the same, i.e. which one is recommended. I'd be using the timer and interrupts quite a bit, but need no PWM, and will be using only digital I/O for my list of projects.
24  Using Arduino / Microcontrollers / Re: Attiny 85 IR problems on: October 24, 2012, 01:04:47 am
On ATtiny45/85, sorry I didn't find a solution. My code worked perfectly on Arduino.
25  Using Arduino / Microcontrollers / Re: How to program ATtiny2313, given an Arduino Duemillanove on: February 21, 2012, 01:18:16 pm
@technodict, if your question is about the procedure for using Arduino-as-ISP to program attiny2313A's, then the answer is YES. The only thing different is selection of USB device for Arduino (since windows and Linux device naming and access is different... Windows being COM1, COM2... and Linux being /dev/ttyUSB0, /dev/ttyUSB1...), and the pathnames.. especially the Sketchbook path.
26  Using Arduino / Microcontrollers / Re: Installing ATtiny45 / ATtiny85 support in Arduino on: February 21, 2012, 01:13:55 pm
Don't have / use Mac, but since this is Java, I think usability wise, it should be similar to what we have on Linux / Windows.
Just create a new empty sketch and try to save it. The file-system browser window that opens up, note the path where it saves your new sketch. That is your sketchbook folder.
27  Using Arduino / Microcontrollers / Re: TinyTuner, attiny85, serial over USB, how to connect ? on: February 13, 2012, 12:27:39 am
Was referring to the 110R resistor added between RESET and +5VDC on Arduino board, to disable autoreset, when used as Arduino-as-ISP.
Blame it again on slow monday :-)
28  Using Arduino / Microcontrollers / Re: TinyTuner, attiny85, serial over USB, how to connect ? on: February 13, 2012, 12:22:49 am
Argh. Too much of Arduino-as-ISP hangover. I glossed over the bit about jumpering GND/RESET too fast to register, drawing a mental picture of 110R between them instead.
29  Using Arduino / Microcontrollers / Re: TinyTuner, attiny85, serial over USB, how to connect ? on: February 12, 2012, 11:17:15 pm

Excellent.  On the Duemillanove, connect a jumper from RESET to GND.  This holds the processor in reset preventing it from running.  You now have an accurate USB-to-TTL-serial converter.

Connect RX (or TX; I can't remember the reference point) to the appropriate pin on the ATtiny processor.  Connect GND on the Duemillanove to GND on the ATtiny.  Using your favourite terminal application send 'x' characters (don't send them too quickly; Tiny Tuner needs a little gap for processing).  It usually takes less than a dozen 'x' characters to find the ideal value.

Note: The ATtiny84 processor has enough memory to run the interactive sample.  Just connect TX (or RX) to the pin used for Tiny Debug Serial.

Which is the sketch loaded on Duemillanove ? Sorry, it is a slow monday.
Also, did you mean ATtiny85 (not 84) ?
30  Using Arduino / Microcontrollers / Re: Attiny 85 IR problems on: February 12, 2012, 11:03:53 pm
Argh. And I was about to do the same today, i.e. try with an external 16MHz XTAL. I am sure you've done the checklist of setting F_CPU correctly (or select right board in Arduino IDE), and blown the fuses using Arduino IDE's "burn bootloader" (with the right board type selected), or from avrdude commandline, with the fusebits value that is correctly computed.

One thing to try (and rule out the timing issue), would be to try the BlinkWithoutDelay sketch - as suggested by CodingBadly on my thread (I'm sure you'd remember to change pin to PB4), and measure output using a Logic-Analyzer, to measure frequency (and possibly duty cycle to be exact 50%), against known/calculated frequency, given the blink delays. I do plan to try this tonight.

Another thing I plan to try is make sure that the INT0 logic works. Will write a simple attachInterrupt(0,...) program and try it out. Other than those, I'm beginning to run out of ideas, on why this might not be working.
Pages: 1 [2] 3 4 ... 8