Author Topic: Using Ultra Low Power RTC to control Moteino Sleep/Wake with 24nA Sleep current.  (Read 23124 times)

TomWS

  • Hero Member
  • *****
  • Posts: 1930
Right. Vcc and vbat would both be connected to the positive side of the cr2032. A cr2032 has an internal resistance on the order of 20ohm - so what's 1.1ohm or even 3.8ohm between friends I would ask  ;)
Actually, the REAL reason I didn't switch GND is that I am very anal about tying RF components to ground.  Now in this particular case it may not matter if your ground pour is the switched ground (leaving the RTC and battery on their own -Bat connection), but, call me squeamish, I am just not comfortable switching ground on a several hundred megahertz radio.  You would also need to provide a coupling cap across the switch so that high frequency current spikes don't appear as signals on the RTC's control pins).  Let me know how it works for you   :)

Tom

someburner

  • NewMember
  • *
  • Posts: 13
Thanks for sharing this!

Question: Can this RTC be used to delay interrupt pulse signals, or 'stretch' the signal, from a sensor? I should know this, but it's been quite a while since my undergraduate DSP class  :-[  If I'm understanding the datasheet correctly, it would seem that this is possible as long as frequency is below a certain frequency.

I'd like to use one of these to modify the signal coming into a Moteino to allow the Moteino enough time to send off a packet without being interrupted on INT1. The pulses are expected to be as short as ~5 ms, but not periodic. Of course, the ATMega328 is perfectly capable of handling this, but I don't think I can put the RFM69 in TX mode, fill the buffer, and send fast enough to handle this.

I've considered using the ATMega's CTC mode to simply poll the pin, but the sleep/wakeup control is appealing as well and I figure it might be easier to have this all taken care of by this RTC. 


TomWS

  • Hero Member
  • *****
  • Posts: 1930
Thanks for sharing this!

Question: Can this RTC be used to delay interrupt pulse signals, or 'stretch' the signal, from a sensor? I should know this, but it's been quite a while since my undergraduate DSP class  :-[  If I'm understanding the datasheet correctly, it would seem that this is possible as long as frequency is below a certain frequency.

I'd like to use one of these to modify the signal coming into a Moteino to allow the Moteino enough time to send off a packet without being interrupted on INT1. The pulses are expected to be as short as ~5 ms, but not periodic. Of course, the ATMega328 is perfectly capable of handling this, but I don't think I can put the RFM69 in TX mode, fill the buffer, and send fast enough to handle this.

I've considered using the ATMega's CTC mode to simply poll the pin, but the sleep/wakeup control is appealing as well and I figure it might be easier to have this all taken care of by this RTC.
I don't see how this device helps with your application.  Further, I don't understand your application well enough to make a recommendation.  Can you elaborate?

Paraphrasing I 'think' you said:
You have a sensor that produces a series of somewhat randomly spaced pulses.  The pulse SPACING is no shorter than 5mS (What is the pulse width?) and are more often wider spaced than this.  When a single pulse occurs, you want the Moteino to wirelessly send 'something' to another node, not sure what that 'something' is.  And if a pulse occurs while the Moteino is sending, you simply want to queue up this event and have the Moteino send when able.

Is this close?

What else can you tell us about this application?

Tom

someburner

  • NewMember
  • *
  • Posts: 13
Ah, I should have been more clear!

As it is now the interrupt signal is set back to low by the MCU by reading the sensor's status register. So it remains high until then. The application is a water meter reader, with an interrupt being generated for a change in magnetic field. So there is a quantifiable maximum frequency just based on water pressure, pipe size, and the meter. But water could go on/off at any point really.

The 'something' is just an unsigned integer count of number of pulses received.

So what I'm looking for is something that can delay the input signal for enough time to send off a packet on the RFM69. Or something like an RTC that just counts high-low level transitions on a pin. Also, the sensor can be configured to automatically clear the interrupt pin instead of the status registers needing to be read. The maximum sample rate is 400Hz so I would imagine that any RTC would not miss that. And I suppose that would mean the min period would 2.5ms.

SadE54

  • NewMember
  • *
  • Posts: 36
Nice design !
It inspires me for my universal alarm detector that's hidden somewhere in my head :)
The goal is to have an universal AES encrypted / jamming detector / low power module that can be connected to all alarm sensor like PIR , keyboard, siren
I just want to embed a accelerometer to be able to detect door opening / glass breaking.
And the low power RTC is mandatory for efficiednt crypto ! 
It's nice to see it's possible to reach such low area :)


Jim

  • NewMember
  • *
  • Posts: 16
Hi,

I just came across this thread with the Moteino and the AB1805 RTC. I need one or preferably two alarm outputs. My Moteino sleeps and I want to wake it up with two different alarms. Which of the outputs can I use?
Is this Fout/NIRQ of the AB1805?

TomWS

  • Hero Member
  • *****
  • Posts: 1930
The AB1805 only has one Alarm register but it should be relatively easy to construct the SW to set the register to the nearest alarm time.  Then, when the interrupt occurs, replace the alarm value with the next alarm time.  If it's possible to have coincident alarms, then you'll have to figure a way to flag this in your own alarm table.