Sujet : Re: Arduino + MCP9600 + thermocouple help needed
De : no (at) *nospam* no.no (James Waldby)
Groupes : rec.crafts.metalworkingDate : 21. Mar 2024, 06:23:40
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <utgg8s$21ao1$1@dont-email.me>
References : 1 2 3 4 5 6 7 8
User-Agent : tin/2.6.2-20220130 ("Convalmore") (Linux/5.15.0-100-generic (x86_64))
Jim Wilkins <
muratlanne@gmail.com> wrote:
"James Waldby" wrote in message news:ute49n$1ci6f$1@dont-email.me...
[big snip]
--------------------------
Thanks, I'm glad someone whose Arduino experience is less archaic than mine
has jumped in. I think in hardware terms, voltage and current, and should
have clarified that INPUT_PULLUP is sufficient to make the pin high.
The $23 one-channel DSO211 oscilloscope I have doesn't seem available and
wouldn't capture both I2C signals so I didn't suggest it. I bought it for
signals whose return can't be grounded.
Yes, it's a good feature of battery-powered small cheap scopes that
they allow ungrounded operation. As you note, some of them can't
capture I2C, which I didn't think about WRT the cheap scope I linked.
It does 250 KHz, not good enough for `Fast Mode` I2C at 400 KHz, let
alone the 3.4 MHz and 5 MHz versions of I2C.
IIRC the Arduino needed a separate terminal to talk to the user, the IDE
didn't provide that function. Does it now?
I think a decade ago there were some issues with Serial.printf, and
some serial-over-USB drivers had bugs that hung around a while, but
for a good while the same USB link used to program an Arduino Uno or
Nano has been working fine for serial IO to a window that's part of
the IDE. However, on Linux at least, a not-IDE Python or C program
can't share a serial link with the IDE; one or the other has to
relinquish it.
Note, the IDE now has an easy-to-use Serial Plotter tool. If a sketch
outputs some numbers on each line of serial output and you open a
Serial Plotter window, data will be plotted as it arrives, like on a
multi-channel scope.
The simplest switch debouncer I've seen and used is a spare buffer
or noninverting gate(s) with a feedback resistor from output to
input that makes it retain its logic level until the switch on its
input yanks it to the other one. The switch needs to be double
throw, connected to both power and ground, the resistor limits gate
output current. In the days of hardwired logic there were almost
always spare gates available.
At the time, gates were cheaper than lines of code, vs the other way
around now. But if an application has lots of switches, software
debounce may be to much of a challenge for some programmers. So there
are libraries, eg Bounce2, that can be used to take care of software
debounce with a not-too-bad learning curve.