Topics

The Digital 49er and the Experimenters Board

N5IB
 

It's been a rainy day here in Baton Rouge (not so bad as others around LA  though-- less than 2" rain here so far) SOoooo... what better than heat up a soldering iron.

I set out to begin wiring up the VFO part of the Digital 49er, doing this version "as written" in the QST article.

Early troubles involved the user libraries - one for the rotary encoder and one for the LCD display. I fought that for an hour or so before remembering that Arduino is (bless its little Italian heart) case sensitive. The library was referenced in the sketch as "rotary.h" but was distributed on the web as "Rotary.h"  OK  solved that one and the sketch compiled.

Next came the serial port issue with my new Windows-10 laptop and a NANO using the 340 chip... turns out I just had to wait (took nearly a minute) before it recognized the port as "USB-Serial CH340 (COM9)

With the sketch now compiling OK and a serial port recognized, it uploaded normally. BTW I'm using Arduino IDE 1.6.7 on this Windows-10 laptop.

Had the LCD and the rotary encoder hooked up (no DDS yet) Powered up the NANO ---- nothing on the LCD no splash screen. Turned the contrast pot full both ways - still nothing. But wait - I'd bought a pack of five of the LCDs. Tried another GOOD! splash screen. Rotary encoder worked and the frequency display changed. Tried the next three LCDs - all good - went back to the first - zilch - 20% chance of grabbing the bad one first - hi

So the status right now is the LCD works, the rotary encoder works, but the push button switch on the encoder does not. It;s supposed to change the frequency step. (before you ask - yep - tried the other four encoders) even tried a jumper wire on D4 to ground to simulate the switch, No Joy. Checked with a voltmeter and found the D4 pin is not pulled up. There was a spot on the encoder's carrier board for a pullup 10 K SMT resistor (it was not installed) Added on to the board - still not working. I will look carefully at the sketch now - though software debugging is note my forte.

Will probably leave the PB switch issue on the back burner if it isn't rsolved swiftly, and move on to hook up the DDS control lines.

More to come... the rain is supposed to last 'till Saturday...

73,
Jim, N5IB



 

 

N5IB
 


Status update.... That was a software problem even I can debug...

The sketch as distributed in QST-in-Depth calls out pin 7 as the rotary encoder's pushbutton switch.
Changed it to pin 4 as shown on the schematic and all is well.

There may still be an issue about the internal pullups. It was necessary to install the 10K pullup on the encoder, otherwise turning the encoder caused junk pulses on the switch input, making the step size change wildly. With 10 K pullups on both rotary encoder lines and the PB switch it is very stable. And have not added any bypass capacitors across those contacts as suggested in the documentation.

Will hook up the DDS tomorrow and report.







 

 

K5ESS
 

Jim,

You may trying the following for the push button problem:

After the line

pinMode(ROTARYSWITCHPIN, INPUT);

 

Line 118 I believe

Add

  digitalWrite(ROTARYSWITCHPIN, INPUT_PULLUP);

 

This might fix the problem.

Mike K5ESS

 

From: PHSNA@... [mailto:PHSNA@...]
Sent: Thursday, March 10, 2016 4:26 PM
To: PHSNA@...
Subject: RE: [PHSNA] The Digital 49er and the Experimenters Board

 

 

It's been a rainy day here in Baton Rouge (not so bad as others around LA  though-- less than 2" rain here so far) SOoooo... what better than heat up a soldering iron.

I set out to begin wiring up the VFO part of the Digital 49er, doing this version "as written" in the QST article.

Early troubles involved the user libraries - one for the rotary encoder and one for the LCD display. I fought that for an hour or so before remembering that Arduino is (bless its little Italian heart) case sensitive. The library was referenced in the sketch as "rotary.h" but was distributed on the web as "Rotary.h"  OK  solved that one and the sketch compiled.

Next came the serial port issue with my new Windows-10 laptop and a NANO using the 340 chip... turns out I just had to wait (took nearly a minute) before it recognized the port as "USB-Serial CH340 (COM9)

With the sketch now compiling OK and a seri al port recognized, it uploaded normally. BTW I'm using Arduino IDE 1.6.7 on this Windows-10 laptop.

Had the LCD and the rotary encoder hooked up (no DDS yet) Powered up the NANO ---- nothing on the LCD no splash screen. Turned the contrast pot full both ways - still nothing. But wait - I'd bought a pack of five of the LCDs. Tried another GOOD! splash screen. Rotary encoder worked and the frequency display changed. Tried the next three LCDs - all good - went back to the first - zilch - 20% chance of grabbing the bad one first - hi

So the status right now is the LCD works, the rotary encoder works, but the push button switch on the encoder does not. It;s supposed to change the frequency step. (before you ask - yep - tried the other four encoders) even tried a jumper wire on D4 to ground to simulate the switch, No Joy. Checked with a voltmeter and found the D4 pin is not pulled up. There was a spot on the encoder's carrier board for a pullup 10 K SMT resistor (it was not installed) Added on to the board - still not working. I will look carefully at the sketch now - though software debugging is note my forte.

Will probably leave the PB switch issue on the back burner if it isn't rsolved swiftly, and move on to hook up the DDS control lines.

More to come... the rain is supposed to last 'till Saturday...

73,
Jim, N5IB

 

 

 

N5IB
 


Thanks, Mike. That did the trick... actually all I had to do was change the line:
pinMode(ROTARYSWITCHPIN, INPUT);
to
pinMode(ROTARYSWITCHPIN, INPUT_PULLUP);

Now works fine with the unmodified encoder

I need to look more closely at the rotary library and see if it sets the pullups on the other two pins.

Jim, N5IB


---In PHSNA@..., <k5ess.nothdurft@...> wrote :

Jim,

You may trying the following for the push button problem:

After the line

pinMode(ROTARYSWITCHPIN, INPUT);

 

Line 118 I believe

Add

  digitalWrite(ROTARYSWITCHPIN, INPUT_PULLUP);

 

This might fix the problem.

Mike K5ESS


 

 

 

 

N5IB
 




---In PHSNA@..., <n5ib@...> wrote :

Added the Type-2 DDS to the system this morning and everything works as advertised.

Next up is to build one up using Mike's sketch, so won't have to cut traces on the Experimenter board.

Jim, N5IB



 

 

 

 

K5ESS
 

I get the feeling that this QST article was not quite ready for prime time.  Here’s a few things I’ve found.

The RXTXPin is defined and initially set to LOW but never read so it has no influence on the program.  This pin (D12) is shown on the schematic as going to Q2 of the 49er.  It appears that the 49er  is full QSK and that the key serves as the TR switch.  In my view, when this line is LOW (receive mode) the actual frequency programmed into the DDS would be offset from the displayed frequency by some predetermined amount (±600 to 900 Hz or so)  This is what I thought RIT (Receiver Incremental Tuning) was. 

 

Then there’s the  RITPIN.  It’s defined as 8 but this is also the pin defined for the DDS W_CLK line.  I redefined it as 5.  Nothing in the schematics show the RITPIN connection.  With this pin ungrounded (open) the rotary encoder did not function, (no frequency change).  When I grounded it (after redefining it to 5 and recompiling) the encoder works as expected.  Still looking into how RITPIN and RXTXPin are supposed to work.

 

The license class logic is messed up.  Never get a TECH displayed when tuned to the technician portion of the band.  I re-sequenced some IF statements and got it to partially work but it’s still not right.

 

Added several INPUT-PULLUPs to pinMode statements.

 

Got a ton of “warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]” warnings when I compiled the sketch the first time.  Fixed most of these by changing static char * to static char const *.  Still have two of these errors to be fixed.  Don’t know if they actually keep the sketch from working as it should.

 

That’s my findings so far.

 

Mike K5ESS

 

 

From: PHSNA@... [mailto:PHSNA@...]
Sent: Thursday, March 10, 2016 9:08 PM
To: PHSNA@...
Subject: RE: [PHSNA] The Digital 49er and the Experimenters Board

 

 

 

Thanks, Mike. That did the trick... actually all I had to do was change the line:
pinMode(ROTARYSWITCHPIN, INPUT);
to
pinMode(ROTARYSWITCHPIN, INPUT_PULLUP);

Now works fine with the unmodified encoder

I need to look more closely at the rotary library and see if it sets the pullups on the other two pins.

Jim, N5IB


---In PHSNA@..., <k5ess.nothdurft@...> wrote :

Jim,

You may trying the following for the push button problem:

After the line

pinMode(ROTARYSWITCHPIN, INPUT);

 

Line 118 I believe

Add

  digitalWrite(ROTARYSWITCHPIN, INPUT_PULLUP);

 

This might fix the problem.

Mike K5ESS

 

 

 

 

 

K5ESS
 

Jim,

I missed your post just before I sent mine.  Appears you didn’t see some of problems that I encountered.

Mike K5ESS

 

From: PHSNA@... [mailto:PHSNA@...]
Sent: Friday, March 11, 2016 5:00 PM
To: PHSNA@...
Subject: RE: [PHSNA] The Digital 49er and the Experimenters Board

 

 

 



---In PHSNA@..., <n5ib@...> wrote :

Added the Type-2 DDS to the system this morning and everything works as advertised.

Next up is to build one up using Mike's sketch, so won't have to cut traces on the Experimenter board.

Jim, N5IB

 

 

 

 

 

N5IB
 

Hi Mike,

I didn't pay any attention to the RIT feature. Just wanted to verify that the DDS was being commanded, the output frequency was close enough,  and that the frequency steps were what they were supposed to be.

I also noted that the Tech band limits never showed up. Also tried to change the upper and lower limits to 1 MHz and 30 MHz, but there some logic that must be getting in the way. It still was limited to the environs of 40 meters - but seemed to roll around when you reached the limit and jump to the other extreme. I think the License class callout and the band limit logic will end up like a game of Twenty Questions played out ig IF..THEN..ELSE  hi

Did have to fiddle with the pin assignment for the encoder PB switch. Schematic had pin 4, sketch assigned pin 7. I set it to 4.

I have nothing connected to any other pins - no T/R or RIT lines - and incrementing and step size changing are reliable.

I'm not really planning to pair it with a 49er, just wanted to do up a VFO. So at this point I'm satisfied with the proof of concept and the particular hardware chosen. I'll work on prettying up the features in due time.

Wish I'd put a couple of more pads on the Experimenters Board with +5 V and GND  for convenience in powering auxilliary stuff.

Jim, N5IB



---In PHSNA@..., <k5ess.nothdurft@...> wrote :

Jim,

I missed your post just before I sent mine.  Appears you didn’t see some of problems that I encountered.

Mike K5ESS


 

 

 

 

 

K5ESS
 

Jim,

Yes I changed the pin assignment for the encoder PB switch as you discovered.  I’ll concentrate my immediate efforts to getting the sketches I posted working with the I2C LCDs rather than fiddling around with the 49er code.

Mike K5ESS

 

From: PHSNA@... [mailto:PHSNA@...]
Sent: Friday, March 11, 2016 7:24 PM
To: PHSNA@...
Subject: RE: [PHSNA] The Digital 49er and the Experimenters Board

 

 

Hi Mike,

I didn't pay any attention to the RIT feature. Just wanted to verify that the DDS was being commanded, the output frequency was close enough,  and that the frequency steps were what they were supposed to be.


I also noted that the Tech band limits never showed up. Also tried to change the upper and lower limits to 1 MHz and 30 MHz, but there some logic that must be getting in the way. It still was limited to the environs of 40 meters - but seemed to roll around when you reached the limit and jump to the other extreme. I think the License class callout and the band limit logic will end up like a game of Twenty Questions played out ig IF..THEN..ELSE  hi

Did have to fiddle with the pin assignment for the encoder PB switch. Schematic had pin 4, sketch assigned pin 7. I set it to 4.

I have nothing connected to any other pins - no T/R or RIT lines - and incrementing and step size changing are reliable.

I'm not really planning to pair it with a 49er, just wanted to do up a VFO. So at this point I'm satisfied with the proof of concept and the particular hardware chosen. I'll work on prettying up the features in due time.

Wish I'd put a couple of more pads on the Experimenters Board with +5 V and GND  for convenience in powering auxilliary stuff.

Jim, N5IB



---In PHSNA@..., <k5ess.nothdurft@...> wrote :

Jim,

I missed your post just before I sent mine.  Appears you didn’t see some of problems that I encountered.

Mike K5ESS

 

 

 

 

 

 

K5ESS
 

Just uploaded the connection diagram and sketch for DDC VFO using the Experimenters Board without any modifications.  You can set upper and lower frequency extents in the sketch code.  There are no software limits but be mindful of DDS limitations.  Remember clock freq for AD9850 is normally 125 MHz and for AD9851 it’s 180 MHz. (30 MHz X 6) .  Also remember to set the ForceFreq variable to 1 the first time you load the sketch and immediately change that variable to 0, recompile and reload the sketch in order to invoke the EEPROM and not make excessive writes to the EEPROM since it has a limited number of writes before it gets unreliable (~100,000 writes).  Please let me know of any problems or recommended enhancements.

Hope the PHSNA Group finds this useful.

Mike K5ESS

 

From: PHSNA@... [mailto:PHSNA@...]
Sent: Friday, March 11, 2016 9:15 PM
To: PHSNA@...
Subject: RE: [PHSNA] The Digital 49er and the Experimenters Board

 

 

Jim,

Yes I changed the pin assignment for the encoder PB switch as you discovered.  I’ll concentrate my immediate efforts to getting the sketches I posted working with the I2C LCDs rather than fiddling around with the 49er code.

Mike K5ESS

 

From: PHSNA@... [mailto:PHSNA@...]
Sent: Friday, March 11, 2016 7:24 PM
To: PHSNA@...
Subject: RE: [PHSNA] The Digital 49er and the Experimenters Board

 

 

Hi Mike,

I didn't pay any attention to the RIT feature. Just wanted to verify that the DDS was being commanded, the output frequency was close enough,  and that the frequency steps were what they were supposed to be.


I also noted that the Tech band limits never showed up. Also tried to change the upper and lower limits to 1 MHz and 30 MHz, but there some logic that must be getting in the way. It still was limited to the environs of 40 meters - but seemed to roll around when you reached the limit and jump to the other extreme. I think the License class callout and the band limit logic will end up like a game of Twenty Questions played out ig IF..THEN..ELSE  hi

Did have to fiddle with the pin assignment for the encoder PB switch. Schematic had pin 4, sketch assigned pin 7. I set it to 4.

I have nothing connected to any other pins - no T/R or RIT lines - and incrementing and step size changing are reliable.

I'm not really planning to pair it with a 49er, just wanted to do up a VFO. So at this point I'm satisfied with the proof of concept and the particular hardware chosen. I'll work on prettying up the features in due time.

Wish I'd put a couple of more pads on the Experimenters Board with +5 V and GND  for convenience in powering auxilliary stuff.

Jim, N5IB



---In PHSNA@..., <k5ess.nothdurft@...> wrote :

Jim,

I missed your post just before I sent mine.  Appears you didn’t see some of problems that I encountered.

Mike K5ESS

 

 

 

 

 

 

N5IB
 

I played around with the VFO sketch a bit more today and managed to correct a couple of things... remember this is the sketch that goes with the QST schematic...  I think I noted as a comment everywhere I fiddled with the code...

Look in the folder "Digital 49er - N5IB Experiments"

-- My frequency was increasing for counterclockwise, and decreasing for clockwise - reversed the sense in software

-- Made the tuning increments 10, 50, 100 ... instead of 10, 20, 100 Hz

-- The Tech band warning never showed up - fixed that

-- Made the Tech band warning display as "Tech/Gen"

-- Added a space in front of the frequency units for a clearer display

-- Changed mHz to MHz in the display

-- Made the Splash screen show a version number with my callsign


Jim, N5IB






 

 

 

K5ESS
 

Jim,

Looks like you’re making some progress in fixing the shortcomings of the published sketch.  As an aside, if I read the code correctly it’s shortchanging the techs by 75 KHz.  The ARRL chart for Amateur Band allocations on 40 meters gives the techs from 7.025 to 7.125 MHz.  If I read the sketch code correctly they are only allocating them 25 KHz from 7.100 to 7.125 MHz.  I also thought the millihertz (mHz) should be changed to Megahertz (MHz) ;-)

 

Mike K5ESS

From: PHSNA@... [mailto:PHSNA@...]
Sent: Saturday, March 12, 2016 5:45 PM
To: PHSNA@...
Subject: RE: [PHSNA] The Digital 49er and the Experimenters Board

 

 

I played around with the VFO sketch a bit more today and managed to correct a couple of things... remember this is the sketch that goes with the QST schematic...  I think I noted as a comment everywhere I fiddled with the code...

Look in the folder "Digital 49er - N5IB Experiments"

-- My frequency was increasing for counterclockwise, and decreasing for clockwise - reversed the sense in software

-- Made the tuning increments 10, 50, 100 ... instead of 10, 20, 100 Hz

-- The Tech band warning never showed up - fixed that

-- Made the Tech band warning display as "Tech/Gen"

-- Added a space in front of the frequency units for a clearer display

-- Changed mHz to MHz in the display

-- Made the Splash screen show a version number with my callsign


Jim, N5IB





 

 

 

N5IB
 

Mike is quite correct. And there's also an Advanced Class slice of 40 meters.
Revised sketch has been posted.

Jim, N5IB


---In PHSNA@..., <k5ess.nothdurft@...> wrote :

Jim,

As an aside, if I read the code correctly it’s shortchanging the techs by 75 KHz.  The ARRL chart for Amateur Band allocations on 40 meters gives the techs from 7.025 to 7.125 MHz.