¿ªÔÆÌåÓý

Re: CW Offset does NOT work on Raduino_v1.14.1 for BITX40


 

John Backo,

Most of your post seems to be in regard to this excerpt from one of my previous posts: "You either get a 0 or a 1 back when you read a pin with digitalRead(). ?If the voltage at the pin happens to be midrange the result is indeterminate, but the result will be either a 1 or a 0." ? ?Exactly what did I say that is "not quite"?

Regarding the need for an external reference, on page 311 of the ATmega328P datasheet previously referenced, it states: ?"VREF can be selected as either AVCC, internal 1.1V reference, or external AREF pin." ?So no need to tie the AREF pin to anything if you set up the ADC properly. ?At any rate, AREF is only used for the ADC, for an analogRead(). ?When doing a digitalRead() the AREF pin has nothing to do with it. ?In Allards code, A0 is read as a digital pin.

Regarding threshold voltages, figures 33.25 and 33.26 on pages 391,392 of the datasheet show that you are correct, threshold is centered roughly on half of Vcc, or 2.5v in our case. ?(As I read the graphs, for a Vcc of 5v the threshold will be somewhere between 2.1 and 2.7 volts. ?Reading a pin that lies between 2.1v and 2.7v might give a 0 or a 1.) ? That's quite common. ?Also common is to have the input threshold down around 1.2 or 1.5v to be compatible with TTL and low voltage CMOS devices, that's what I was thinking (without looking at the datasheet) when I stated ? ?"I'd expect the threshold on the nano to be somewhere between 1 and 2 volts". ?A 2.7v max on the threshold suggests that reading 1's from the 3.3v Si5351's I2C bus could be a bit dicey, especially if the speed were cranked up some.

Jerry, KE7ER


On Wed, Jun 14, 2017 at 10:12 pm, John Backo wrote:
Not quite, Jerry.

?

Join [email protected] to automatically receive all group messages.