Why is the i2c so much slower? When using the adafruit ads1015 the
entire analog to digital conversion is completely off-loaded from the
nano. All you have to do is read the registers in the ads1015. There is
a small amount of overhead in the i2c communication protocol but it
isn't significant from what I can see.
It isn't a matter of how fast the analog to digital conversion can be
done because you don't have to read the voltage repetitively as fast as
you can. You can't adjust a tuner faster than the nano can read it from
an i2c adc.
There was an earlier thread where it was argued that off-loading
everything you could from the nano to an attached processor provided
more cycles for things the nano *has* to accomplish. I would think that
would surely include doing analog-to-digital conversion.
tim ab0wr
On Sun, 6 May 2018 15:24:42 -0500
"AA9GG" <paul.aa9gg@...> wrote:
I agree the I2C would be a lot slower. You are better off using the
ADC inputs directly and let it "free-run" (I use ADC6 and ADC7).
That way when you need to access the data, it's just a quick check of
the "conversion complete flag" and grab the data from the registers.
On Sun, May 6, 2018 at 2:35 PM, K9HZ <bill@...> wrote:
We must use different libraries. I send out the start conversion
word to the part address¡ and away it goes. Then sometime later,
I poll to see if conversion is ready/ do a read at the same time
(because you get one or the other for free). If the data isn¡¯t
ready, throw away what you got back and go do something else. If
you test every quarter-second, you would always get the data and
the ready bit set TRUE. Then update the display. Again, the time
it takes to do the A/D conversion isn¡¯t important off-board as long
as both power readings are congruent and ready together at some
point. The reads can be executed whenever convenient as not to
interfere with keying, CAT commands, etc. without using interrupts.
With all this said, I support using a couple of caps and doing
something really easy. Maybe it works perfectly.
*Dr. William J. Schmidt - K9HZ J68HZ 8P6HK ZF2HZ PJ4/K9HZ VP5/K9HZ
PJ2/K9HZ*
Owner - Operator
Big Signal Ranch ¨C K9ZC
Staunton, Illinois
Owner ¨C Operator
Villa Grand Piton ¨C J68HZ
Soufriere, St. Lucia W.I.
Rent it: www.VillaGrandPiton.com <>
*Like us on Facebook! **[image: facebook icon]*
<>
Moderator ¨C North American QRO Group at Groups.IO.
email: bill@...
*From:* [email protected] [mailto:[email protected]] *On Behalf Of
*Jerry Gaffke via Groups.Io
*Sent:* Sunday, May 6, 2018 1:54 PM
*To:* [email protected]
*Subject:* Re: [BITX20] SWR
You said
> goes on about its business for a while
That's not correct, unless you add some code to handle i2c transmit
and receive in
interrupt routines. That's some code most of us would prefer to
avoid.
We currently do blocking IO on I2C reads and writes.
Just clocking all those I2C bits around at 100khz takes
considerably more time than doing the embedded ADC reads.
I'm assuming we are mostly concerned about delaying other
operations, such as sensing the keyer.
If all you are worried about is how synchronous the two samples are,
then yes the 2 channel ADC chip on the I2C bus would be better,
even if we stick with the blocking code on i2c access.
Me, I'll try out a couple big caps first.
Jerry
On Sun, May 6, 2018 at 10:50 am, K9HZ wrote:
¡°Actually, reading values from an A/D over the I2C bus will take
more time than just reading from the Nano's embedded ADC. ¡°
Yes, but in this case, taking more time is ok¡ because the Arduino
commands the A/D to perform its function, goes on about its
business for a while¡the digitization happens independently of the
Arduino processing, and the data will be waiting for you want to go
get it. There is no real demand on when the data needs to be
available, it¡¯s more a demand of being synchronized (so it¡¯s
statistically better to get the average of 5 good numbers rather
than 50 marginal numbers). And (for me the best part) you really
can employ an A/D with synchronized S/H for good coordinated
forward and reverse power.
I really don¡¯t think anyone here (other than me) will ever do it
this way. Just indicating reverse power by some cheap method is
probably fine for tuning an antenna.
<>
Virus-free. www.avg.com
<>
<#m_7015192241025951502_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>