Git Product home page Git Product logo

Comments (22)

Kevin-M-Smith avatar Kevin-M-Smith commented on July 26, 2024

Hi Ruben -

I haven't done any work porting to 32-bit, but I might be able to investigate the plausibility if you have a particular board in mind.

At one point I looked into porting it to ARM CPUs (e.g. Arduino Due) but the interrupts are handled much differently, especially if there is a bona fide operating system on board.

Best,
Kevin

from arduino-sdi-12.

rkertesz avatar rkertesz commented on July 26, 2024

Thanks Kevin,

I have a couple of konekt dash (cortex m4) boards. I may be able to send one to you to test with. I also have a particle electron (cortex m3). One interesting thing about the particle board (no pun intended) is that someone made some sort of interrupt header file as part of a larger port to particle . https://community.particle.io/t/implementing-timer-interrupts-for-pulse-sensor-solved/2997/14

Both allow for someone to use attach_interrupts. I presume this is not a practical option.

Thank you,
Ruben

On Apr 28, 2016, at 5:44 PM, Kevin M. Smith [email protected] wrote:

be able to investigate the plausibility if you have a particular board in mind.

At one point I looked into porting

from arduino-sdi-12.

Kevin-M-Smith avatar Kevin-M-Smith commented on July 26, 2024

Hi @rkertesz -

Apologies for the radio silence.

I think your original assessment was correct: the way these CPUs handle interrupts is fundamentally different from the Atmel ATMEGA series chips.

Unfortunately, I don't think this library will get you there, unless you want to spend one of your M3 or M4's UARTs to piggyback off of a separate ATMEGA chip running the library.

You would only need one per installation since the address space is enough to handle 64 sensors.

Did you come up with anything on your end?

Best,
Kevin

from arduino-sdi-12.

ManuelJimenezBuendia avatar ManuelJimenezBuendia commented on July 26, 2024

Hi Kevin.

Thank you so much for the library, it works great with AVR based Arduino Boards. Now I am moving to ARM boards (Arduino Zero) and I am having the same issue with avr/interrupt.h and avr/parity.h.
I was wondering if you are planning to modify the library code to make it work with ARM processors. Probably it is not so complicated, but I don't feel as experienced at programming as to do it myself.

Best,
Manuel.

from arduino-sdi-12.

Kevin-M-Smith avatar Kevin-M-Smith commented on July 26, 2024

Hi Manuel,

Unfortunately the switch from AVR to ARM is not trivial, but @jrzondagh mentioned in issue #13 that he had managed to get a solution working. As far as I know the solution has not yet been made public.

Warm regards,
Kevin

from arduino-sdi-12.

jrzondagh avatar jrzondagh commented on July 26, 2024

Hi All,

Sorry for the delay in submitting the code online, will try get to it this week still. We have it working nicely on SAMD21 chip.

Cheers, Justin

from arduino-sdi-12.

Kevin-M-Smith avatar Kevin-M-Smith commented on July 26, 2024

That's excellent news. Thanks Justin!

from arduino-sdi-12.

ManuelJimenezBuendia avatar ManuelJimenezBuendia commented on July 26, 2024

That's good news indeed. I'm looking forward to testing it. Thanks Justin!

from arduino-sdi-12.

adnanoner avatar adnanoner commented on July 26, 2024

@jrzondagh Hi Justin, great that you are working on this. Any updates :)?

from arduino-sdi-12.

gppk avatar gppk commented on July 26, 2024

Hi @jrzondagh How are you getting on with the ARM conversion?

from arduino-sdi-12.

pirvanc avatar pirvanc commented on July 26, 2024

@jrzondagh , Hi Justin, we're also interested in this. Thanks.

from arduino-sdi-12.

locomundo avatar locomundo commented on July 26, 2024

Yes, please!

from arduino-sdi-12.

ManuelJimenezBuendia avatar ManuelJimenezBuendia commented on July 26, 2024

I have modified the code to work with ARM (implemented the parity function and modified the interupt calls) but I am having issues with the Arduino Zero and the GPIO pin that uses the interrupt. The modified code works OK with UNO and Leonardo (both AVR) but fails with Zero.
If anyone wants to have a look at the modified code and the issues, I can send it by email.

from arduino-sdi-12.

adnanoner avatar adnanoner commented on July 26, 2024

@ManuelJimenezBuendia sure, you could send it to adnanoner ๏นซ gmail.com ๐Ÿ‘

from arduino-sdi-12.

madvoid avatar madvoid commented on July 26, 2024

Hi everyone, I've gotten this library working with an Arduino Zero Clone (this one specifically) and a Decagon anemometer that communicates via SDI12. I made very minimal changes to the library but I don't know if it would be ready to push yet. I've included the files below but I think it would be best if there was more testing with other sensors to make sure I didn't accidentally make it just work with my sensor.

The changes I made:

  • Replace the parity function with my own. It's probably not as efficient as the built in one but the ARM boards are faster so I figure there's not much of a problem.
  • Replace the interrupt code in setState() to be compatible with an Arduino Zero. Since the Zero is interrupt compatible on any pin (except for 4), the changes were relatively simple.

Enjoy!

SDI12_Zero.zip

from arduino-sdi-12.

Kevin-M-Smith avatar Kevin-M-Smith commented on July 26, 2024

Thanks @madvoid!

from arduino-sdi-12.

adnanoner avatar adnanoner commented on July 26, 2024

Thanks @madvoid! I got this working (by coincidence I also have the SAMD21 board). For some reason I think there is a problem with flushing or something. The code does however works properly when I begin and end the serial communication after each command ๐Ÿ‘

from arduino-sdi-12.

ManuelJimenezBuendia avatar ManuelJimenezBuendia commented on July 26, 2024

from arduino-sdi-12.

madvoid avatar madvoid commented on July 26, 2024

I'm glad a few of you have gotten it working! I have been in email contact with @ManuelJimenezBuendia and I was interested to hear he had the exact same bug as me. I'll describe it now for future reference, and our solutions as well.

The problem we both had was odd. The sensor would respond after the first request for data, but none of the subsequent requests. For both of our sensors, it seemed that digital write didn't seem to change the pin state anymore after a request has been made.

It seems that @ManuelJimenezBuendia fixed it by issuing a forceHold() command before any request for data, I fixed it by issuing the forceHold() command after every request and response. It seems that the forceHold() is necessary to get the line into a state that's "open" again. @adnanoner, did you need to do this as well?

Finally, I would like to note that in my application, I was using a level shifter that had pullup resistors on the data line. I don't know if these are necessary or not.

from arduino-sdi-12.

ManuelJimenezBuendia avatar ManuelJimenezBuendia commented on July 26, 2024

Hi!
I finally made it work! Just by placing a pinMode(_dataPin,INPUT); before every pinMode(_dataPin,OUTPUT);
I don't know why, but this way the pin changes state as output. There is probably some issue regarding pinMode and interrupts.
If anybody finds an explanation, please share.
Meanwhyle, here is the modified library with some working examples. I've used Decagon 5TE powered and operated at 3.3 V (that is directly connected to a Genuino Zero).
SDI12_ARM.zip

from arduino-sdi-12.

ManuelJimenezBuendia avatar ManuelJimenezBuendia commented on July 26, 2024

I have forked the original project with the modified versions of the files to work with Zero and compatible boards:
Hope no have made any mistake!

from arduino-sdi-12.

SRGDamia1 avatar SRGDamia1 commented on July 26, 2024

Pulled in and tested on an Adafruit Feather M0. See #33

from arduino-sdi-12.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.