DueTimer icon indicating copy to clipboard operation
DueTimer copied to clipboard

DueTImer and serialUSB

Open DavidTol opened this issue 6 years ago • 2 comments

Hi, I have a problem with DueTimer: if I have an active timer the seriaUSB.readbytes() function freeze my Arduino DUE. I am not an expert on Arduino but I think there are a conflict inside theese two library (same timer?).

Thanks for help

BR, David

DavidTol avatar Jan 17 '19 18:01 DavidTol

Try doing a delay with micros(), like: while(micros() - start < DELAY);

It might work, since the delay function depends on millis, and when you are inside a timer callback, that timer stops counting, so it's like it's froozen in time, that's why you get stuck.

However, micros() is different and doesn't depends on a timer

Em qui, 4 de abr de 2019 às 19:20, Micah Stevens [email protected] escreveu:

I'm seeing a conflict with the delay() function. Might be related? This was working well - maybe recent Arduino updates has caused a problem. I'm still digging into it.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ivanseidel/DueTimer/issues/68#issuecomment-480084605, or mute the thread https://github.com/notifications/unsubscribe-auth/AC9Vr3vfXrOmp7_zQb83_W8LcqU-a-Ypks5vdnrKgaJpZM4aGh8O .

ivanseidel avatar Apr 04 '19 23:04 ivanseidel

Hi - yeah, I deleted my comment when I realized I was inside a timer interrupt when I was calling delay() - not a good idea. It was just debugging code anyway. Now it's working fine.

To @DavidTol - I'm using this library with SerialUSB currently and it seems stable for me, if that helps. I haven't had any problems other than my silly delay() mistake.

MicahStevens avatar Apr 05 '19 06:04 MicahStevens