Go Down

Topic: Seperate IC to Count Pulse Input? (Read 5 times) previous topic - next topic

BenF

Quote from: Graynomad

Yep, an ATtiny85/84.

They will use more power than a counter chip, but this idea is good for a lot of "is there a chip than co do ..." cases where as a hobbyist you may have a go at creating it yourself.

No one mentioned the more obvious solution however, that all of the three AtMega timers can be configured to work as pulse counters.

Wagner Sartori Junior


No one mentioned the more obvious solution however, that all of the three AtMega timers can be configured to work as pulse counters.


I know, but I can't maintain my arduino on. So I need a "offline" solution to count for me. Even if I put an attiny85 to do this and transfer using some USART or I2C between arduino/chip.

The DS2423 is a good way to go. But the chip is SMD I'll need a breakout board to it because $25.00 for the complete board on hobbyboards is VERY expensive.

BenF


I know, but I can't maintain my arduino on. So I need a "offline" solution to count for me.

When using sleep mode idle, counters will still operate and you can disable unused peripherals for further power reduction. Wakeup source could include timer overflow (from the timer that counts external pulses). When using an external counter IC, you will probably need to wake up more frequently (worst case wind condition) in order not to overflow the external counter. Using the internal counter (8-bit for timer2 or 16-bit for timer1) you would only wake up if and when needed. Power usage in sleep mode idle is about 2.5mA so this would be the target to beat when considering external counters (you could probably avoid the 555 timer as well using sleep mode idle).

Timer2 can be configured for asynchronous operation and this would allow operation during additional sleep modes, but unfortunately is not compatible with the Arduino design (AtMega must run on internal oscillator in this mode) with the asynchronous clock connected to PB6 (Atmega328 pin 9).

steinie44

Might try a 74590 with a PCF8574. Count on the 74590 and read I2C from the PCF8574 chip. Thinking of doing this myself as I want all my weather sensors to be I2C. :)

gismo

Hey, I've been looking for a similar solution a separate IC that can count pulses and also calculate frequency..since you're already counting pulses and using timers..

Anyway, was looking for a ready made solution and found one chip the LS7366r which communicates via SPI. They're not cheap or very easy to come by.  I found a few breakout boards, but still pricey.

I opted to program an ATtiny85 and came up with a working solution that will send pulse information over I2c. The major problem is precision... If you want to use the 8bit timer/counter then you cannot use a crystal.  Regardless, I tried both an interrupt based method and count interrupts with a short ISR(PCINT) and with the 8bit counter. Lastly, to get better timer precision, you can tune it, but it's not ideal for me. I might try an ATtiny84 which has more pins free for crystal and counter. If anyone would like to collaborate or help or just test it on their setup, PM me.

I might try the crystal and pcint on the 85 and report back...need to buy a crystal

Thanks


Go Up