Comments (22)
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.
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.
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.
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.
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.
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.
That's excellent news. Thanks Justin!
from arduino-sdi-12.
That's good news indeed. I'm looking forward to testing it. Thanks Justin!
from arduino-sdi-12.
@jrzondagh Hi Justin, great that you are working on this. Any updates :)?
from arduino-sdi-12.
Hi @jrzondagh How are you getting on with the ARM conversion?
from arduino-sdi-12.
@jrzondagh , Hi Justin, we're also interested in this. Thanks.
from arduino-sdi-12.
Yes, please!
from arduino-sdi-12.
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.
@ManuelJimenezBuendia sure, you could send it to adnanoner ๏นซ gmail.com ๐
from arduino-sdi-12.
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!
from arduino-sdi-12.
Thanks @madvoid!
from arduino-sdi-12.
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.
from arduino-sdi-12.
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.
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.
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.
Pulled in and tested on an Adafruit Feather M0. See #33
from arduino-sdi-12.
Related Issues (20)
- Question. HOT 2
- new tinyAVR boards support. tips?
- ESPhome HOT 4
- Missing check for 8.33mS marking before checking address for sdi12 slave/sensor HOT 1
- Able to adjust Break and Marking timing from Arduino code
- Support for Arduino R4 Renesas chip? HOT 1
- Doesn't work on Arduino GIGA R1
- i am using hydros21 sensor which is working on sdi12 protocol and currently i am stuck in a issue which is sensor is not working properly and not given data correctly so any one help me for this HOT 2
- ESP32- Core panic when using in conjunction with the "preferences" library. HOT 1
- NRF52 Support HOT 1
- IDE 2.0 compilation problem HOT 1
- Sparkfun Artemis and CS320 pyranometer HOT 16
- SDI12 - ESP32 NOT OPEN BUS HOT 9
- Watchdog Problem SAMD21 HOT 4
- Adding a Direction Control Pin HOT 11
- ASR6501 - Cubecell support HOT 2
- Can not read measurements HOT 8
- Do you have any plans to support rp2040 platform ? HOT 1
- Documentation missing? HOT 3
- SDI12 with SoftwareSerial (Stopgap Fix not working) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arduino-sdi-12.