Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to receive data when interrups are being used. #58

Closed
MichMich opened this issue Apr 22, 2016 · 5 comments
Closed

Unable to receive data when interrups are being used. #58

MichMich opened this issue Apr 22, 2016 · 5 comments
Labels

Comments

@MichMich
Copy link
Contributor

Since I want to use PJON for a stepper motor project, I need to use interrups. The interrups make sure the motor runs, while the main runloop is free for other tasks (like receiving any network communication).

Unfortunately, PJON is unable to receive any messages, while the interrupts are active. If I disable the interrups, everything works fine.

Any idea how to solve this?

I'm using https://github.com/PaulStoffregen/TimerOne to configure the interrups, and run the interrupts on a 50 microsecond interval.

@gioblu
Copy link
Owner

gioblu commented Apr 22, 2016

Ciao @MichMich Mich, my suggestion is to try to use interrupts on the bus, to detect the incoming packet or an initial HIGH you can generate, before transmitting, and detach the interrupts are now messing with PJON, for the time you need to receive or transmit.

@gioblu
Copy link
Owner

gioblu commented Apr 25, 2016

Ciao @MichMich, 2.0 is finally out stable.
How your experiments went with the strategy proposed?
Happy tinkering 👍

@MichMich
Copy link
Contributor Author

I've been checking out this solution, but still PJON seems to have to much of an impact on my stepper motors. I'm trying some other solutions now to see if I can get better results.

@gioblu
Copy link
Owner

gioblu commented Apr 29, 2016

Ciao @MichMich
Maybe tihs is missing in the PJON codebase:
https://www.arduino.cc/en/Reference/NoInterrupts

Thank you for your report. I am studiyng a solution

@gioblu
Copy link
Owner

gioblu commented Sep 8, 2016

Ciao @MichMich take a look to version 5!
So I would close this issue, because it is a documented known issue related to the SoftwareBitBang and OverSampling strategies. With the addition of strategies, now ThroughHardwareSerial enables to have flawless communication with those devices where interrupts are vastly used. The development of other interrupt compatible strategies will offer a wide selection of media for this sort of device.

@gioblu gioblu closed this as completed Sep 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants