PDA

View Full Version : pinWakeUp hanging ZIC2410


d97rosz
02-23-2010, 05:19 AM
Hi,

We have added an external RTC (M41T83) to our newly developed PCB and connected it to GPIO 19 (alaram1=IRQ1) and GPIO 18 (alarm2=IRQ2).
When we configure the clock to run a periodic alarm on IRQ1 (GPIO 19) each seconds, and then monitors the pin (by adding GPIO-hook), we could see that the alarm is working.

@setHook(HOOK_GPIN)
def _gpioChangedState(pin, state):
print pin
print state
writePin(1,state)
Clock_ClearClockFlag()


But when we use the pinwakeupZIC2410.py code, the processor won't wake up, it is just hanged (or anyhow not responsive anymore). We don't even have to call the sleep function to hang the system, it is enough to call the wakeupOn function and then to start the external RTC, then it becomes unresponsive immediately. Then only way to make it responsive is by a hard-reboot (switch hardware off and then on).
The strange thing is that the pinwakeupZIC2410.py code worked well on the dev-board where we could wake the processor from sleep by pressing a push button. We also notice that the external RTC is working well since we could monitor what is happening on the GPIO 19.
(FYI - we use an external pull-up resistor and the GPIO will go low when RTC is activating the interrupt). We haven't yet tried the GPIO 18 but I assume that it will be the same problem. We have also tried both polarities on the wakeupOn with the same result.

So, the combination between starting the external RTC and the pinwakeupZIC2410 doesn't work correctly. Is there any setting in the wakeupOn that might be wrong or what could be the cause?

kbanks
02-23-2010, 05:43 PM
When used for "wakeup", those IRQ pins are level sensitive (not edge triggered). Your external device may be "holding" the ZIC2410 in a continuous interrupt.

If you go back to your EVBx board and try your script with the buttons HELD DOWN, you should see what I am talking about.

Edge triggering is not an option, because the ZIC2410 hardware won't "wake up" in that mode.

d97rosz
02-24-2010, 12:52 AM
When used for "wakeup", those IRQ pins are level sensitive (not edge triggered). Your external device may be "holding" the ZIC2410 in a continuous interrupt.

But we use an external pull-up resistor and when monitoring the pin it is only low for a short time (when interrupt fires from RTC). This means that the pin is normally high so I cannot see how we are "holding" the ZIC2410 in a continuous interrupt...

kbanks
02-24-2010, 12:39 PM
when monitoring the pin it is only low for a short time (when interrupt fires from RTC).

Is the external device generating a "pulse"? Or is it taking the pin low and keeping it low until the device is "serviced" in some way?

d97rosz
02-24-2010, 01:50 PM
Is the external device generating a "pulse"? Or is it taking the pin low and keeping it low until the device is "serviced" in some way?

The pin remains low until the RTC is being serviced.

d97rosz
02-26-2010, 02:27 AM
Hi,

1. Have someone out there (or SNAP support) connected an external RTC to the ZIC2410 in order to wake it up? If yes, please provide us with some more information on why it's not possible to wake up the device through regular interrupts (that we are currently monitoring)?
2. The documentation for the ZIC2410 (in the ZIC2410.pdf) is rather bad. Do you know if there is a newer version of the document that you could provide? (we only have revision 0005-05-07-00-000 of the document).
3. In the pinwakeupZic2410.py, there is a register 0x22f0 that is used for the polarity. This seems to be totally undocumented in the ZIC2410.pdf. Could you please explain what this register contains?

kbanks
02-26-2010, 04:40 PM
The "0005-05-07-00-000" is the latest official datasheet we have too.

We don't make the ZIC2410 chip, CEL does. Please contact them to get the latest official hardware documentation for their part.

As you can see in the pinWakeupZIC2410.py script, the register at 0x22F0 controls the polarity of INT0 (the 0x20 bit) and INT1 (the 0x10 bit).

kbanks
02-26-2010, 04:47 PM
The pin remains low until the RTC is being serviced.

Please re-read my February 23 post.

I think you will need to add extra logic to force a "short pulse" instead of a "held low" signal.

My guess is your RTC is waiting for the ZIC2410 to service it, and your ZIC2410 is waiting for the constant interrupt to be removed.

d97rosz
03-01-2010, 11:56 PM
I think you will need to add extra logic to force a "short pulse" instead of a "held low" signal.
My guess is your RTC is waiting for the ZIC2410 to service it, and your ZIC2410 is waiting for the constant interrupt to be removed.

Yes, this is exactly what is happening.

The other option we have (that is currently working) is to use the free-running timer on the RTC that produces a pulse, meaning we don't have to read a register for it to go high again. The only drawback with the free-running timer is that it's not correlated with the intenal clock (date & time). Anyhow this seems to be our best option right now. And it might work out well since the interrupt timer will only be used to synchronize the nodes while the clock (data & time) will serve the scheduled jobs we will run.

Thanks for all the help kbanks!