[minima] Re: Update on BFO Adjustment and Software on Mega2560

  • From: Mark G0MGX <mark.g0mgx@xxxxxxxxx>
  • To: minima@xxxxxxxxxxxxx
  • Date: Wed, 22 Jan 2014 13:46:29 +0000

Hi Jon

This is just a suggestion as I haven't tried it mysef!!

The A3 pin is being used in the software as the analogue equivalent of a digital input (perhaps because we ran out of Digital IO pins and don't know we can use analogue inputs as digital inputs also?)

The code that reads the input looks for the value to be less than 300 to return a 1 (button pressed) and >= 300 for a 0 (button not pressed).

As there may be noise on the connection to the A3 pin and it's not held high or low the value could return just about anything when open circuit - the A to D converter will return a value in the range 0 and 1023 by default. It is even more likely to return junk with an open ended wire attached!

You could confirm this with a simple Sketch to return the AtoD value from A3 and print it to the LCD every second or so and see what the numbers are....

However, in the world of Arduino you can use Analogue pins for Digital inputs also, so please try adding this to setup() routine:

pinMode(FBUTTON, INPUT);
digitalWrite(FBUTTON, HIGH); // enable internal pull up

then change the btndown routine to be:

int btnDown(){
  if (digitalRead(FBUTTON) == LOW)
    return 1;
  else
    return 0;
}



please report back to the group....

I suspect we will soon need a means to control software changes if we decide to implement this for all.

Mark
G0MGX

On 22/01/2014 12:52, Jon Lee G4TSN wrote:
Hi All
I have the software running on both the Mega and a UNO with a si570 and the tuning etc works but both seem to have issues with the function button connected to A3 ?
Its appears intermitant almost like a timing issue
I will play some more
73,
Jon G4TSN

    ----- Original Message -----
    *From:* Ashhar Farhan <mailto:farhanbox@xxxxxxxxx>
    *To:* minima@xxxxxxxxxxxxx <mailto:minima@xxxxxxxxxxxxx>
    *Sent:* Wednesday, January 22, 2014 9:37 AM
    *Subject:* [minima] Re: Update on BFO Adjustment and Software on
    Mega2560

    mark,

    when you do the software changes, do remember to spend a couple of
    minutes to get hang of git and fork it. that way, we can maintain
    a branch for those who use the mega board too.

    - f


    On Wed, Jan 22, 2014 at 1:58 PM, Mark G0MGX <mark.g0mgx@xxxxxxxxx
    <mailto:mark.g0mgx@xxxxxxxxx>> wrote:

        Morning Team

        Update from me this morning:

        http://g0mgx.blogspot.co.uk/2014/01/minima-carrier-adjustment.html

        I have the software running for the first time but to add some
        confusion into the mix have used an Arduino Mega2560 board.

        There are also some mutterings from me on the carrier
        adjustment inside the crystal filter.

        I will take a look at the Wiki later and try and upload some
        stuff there also.

        Mark
        G0MGX



Other related posts: