Seite 2 von 2
Re: out-cs-bim 112 delay on start
Verfasst: 25. Sep 2021, 09:35
von pete68
I understand, but then how can you set a long delay?
Re: out-cs-bim 112 delay on start
Verfasst: 25. Sep 2021, 10:29
von gnampf
So this seems to be a bug, it should then wait 1000 * msec.
But calling delay from inside an IRQ isn't a great idea anyways, as all other IRQs are blocked by that also. If the IRQ has to wait, it would better reactive other IRQs (if thats possible on the ARM), which would also reenable the timer irq, or hand the action over to the main loop by setting some flag.
Calling it from outside an IRQ should'nt be a problem, even if there are IRQs pending (which you wouldn't notice, as they then would have get called). But of course it would be a problem if IRQs are disabled, and so the timer irq would not work. I'm not sure if IRQs are already enabled in setup?
Re: out-cs-bim 112 delay on start
Verfasst: 25. Sep 2021, 21:41
von Mirko
@gnampf: I agree that this is a bug, but 1000*msec would not work reliably because delayMicroseconds() takes an unsigned int but uses signed int internally. So the maximum delay could be 44739ms. We should discuss this more in depth in Slack.
Re: out-cs-bim 112 delay on start
Verfasst: 25. Sep 2021, 21:48
von Mirko
@pete68: Please try delayMicroseconds(10000000). This should work for usec < 44,739,244 for now.
Re: out-cs-bim 112 delay on start
Verfasst: 29. Sep 2021, 15:49
von Darthyson
Hello pete68,
pete68 hat geschrieben: ↑24. Sep 2021, 17:00
I had to modify the original project to use monostable relays. something is obviously wrong.
It would be quite helpful, if you could provide your code changes as a *.patch file or your changed .cpp/.h files.
AFAIK, the out-cs-bim112 only supports bi-stable relays.
I just tested in out-cs-bim112 -> app_main.cpp:
Code: Alles auswählen
void setup()
{
delay(10000); //wait 10 seconds
for (unsigned ipno=0; ipno<8; ipno++)
which worked as excpected, but is not the best place for a delay.
A better solution would be to change in config.h
(milliseconds)
Greetings
Denis
Re: out-cs-bim 112 delay on start
Verfasst: 29. Sep 2021, 19:50
von Darthyson
Hello pete68,
is this the
problem you want to fix with delay() ?
pete68 hat geschrieben: ↑8. Jul 2019, 11:26
...noticed a strange behavior in my modified circuit for monostable relays,...
Greetings
Denis