Help - UKHAS "Linking an Arduino to a Radiometrix NTX2B Transmitter” guide Test Schedule Part 2 not the producing the correct characters in fldigi

79 views
Skip to first unread message

Ian Wilde

unread,
Jul 2, 2020, 6:05:51 AM7/2/20
to UKHAS

Can anyone help with this problem so I can move forward with building an Arduino/NTX2B tracker?:-

 

The UKHAS “Linking an Arduino to a Radiometrix NTX2B Transmitter” guide  Test Schedule, Part 1 Guide worked, however Part 2 is not the producing the correct characters. I have re-checked the Arduino code several times for typos & it was, as the UKHAS Guide guide strongly recommends, hand typed, not using Copy & Paste. A copy is attached. This is what I am getting:-

 

 ``p|`p~s|@````p|`p~s|@```Cx`x```p|`p~s|@````p|`p~s|@```Cx`x```p|`p~s|@````p|`p~s|@```Cx`x`s|`p~s|@``p|`p|`p~s  I think the sequence starts.. ``p`p|`p~s|@````p|`p~s|@```Cx`x` 

 

 The dl-fldigi settings are as on the guide (see attached photo) & changing them doesn't help. Looking at https://en.wikipedia.org/wiki/ASCII  doesn't assist either - this is all new territory to me.

 

The  .ino file is attached & code that was uploaded to the Arduino Pro are copied below this post. The Arduino output is to Pin 13, not 10 as per the guide, as that must be a typo as it only produces a single line in the waterfall.

 

The fldigi RTTY Custom settings are all correct with Baud rate5.0 /Parity nil/Stop bits 2/7 bits per character. the Carrier frq shift is set to 685Hz due to the resistors used & the board is an Arduino Pro 3.3V/8MHz.

 

The output is from Pin 13, not 10 as in the circuit diagram & description as this produces only a single line in the Waterfall. I assume that this is a legacy issue "typo" in the Guide. The board LED flashes nicely & the AR9000 & Airspy audio sounds OK with USB selected on both, although I am only using one of them, not both together. See attached photos & .ino file.

 

Can anyone help please?

 

Code as uploaded to Arduino Pro:-

 

/* NTX2 Radio Test Part 2

 

  Transmits data via RTTY with a checksum.

 

  Created 2012 by MOUPU as part of a UKHAS Guide on Linking NTX2 Modules to Arduino.

  RTTY code from Rob Harrison Icarus Project.

  http://ukhas.org.uk

*/

 

#define RADIOPIN 13

 

#include <string.h>

#include <util/crc16.h>

 

char datastring[80];

 

void setup()

{

 pinMode(RADIOPIN,OUTPUT);   // sets the digital pin as output

 

}

 

void loop()

{

  sprintf(datastring,"RTTY TEST BEACON RTTY TEST BEACON"); // Puts the text in the datastring

  unsigned int CHECKSUM = gps_CRC16_checksum(datastring);  //Calculates the checksum for this datastring

  char checksum_str[6];

  sprintf(checksum_str, "*%04X\n", CHECKSUM);

  strcat(datastring,checksum_str);

 

  rtty_txstring (datastring);

  delay(2000);

}

 

 

void rtty_txstring (char * string)

{

 

  /* Simple function to send a char at a time to

        ** rtty_txbyte function   

        ** NB Each char is one byte (8 Bits)

   */

 

   char c;

 

   c = *string++;

 

   while ( c != '\0')

   {

    rtty_txbyte (c);

    c = *string++;

   }

}

 

void rtty_txbyte (char c)

{

  /* Simple function to send each bit of a char to

       ** rtty_txbit function. 

       ** NB The bits are sent Least Sgnificant Bit first

       **

       ** ALL chars should be preceded with a 0 and

       ** proceded with a 1. 0 = Start bit; 1 = Stop bit

       **

   */

 

   int i;

 

   rtty_txbit (0); // Start bit

 

   // Send bits for char LSB first

 

   for (i=0;i<7;i++) // Change this here 7 or 8 for ASCII-7 / ASCII-8

   {

    if (c & 1) rtty_txbit(1);

 

    else rtty_txbit(0);

 

    c = c >> 1;

   }

 

   rtty_txbit (1);  // Stop bit

   rtty_txbit (1); // Stop bit

}

 

void rtty_txbit  (int bit)

{

  if (bit)

  {

    // high

    digitalWrite(RADIOPIN, HIGH);

  }

  else

  {

    // Low

    digitalWrite(RADIOPIN, LOW);

  }

 

  //                delayMicrosconds(3370); //  300 baud

  delayMicroseconds(10000);  // For 50 Baud uncomment this and the line below.

  delayMicroseconds (10150); // You can't do 20150 it just doesn't work as the

                             // Largest value that will produce an accurate delay is 16383

                             // See : http://arduino.cc/en/Reference/DelayMicroseconds

 

}

   uint16_t gps_CRC16_checksum (char *string)

{

  size_t i;

  uint16_t crc;

  uint8_t c;

 

  crc = 0xFFFF;

 

  // Calculate checksum ignoring first two $s

  for (i = 2; i < strlen(string); i++)

  {

    c = string[i];

    crc = _crc_xmodem_update (crc, c);

  }

 

  return crc;

  }

 

                          

 

RTTY Test Part 2_Incorrect Characters_MSI Laptop.jpg
Arduino_Breadboard_NTX2B_Initial_Test_Setup.jpg
NtX2_Radio_Test_Part_2.zip

Nick McCloud

unread,
Jul 2, 2020, 6:19:54 AM7/2/20
to UKHAS
The copy and paste message is about you understanding the code and not blindly copy & pasting with no understanding of what it does - not a mandatory retype.

So, just in case there is some really bizarre typo that's got through, I'd copy & paste.

The schematic (as such) is marked GPIO - that's General Purpose Input Output - not GP-ten. There are 10 sorts of people, those that understand binary and those that don't ;-)

Ian R Wilde

unread,
Jul 2, 2020, 6:38:05 AM7/2/20
to uk...@googlegroups.com

Hi Nick,

 

Thanks for the prompt response. I will copy & paste, upload  & re-test!.

 

Yes, you guessed...I am one of those that do not yet understand Binary do a sufficient extent. We will get there eventually....we always do!

 

Cheers

 

Ian

--
You received this message because you are subscribed to the Google Groups "UKHAS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ukhas+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ukhas/2ec292fe-7979-4f75-90ee-9bee2e0f6b6co%40googlegroups.com.


Virus-free. www.avg.com

Ian Wilde

unread,
Jul 2, 2020, 7:35:16 AM7/2/20
to UKHAS
I have just done what Nick suggested, that is copy & paste the code from the UKHAS guide. The result is the same. I get the same repeating series of characters as per my original post. 

Instead of  RTTY TEST BEACON RTTY TEST BEACON This is what fldigi is printing:-
``p|`p~s|@````p|`p~s|@```Cx`x```p|`p~s|@````p|`p~s|@```Cx`x```p|`p~s|@````p|`p~s|@```Cx`x`s|`p~s|@``p|`p|`p~s............etc.   

 fldigi RTTY settings are correct as per earlier screenshot.

Can anyone sort me out with this please?.....Here is what I copied & pasted:-
/*  NTX2 Radio Test Part 2
 
    Transmits data via RTTY with a checksum.
 
    Created 2012 by M0UPU as part of a UKHAS Guide on linking NTX2 Modules to Arduino.
    RTTY code from Rob Harrison Icarus Project. 
    http://ukhas.org.uk
*/ 
 
#define RADIOPIN 13
 
#include <string.h>
#include <util/crc16.h>
 
char datastring[80];
 
void setup() {                
  pinMode(RADIOPIN,OUTPUT);
}
 
void loop() {
 
 
  sprintf(datastring,"RTTY TEST BEACON RTTY TEST BEACON"); // Puts the text in the datastring
  unsigned int CHECKSUM = gps_CRC16_checksum(datastring);  // Calculates the checksum for this datastring
  char checksum_str[6];
  sprintf(checksum_str, "*%04X\n", CHECKSUM);
  strcat(datastring,checksum_str);
 
  rtty_txstring (datastring);
  delay(2000);
}
 
 
void rtty_txstring (char * string)
{
 
  /* Simple function to sent a char at a time to 
   	** rtty_txbyte function. 
   	** NB Each char is one byte (8 Bits)
   	*/
 
  char c;
 
  c = *string++;
 
  while ( c != '\0')
  {
    rtty_txbyte (c);
    c = *string++;
  }
}
 
 
void rtty_txbyte (char c)
{
  /* Simple function to sent each bit of a char to 
   	** rtty_txbit function. 
   	** NB The bits are sent Least Significant Bit first
   	**
   	** All chars should be preceded with a 0 and 
   	** proceded with a 1. 0 = Start bit; 1 = Stop bit
   	**
   	*/
 
  int i;
 
  rtty_txbit (0); // Start bit
 
  // Send bits for for char LSB first	
 
  for (i=0;i<7;i++) // Change this here 7 or 8 for ASCII-7 / ASCII-8
  {
    if (c & 1) rtty_txbit(1); 
 
    else rtty_txbit(0);	
 
    c = c >> 1;
 
  }
 
  rtty_txbit (1); // Stop bit
  rtty_txbit (1); // Stop bit
}
 
void rtty_txbit (int bit)
{
  if (bit)
  {
    // high
    digitalWrite(RADIOPIN, HIGH);
  }
  else
  {
    // low
    digitalWrite(RADIOPIN, LOW);
 
  }
 
  //                  delayMicroseconds(3370); // 300 baud
  delayMicroseconds(10000); // For 50 Baud uncomment this and the line below. 
  delayMicroseconds(10150); // You can't do 20150 it just doesn't work as the
                            // largest value that will produce an accurate delay is 16383
                            // See : http://arduino.cc/en/Reference/DelayMicroseconds
 
}
 
uint16_t gps_CRC16_checksum (char *string)
{
  size_t i;
  uint16_t crc;
  uint8_t c;
 
  crc = 0xFFFF;
 
  // Calculate checksum ignoring the first two $s

Oliver de Peyer

unread,
Jul 2, 2020, 7:51:44 AM7/2/20
to uk...@googlegroups.com
Are you sure you are receiving on the right side band?
Ol

M0LVR

Mark Gledhill

unread,
Jul 2, 2020, 8:03:00 AM7/2/20
to uk...@googlegroups.com
Not wishing to complicate things but have you considered sending RTTY using a LoRa module using FSK? Not only are the modules a lot cheaper, it also leaves the option available to send LoRa as well.

A few examples of the code required can be found can be found on github. This one for example works pretty much out of the box:


Mark

Sent from my iPhone

On Jul 2, 2020, at 12:35 PM, Ian Wilde <ianr...@hotmail.com> wrote:


--
You received this message because you are subscribed to the Google Groups "UKHAS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ukhas+un...@googlegroups.com.

Dave B

unread,
Jul 2, 2020, 8:41:05 AM7/2/20
to uk...@googlegroups.com

Ian.

Note too, that you need to set dlFldigi's RTTY parameters correctly to match the format you are sending.

Number of data bits, stop bits, baud rate (speed) and the frequency shift.

Note too, that you'll need a SSB capable radio in USB mode, this won't work with a FM handheld!

(But something like a FunCube or RTL dongle and suitable SDR software will suffice too, but the fun bit then, especially with Windows10, is piping the recovered audio into dlFldigi.)

Take one step at a time.

73.

Dave G8KBV.

To view this discussion on the web visit https://groups.google.com/d/msgid/ukhas/DB7PR06MB5929AB303E2F29309DB1A7F2A86D0%40DB7PR06MB5929.eurprd06.prod.outlook.com.
-- 
Created on and sent from a Unix like PC running and using free and open source software:

David Akerman

unread,
Jul 2, 2020, 8:44:43 AM7/2/20
to UKHAS
All true, but he's done all that.  He's using a radio scanner in USB mode and he also has an SDR set up for USB mode.

Usually at the point the next thing to try is to click the Rv (Reverse) button on dl-fldigi (bottom of the screen somewhere) and see if the decoding magically starts to work.

The other possibility is that the baud rate is wrong because the wrong processor speed got selected in the Arduino IDE.

Dave

Ian R Wilde

unread,
Jul 2, 2020, 8:45:11 AM7/2/20
to uk...@googlegroups.com
Hi Oliver,

AR8000 set to USB. Similar when trying with the SDR.

The audio is coming warbling through loud & clear on the AR8000 & the waterfall signals look (to my inexperienced eye) normal.

Further thoughts or tests/checks I should do?

The bandwidth is about 685Hz. R1 & R2 are 4K5 & R3 is two 68K in // giving 34K. For these, I calculated, using the methodology in the guide, that the shift, using a 3,3V VCC on the Arduino Pro, should be around 425Hz, so (especially being inexperienced with most of this) can't understand why the actually shift is 685khz (see screenshot -reattached)
--
You received this message because you are subscribed to the Google Groups "UKHAS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ukhas+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ukhas/5BB2630E-AE28-4A25-AE2E-27F18DDBFFC4%40googlemail.com.


--
This email has been checked for viruses by AVG.
https://www.avg.com
RTTY Test Part 2_Incorrect Characters_MSI Laptop.jpg

Ian R Wilde

unread,
Jul 2, 2020, 8:46:31 AM7/2/20
to uk...@googlegroups.com

Hi Mark,

 

Thanks & I will review that, however am determined to know what the problem here is first - determined that is until it becomes too difficult - hopefully not!.

 

Many thanks

 

Ian

 

From: uk...@googlegroups.com [mailto:uk...@googlegroups.com] On Behalf Of Mark Gledhill


Sent: 02 July 2020 13:03
To: uk...@googlegroups.com

David Akerman

unread,
Jul 2, 2020, 8:47:22 AM7/2/20
to UKHAS
It's definitely a 3.3V Arduino not 5V?  Because 3.3V --> 5V will increase the shift to about 645Hz.

Dave B

unread,
Jul 2, 2020, 8:56:16 AM7/2/20
to uk...@googlegroups.com

The Rv button can get confusing.  Not sure about dlFldigi, but in Fldigi, you have to be very careful about the interaction between the Rv button, and the USB/LSB setting,  Best to stick with USB on the radio, and keep Rv OFF.

I to have fallen foul of Arduino CPU speed settings!  It's not obvious at times.

73.

    Dave G8KBV

Dave B

unread,
Jul 2, 2020, 9:06:37 AM7/2/20
to uk...@googlegroups.com
You can measure the shift, by reading the audio frequency in the box
under the waterfall of the two tones, and subtracting one from the
other, as you position the centre white cursor line on each tone in
turn, of course, while your doing that, decoding wont work, even if
everything else is good.

Screenshots don't come through on the list mail, at least not to me.

If the shift is actually 685kHz (Kilo Hertz) no wonder it's not working!
  If you mean Hz, then that figure is what you need to enter into
dlFldigi's RTTY settings.  Keep the baud rate slow at first too, start
at 50bd, regardless of shift.

The two red lines (and two yellow lines of the cursor) should co-inside
with the two tones when positioned over them.

If you have an oscilloscope, use it to measure the bit width of the
serial stream you are creating.  The smallest bit width == what you
should expect for the baud rate you have set.  If it's way off, then as
was suggested, check the Arduino IDE's setting for the CPU clock speed.

Regards.

    Dave G8KBV.



On 02/07/2020 13:45, Ian R Wilde wrote:
> Hi Oliver,
>
> AR8000 set to USB. Similar when trying with the SDR.
>
> The audio is coming warbling through loud & clear on the AR8000 & the waterfall signals look (to my inexperienced eye) normal.
>
> Further thoughts or tests/checks I should do?
>
> The bandwidth is about 685Hz. R1 & R2 are 4K5 & R3 is two 68K in // giving 34K. For these, I calculated, using the methodology in the guide, that the shift, using a 3,3V VCC on the Arduino Pro, should be around 425Hz, so (especially being inexperienced with most of this) can't understand why the actually shift is 685khz (see screenshot -reattached)
>
> -----Original Message-----
> From: 'Oliver de Peyer' via UKHAS [mailto:uk...@googlegroups.com]
> Sent: 02 July 2020 12:52
> To: uk...@googlegroups.com
> Subject: Re: [UKHAS] Re: Help - UKHAS "Linking an Arduino to a Radiometrix NTX2B Transmitter” guide Test Schedule Part 2 not the producing the correct characters in fldigi
>
> Are you sure you are receiving on the right side band?
> Ol
>
> M0LVR
>
--

Ian R Wilde

unread,
Jul 2, 2020, 9:09:08 AM7/2/20
to uk...@googlegroups.com

Hi David,

 

Thanks - well spotted I should have worked that out myself - you are correct. I have just put a multi-meter across VCC & ground on the Arduino Pro when plugged into a USB port supply. it measures 5.3V

 

However, I did order (I am 99% certain) a 3.3V & 8Mhz Arduino Pro & on the actual board both these markers have been inked in, leaving the 5V,16MHz & 20MHz unmarked. My understanding was that the 3.3V board has an internal V reg, so I used 3.3V for the R calculations. So this board is marked 3.3V yet VCC is 5.3V - can you help me on that one?

 

The waterfall shift is 685Hz, so is it that this is the reason why the characters are incorrect & that if I change the resistors to bring it down to 425Hz, it should work?

 

Part of the puzzle solved at least - thanks.

 

Ian

David Akerman

unread,
Jul 2, 2020, 9:09:37 AM7/2/20
to UKHAS
Dave, you're missing a screenshot he linked to his first post.  The audio shift looks to be pretty close as the red cursor lines are right in the middle of the received signals.

Thos signals are much wider than I'd expect for 50 baud but it looks like the receiver is overloaded.

Dave

--
You received this message because you are subscribed to the Google Groups "UKHAS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ukhas+un...@googlegroups.com.

David Akerman

unread,
Jul 2, 2020, 9:11:22 AM7/2/20
to UKHAS
OK, so if your board is 5V then it's probably running at 16MHz, so in the Arduino IDE select "16MHz / 5V" and try that.

You might be able to make out the actual frequency on the board by reading the legend on the crystal.

Your audio shift setting is fine - you're right in the middle of those 2 yellow signal bars.

Dave

David Akerman

unread,
Jul 2, 2020, 9:13:15 AM7/2/20
to UKHAS
I should add, just to be sure it's a 5V board, you should measure the CPU voltage at the Vcc pin and not the "Raw" pin which is the input to the regulator.  Sounds like you got it right but worth mentioning.

Ian R Wilde

unread,
Jul 2, 2020, 9:29:12 AM7/2/20
to uk...@googlegroups.com

Hi David,

 

Your input is excellent & much appreciated.

 

Yes, I am measuring between VCC pin & ground= 5.3V, & not measuring input voltage to Arduino.  

 

I will shortly try your suggestion about 16MHz in Arduino set up (Board purchased I think, from SK Pang & can't find details of the order.)

 

I have looked at the components on the board & the main chip is Mega 328P, AU 1044. Various others are marked F, C106 (2 of these), 4B33 & 103.

 

I am correct in assuming that, all other things being correct, which it looks as though they aren't,  even with the 685Hz shift, the character output should be correct, as the guide somewhere implies that it "just" needs to be below 1000 Hz.

 

Let me draw breath & go & try some of your suggestions. I also have a Mini pro, which is again marked up as 3.3V & 8MHz, so I can try that as well, but will need to solder some header pins onto it, so, not a task for today, but the weekend.

 

Many thanks indeed.

Ian R Wilde

unread,
Jul 2, 2020, 9:30:44 AM7/2/20
to uk...@googlegroups.com
Hi again Dave,

Sorry I hadn't realised you hadn't been able to view the screenshot.

It looks, thanks to Dave Ackerman's input that the Arduino is marked up incorrectly which will explain the high 685Hz (yes, not my typo of KHz!!) shift.

Progressing now.

Cheers

Ian
--
You received this message because you are subscribed to the Google Groups "UKHAS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ukhas+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ukhas/d02fb82e-8c3c-3050-3248-16c5dfdcf2cf%40googlemail.com.

David Akerman

unread,
Jul 2, 2020, 9:31:48 AM7/2/20
to UKHAS
5.3V * 425 Hz / 3.3Hz is ... 683Hz, so that explains the audio shift!

Try the 16MHz setting - it's a quick thing to do.

Dave

Ian R Wilde

unread,
Jul 2, 2020, 9:36:02 AM7/2/20
to uk...@googlegroups.com

Dave,

 

Thanks & will do & report.

David Brooke

unread,
Jul 2, 2020, 9:40:23 AM7/2/20
to uk...@googlegroups.com
On Thu, Jul 02, 2020 at 02:30:38PM +0100, Ian R Wilde wrote:
>
> It looks, thanks to Dave Ackerman's input that the Arduino is marked up incorrectly which will explain the high 685Hz (yes, not my typo of KHz!!) shift.
>

Not necessarily marked incorrectly. If you're powering it via the
programming header then that bypasses the on-board regulator so the
processor will run at whatever voltage you supply.

As this seems to be 5V in your case that will explain the shift.

As for the timing, then as has been mentioned, you do need to make sure
you have the correct board selected in the Arduino IDE so that the
software can be compiled for the correct clock frequency (likely 8MHz in
your case if it really is a 3.3V board, albeit being run at 5V).

David

David Akerman

unread,
Jul 2, 2020, 9:43:52 AM7/2/20
to UKHAS
Yeah that's a good point.  The programmer board should have options for 3.3 and 5V, and it may well be that he's running an 8MHz board at 5V.

I hope it is a 16MHz board because I'm not sure what else could stop it decoding!

Oh one thing I've seen ... sometimes the computer mic input device has sound effects e.g. bass boost enabled, and anything like that needs disabling in control panel --> sound devices.

Dave

--
You received this message because you are subscribed to the Google Groups "UKHAS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ukhas+un...@googlegroups.com.

Ian R Wilde

unread,
Jul 2, 2020, 9:48:31 AM7/2/20
to uk...@googlegroups.com
Hi David B (There are a lot of David's!),

I was just about to email David A to say that The Arduino software "Tools"> Processor is already reading it as a is an ATMega 328P 5V, 16MHz, without me selecting anything, as I would have originally selected a few weeks ago, the 328P 3.3V & 8Mhz option if asked..

So what should I do now, just select it as an 3.3V/8Mhz board & re-compile & upload?

Alternatively, I can power it from a 4.8V Nimh in which case am I correct that I would connect to "Vin" & Ground pins?

Cheers

Ian



-----Original Message-----
From: uk...@googlegroups.com [mailto:uk...@googlegroups.com] On Behalf Of David Brooke
Sent: 02 July 2020 14:40
To: uk...@googlegroups.com
Subject: Re: [UKHAS] Re: Help - UKHAS "Linking an Arduino to a Radiometrix NTX2B Transmitter” guide Test Schedule Part 2 not the producing the correct characters in fldigi

--
You received this message because you are subscribed to the Google Groups "UKHAS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ukhas+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ukhas/20200702134019.GA26264%40cubitt.dbrooke.me.uk.

Ian R Wilde

unread,
Jul 2, 2020, 9:49:12 AM7/2/20
to uk...@googlegroups.com

Dave,

 

Pse see me reply to David B's comments.

David Akerman

unread,
Jul 2, 2020, 9:52:28 AM7/2/20
to UKHAS
OK, so first thing, the power supply voltage affects the audio shift but not the CPU speed.

The CPU speed is set by a crystal or resonator on the board.

A 16MHz mini pro should have a 5V supply because the processor needs the extra voltage to be able to run reliably at 16MHz.

It sounds now that you actually have an 8MHz board but you're giving it a higher voltage.  That's fine.

However you *must* get the CPU speed right in the IDE because it uses that setting to calculate the delay that affects the baud rate.  So switch to 8MHz, recompile and download and cross your fingers ...

Dave

David Brooke

unread,
Jul 2, 2020, 9:55:09 AM7/2/20
to uk...@googlegroups.com
On Thu, Jul 02, 2020 at 02:48:27PM +0100, Ian R Wilde wrote:
> Hi David B (There are a lot of David's!),

It would seem there are actually 2 David/Dave B ...

> I was just about to email David A to say that The Arduino software "Tools"> Processor is already reading it as a is an ATMega 328P 5V, 16MHz, without me selecting anything, as I would have originally selected a few weeks ago, the 328P 3.3V & 8Mhz option if asked..
>
> So what should I do now, just select it as an 3.3V/8Mhz board & re-compile & upload?

I'd say so, as I think it is an 8MHz board.

> Alternatively, I can power it from a 4.8V Nimh in which case am I correct that I would connect to "Vin" & Ground pins?

The voltage will only affect the shift, not the timing, as that's
determined by the resonator/crystal.

David

Ian R Wilde

unread,
Jul 2, 2020, 9:55:23 AM7/2/20
to uk...@googlegroups.com

David,

 

Ref the audio input, I have spent days trying to get the waterfall working & haven't yet succeeded on my WIN 10 PC & have given up for the time being - tried EVERYTHING on settings, but managed fairly easily to get it working on my WIN 10 laptop, both with the AR8000 plugged into Mic socket & also raw audio from the latte's speaker held against the Laptop onboard mic & at various volume levels. It works on laptop also with RTL SDR & AirSpy OK, the only problem there is that I can't disconnect or turn the volume down on the audio from the Laptop speakers without it cutting off the waterfall.

 

All sound enhancements have been turned off as far as I am aware. I will double cx in the laptop settings.

 

It's bound to be finger trouble, but usually when it is, someone else has done it before.

 

Ian

 

From: uk...@googlegroups.com [mailto:uk...@googlegroups.com] On Behalf Of David Akerman
Sent: 02 July 2020 14:44
To: UKHAS
Subject: Re: [UKHAS] Re: Help - UKHAS "Linking an Arduino to a Radiometrix NTX2B Transmitter” guide Test Schedule Part 2 not the producing the correct characters in fldigi

 

Yeah that's a good point.  The programmer board should have options for 3.3 and 5V, and it may well be that he's running an 8MHz board at 5V.

Ian R Wilde

unread,
Jul 2, 2020, 9:59:35 AM7/2/20
to uk...@googlegroups.com
David,

That's done, no smoke or smell of burning. Let me set my laptop up & will report back.

Ian

-----Original Message-----
From: uk...@googlegroups.com [mailto:uk...@googlegroups.com] On Behalf Of David Brooke
Sent: 02 July 2020 14:55
To: uk...@googlegroups.com
Subject: Re: [UKHAS] Re: Help - UKHAS "Linking an Arduino to a Radiometrix NTX2B Transmitter” guide Test Schedule Part 2 not the producing the correct characters in fldigi

--
You received this message because you are subscribed to the Google Groups "UKHAS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ukhas+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ukhas/20200702135504.GB26264%40cubitt.dbrooke.me.uk.

Ian R Wilde

unread,
Jul 2, 2020, 10:47:16 AM7/2/20
to uk...@googlegroups.com

Hi David,

 

I have selected the processor as 3.3V & 8MHz , recompiled & uploaded. The VCC to ground is still 5.3V when connected to my PC USB  as per breadboard image attached - you can just see the 3.3V & 8MHz markers blacked out, although blurred.

 

There is no Mic boost or other audio effects selected, I have checked that in the Sound Panel Control Panel> Recording >Microphone>Advanced

 

The audio has shifted slightly higher than before, but with the same bandwith of about 685Hz.  The characters are different but still incorrect. With my AR8000 in USB & plugged into my Laptop Mic socket, I am getting:-

|YTtd|YQb9|YTtd,IL2@EbEYTtd|YQb9|YTtd,IL2b9|YTtd|YQb9|YTtd,IL2b9|YTtd|YQb9| etc. Not sure the start/ finish point, but generally the same repeating pattern. The AR8000 is quite clear (when unplugged from mic lead) & varying volume level doesn't make any difference, except when, of course, very low.

 

See attached screenshot which includes RTTY settings window50 Baud, 7 ascii, parity none, stop bits 2

 

Further thoughts?

 

Cheers

 

Ian

fldigi_incorrect_Characters_ArduinoSettings-revised.jpg
Arduino_Breadboard_NTX2B_Initial_Test_Setup.jpg

David Akerman

unread,
Jul 2, 2020, 10:51:43 AM7/2/20
to UKHAS
Can you try the Rv button please to see if that makes it work - if not then switch it back off.

If it doesn't work, upload a few seconds of the audio - we all know what 50 baud sounds like :) and can someone can try decoding it.

Dave

Ian R Wilde

unread,
Jul 2, 2020, 10:53:13 AM7/2/20
to uk...@googlegroups.com

Dave,

 

Thanks,

 

Give me a few minutes to switch it all on again & will report.

Ian R Wilde

unread,
Jul 2, 2020, 11:16:40 AM7/2/20
to uk...@googlegroups.com

Dave, (& everyone else that responded)

 

Have a drink on me send me the bill sometime!

 

Pressing the RV button worked & it is now printing out (nearly) correctly - I hadn't seen any reference to doing that in my research on how to use the software, although now I see a few comments, so what does it actually do?

 

It isn't 100% correct, as before moving down a line it adds *CF08 (see screenshot) I guess this is a script error - any thoughts?

 

Many thanks & I will post a couple of other, hopefully minor queries over the next few weeks, starting with how to cut out/turn down the volume of AirSpy audio output from AirSpy to the WIN 10 laptop speakers & still have it output to fldigi, but I think a break is in order.

 

Everyone's help has been much appreciated & I will move on now to making an aerial & ground-plane for the NTX2B.

fldigi_nearly_correct_Characters_ArduinoSettings_RV_pressed.jpg

David Akerman

unread,
Jul 2, 2020, 11:25:52 AM7/2/20
to UKHAS
Rv swaps the meaning of the higher and lower frequencies - depending on mode (USB or LSB) one of them means a binary value of zero and the other a value of one.  If you read the code you used that transmits bytes one bit at a time, you will see it selecting a higher or lower frequency according to the value of the bit it is sending.

It's quite easy to get these frequencies swapped round, for example:

  1. Setting the receiver to USB if the signal is LSB, or vice versa
  2. (if you're writing your own code) getting the frequencies swapped in the transmitting code
  3. Tuning the wrong side of the signal **
  4. For an SDR, having the I/Q setting in the SDR software wrong.
  5. Having that Rv button pressed
Rv gets it working but the error is elsewhere.

** this is really easy to do when you have the transmitter and receiver close to each other.  The receiver gets overloaded and this results in you seeing a reflected or mirror version of the actual signal.  This is probably what's gone wrong in your case.  Happened to me on my first flight where I couldn't understand why I couldn't decode anything before launch.

Dave


Ian Wilde

unread,
Jul 2, 2020, 11:33:48 AM7/2/20
to uk...@googlegroups.com
Dave,
Thanks for that info, I will go away & research further into it.

So essentially finger trouble in my part with an error to sort out somewhere. If I tried LSB without RV perhaps?

Any idea why the *CF08 might be being added or should that be obvious if I study the code & the Arduino forums?
Ian

Sent from my iPhone

On 2 Jul 2020, at 16:25, David Akerman <da...@sccs.co.uk> wrote:



David Akerman

unread,
Jul 2, 2020, 11:37:30 AM7/2/20
to UKHAS
Without checking the code, that looks like a CRC being added to the end of the line.  We do that for real telemetry so that the receiver can determine of the received line is likely to have an error or not.

USB is correct; you're probably mistuned to the signal.  Maybe remove the transmitter aerial - that will reduce the signal strength and remove the reflections I mentioned.

Dave

Ian Wilde

unread,
Jul 2, 2020, 12:01:37 PM7/2/20
to uk...@googlegroups.com
Hi Dave,
Many thanks & noted, so no need for me to fuss about it at the moment. 
The NTX2B doesn’t have an aerial as per the note in the guide. I did wonder about that as with a normal transmitter I think that you can blow the output cct Thing without an aerial connected however with the NTX2B at 10 milliwatt output I guess it isn’t an issue!
Cheers
Ian

Sent from my iPhone

On 2 Jul 2020, at 16:37, David Akerman <da...@sccs.co.uk> wrote:



David Akerman

unread,
Jul 2, 2020, 12:03:39 PM7/2/20
to UKHAS
10mW isn't enough to cause damage, but yes in general running a transmitter without an aerial or a dummy load can be very bad!

Dave

Nick McCloud

unread,
Jul 2, 2020, 7:15:41 PM7/2/20
to UKHAS
Bit late to this, but the Pro Mini's of the world have proven to be an ar5e to purchase - I have two cash boxes with the 5V/16MHz separated from the 3.3V/8MHz ones in my office and yes I use the keys after some very embarrassing and expensive issues in production.

Having stared at them to the cows come home and tried to figure all the markings, the absolute simplest way to distinguish between them is to download a blink sketch with about 2 or 3 seconds on/off cycle and down load as a 5V/16MHz board - if it's running at half speed which takes twice as long as in slow, it's a 3.3V device!

I buy a big bag from one supplier (Aliexpress or eBay) and test one of them before putting them in the box.

I've made a note about the Rx button for future snafus I inflict on myself!

Dave Baxter

unread,
Jul 3, 2020, 7:46:38 AM7/3/20
to uk...@googlegroups.com
Yeah, attached images don't come through on the email digest delivery.

Sounds like you're on the way to making it all work, that's all part of the learning curve!

Enjoy it while you've still got the patience for it all.

Regards.

Dave G8KBV

Dave Baxter

unread,
Jul 3, 2020, 7:49:06 AM7/3/20
to uk...@googlegroups.com
Check the microphone privacy settings on the PC.

Dave G8KBV


Dave Baxter

unread,
Jul 3, 2020, 7:53:28 AM7/3/20
to uk...@googlegroups.com

Ian Wilde

unread,
Jul 3, 2020, 7:56:40 AM7/3/20
to uk...@googlegroups.com
Hi Dave,
Thanks & will re-cx the PC Mic privacy settings but have done already several times & the fldigi is listed as an app authorised to use it - but will take another look.
Cheers
Ian

Sent from my iPhone

On 3 Jul 2020, at 12:53, 'Dave Baxter' via UKHAS <uk...@googlegroups.com> wrote:



Dave Baxter

unread,
Jul 3, 2020, 7:58:58 AM7/3/20
to uk...@googlegroups.com
Win10 is a pain.  I don't regret moving from Win7 to Linux at all.

Good luck with your flight plans.

Dave G8KBV.


Ian Wilde

unread,
Jul 4, 2020, 11:01:54 AM7/4/20
to uk...@googlegroups.com
Mark,
Ref your earlier, I have looked at that now in some detail & for the price plus LoRa capability, it seems silly not to run it as a // project to building the NTX2B/Arduino Pro/ Pro Mini tracker,  both of which boards and also the uBLOX- MAX M8C  Pico GPS breakout with  chip antenna, I already have.
So, I have just ordered one.
Thanks for the lead.
Ian

Sent from my iPad

On 2 Jul 2020, at 13:03, Mark Gledhill <mark.gl...@gmail.com> wrote:

Not wishing to complicate things but have you considered sending RTTY using a LoRa module using FSK? Not only are the modules a lot cheaper, it also leaves the option available to send LoRa as well.

A few examples of the code required can be found can be found on github. This one for example works pretty much out of the box:


Mark

Sent from my iPhone

On Jul 2, 2020, at 12:35 PM, Ian Wilde <ianr...@hotmail.com> wrote:


I have just done what Nick suggested, that is copy & paste the code from the UKHAS guide. The result is the same. I get the same repeating series of characters as per my original post. 

Instead of  RTTY TEST BEACON RTTY TEST BEACON This is what fldigi is printing:-
``p|`p~s|@````p|`p~s|@```Cx`x```p|`p~s|@````p|`p~s|@```Cx`x```p|`p~s|@````p|`p~s|@```Cx`x`s|`p~s|@``p|`p|`p~s............etc.   

 fldigi RTTY settings are correct as per earlier screenshot.

Can anyone sort me out with this please?.....Here is what I copied & pasted:-
/*  NTX2 Radio Test Part 2
 
    Transmits data via RTTY with a checksum.
 
    Created 2012 by M0UPU as part of a UKHAS Guide on linking NTX2 Modules to Arduino.
    RTTY code from Rob Harrison Icarus Project. 
    http://ukhas.org.uk
*/ 
 
#define RADIOPIN 13
 
#include <string.h>
#include <util/crc16.h>
 
char datastring[80];
 
void setup() {                
  pinMode(RADIOPIN,OUTPUT);
}
 
void loop() {
 
 
  sprintf(datastring,"RTTY TEST BEACON RTTY TEST BEACON"); // Puts the text in the datastring
  unsigned int CHECKSUM = gps_CRC16_checksum(datastring);  // Calculates the checksum for this datastring
  char checksum_str[6];
  sprintf(checksum_str, "*%04X\n", CHECKSUM);
  strcat(datastring,checksum_str);
 
  rtty_txstring (datastring);
  delay(2000);
}
 
 
void rtty_txstring (char * string)
{
 
  /* Simple function to sent a char at a time to 
   	** rtty_txbyte function. 
   	** NB Each char is one byte (8 Bits)
   	*/
 
  char c;
 
  c = *string++;
 
  while ( c != '\0')
  {
    rtty_txbyte (c);
    c = *string++;
  }
}
 
 
void rtty_txbyte (char c)
{
  /* Simple function to sent each bit of a char to 
   	** rtty_txbit function. 
   	** NB The bits are sent Least Significant Bit first
   	**
   	** All chars should be preceded with a 0 and 
   	** proceded with a 1. 0 = Start bit; 1 = Stop bit
   	**
   	*/
 
  int i;
 
  rtty_txbit (0); // Start bit
 
  // Send bits for for char LSB first	
 
  for (i=0;i<7;i++) // Change this here 7 or 8 for ASCII-7 / ASCII-8
  {
    if (c & 1) rtty_txbit(1); 
 
    else rtty_txbit(0);	
 
    c = c >> 1;
 
  }
 
  rtty_txbit (1); // Stop bit
  rtty_txbit (1); // Stop bit
}
 
void rtty_txbit (int bit)
{
  if (bit)
  {
    // high
    digitalWrite(RADIOPIN, HIGH);
  }
  else
  {
    // low
    digitalWrite(RADIOPIN, LOW);
 
  }
 
  //                  delayMicroseconds(3370); // 300 baud
  delayMicroseconds(10000); // For 50 Baud uncomment this and the line below. 
  delayMicroseconds(10150); // You can't do 20150 it just doesn't work as the
                            // largest value that will produce an accurate delay is 16383
                            // See : http://arduino.cc/en/Reference/DelayMicroseconds
 
}
 
uint16_t gps_CRC16_checksum (char *string)
{
  size_t i;
  uint16_t crc;
  uint8_t c;
 
  crc = 0xFFFF;
 
  // Calculate checksum ignoring the first two $s
  for (i = 2; i < strlen(string); i++)
  {
    c = string[i];
    crc = _crc_xmodem_update (crc, c);
  }
 
  return crc; 
}     

On Thursday, 2 July 2020 11:05:51 UTC+1, Ian Wilde wrote:

Can anyone help with this problem so I can move forward with building an Arduino/NTX2B tracker?:-

 

The UKHAS “Linking an Arduino to a Radiometrix NTX2B Transmitter” guide  Test Schedule, Part 1 Guide worked, however Part 2 is not the producing the correct characters. I have re-checked the Arduino code several times for typos & it was, as the UKHAS Guide guide strongly recommends, hand typed, not using Copy & Paste. A copy is attached. This is what I am getting:-

 

 ``p|`p~s|@````p|`p~s|@```Cx`x```p|`p~s|@````p|`p~s|@```Cx`x```p|`p~s|@````p|`p~s|@```Cx`x`s|`p~s|@``p|`p|`p~s  I think the sequence starts.. ``p`p|`p~s|@````p|`p~s|@```Cx`x` 

 

 The dl-fldigi settings are as on the guide (see attached photo) & changing them doesn't help. Looking at https://en.wikipedia.org/wiki/ASCII  doesn't assist either - this is all new territory to me.

 

The  .ino file is attached & code that was uploaded to the Arduino Pro are copied below this post. The Arduino output is to Pin 13, not 10 as per the guide, as that must be a typo as it only produces a single line in the waterfall.

 

The fldigi RTTY Custom settings are all correct with Baud rate5.0 /Parity nil/Stop bits 2/7 bits per character. the Carrier frq shift is set to 685Hz due to the resistors used & the board is an Arduino Pro 3.3V/8MHz.

 

The output is from Pin 13, not 10 as in the circuit diagram & description as this produces only a single line in the Waterfall. I assume that this is a legacy issue "typo" in the Guide. The board LED flashes nicely & the AR9000 & Airspy audio sounds OK with USB selected on both, although I am only using one of them, not both together. See attached photos & .ino file.

 

Can anyone help please?

 

Code as uploaded to Arduino Pro:-

 

/* NTX2 Radio Test Part 2

 

  Transmits data via RTTY with a checksum.

 

  Created 2012 by MOUPU as part of a UKHAS Guide on Linking NTX2 Modules to Arduino.

  RTTY code from Rob Harrison Icarus Project.

  http://ukhas.org.uk

*/

 

#define RADIOPIN 13

 

#include <string.h>

#include <util/crc16.h>

 

char datastring[80];

 

void setup()

{

 pinMode(RADIOPIN,OUTPUT);   // sets the digital pin as output

 

}

 

void loop()

{

  sprintf(datastring,"RTTY TEST BEACON RTTY TEST BEACON"); // Puts the text in the datastring

  unsigned int CHECKSUM = gps_CRC16_checksum(datastring);  //Calculates the checksum for this datastring

  char checksum_str[6];

  sprintf(checksum_str, "*%04X\n", CHECKSUM);

  strcat(datastring,checksum_str);

 

  rtty_txstring (datastring);

  delay(2000);

}

 

 

void rtty_txstring (char * string)

{

 

  /* Simple function to send a char at a time to

        ** rtty_txbyte function   

        ** NB Each char is one byte (8 Bits)

   */

 

   char c;

 

   c = *string++;

 

   while ( c != '\0')

   {

    rtty_txbyte (c);

    c = *string++;

   }

}

 

void rtty_txbyte (char c)

{

  /* Simple function to send each bit of a char to

       ** rtty_txbit function. 

       ** NB The bits are sent Least Sgnificant Bit first

       **

       ** ALL chars should be preceded with a 0 and

       ** proceded with a 1. 0 = Start bit; 1 = Stop bit

       **

   */

 

   int i;

 

   rtty_txbit (0); // Start bit

 

   // Send bits for char LSB first

 

   for (i=0;i<7;i++) // Change this here 7 or 8 for ASCII-7 / ASCII-8

   {

    if (c & 1) rtty_txbit(1);

 

    else rtty_txbit(0);

 

    c = c >> 1;

   }

 

   rtty_txbit (1);  // Stop bit

   rtty_txbit (1); // Stop bit

}

 

void rtty_txbit  (int bit)

{

  if (bit)

  {

    // high

    digitalWrite(RADIOPIN, HIGH);

  }

  else

  {

    // Low

    digitalWrite(RADIOPIN, LOW);

  }

 

  //                delayMicrosconds(3370); //  300 baud

  delayMicroseconds(10000);  // For 50 Baud uncomment this and the line below.

  delayMicroseconds (10150); // You can't do 20150 it just doesn't work as the

                             // Largest value that will produce an accurate delay is 16383

                             // See : http://arduino.cc/en/Reference/DelayMicroseconds

 

}

   uint16_t gps_CRC16_checksum (char *string)

{

  size_t i;

  uint16_t crc;

  uint8_t c;

 

  crc = 0xFFFF;

 

  // Calculate checksum ignoring first two $s

  for (i = 2; i < strlen(string); i++)

  {

    c = string[i];

    crc = _crc_xmodem_update (crc, c);

  }

 

  return crc;

  }

 

                          

 

--
You received this message because you are subscribed to the Google Groups "UKHAS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ukhas+un...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "UKHAS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ukhas+un...@googlegroups.com.

Ben Z en de rest

unread,
Jul 4, 2020, 12:47:05 PM7/4/20
to uk...@googlegroups.com
Nick, if I put 7 volt on the raw input and get 3.3 v vcc it’s 8 MHz and if vcc measures 5 v it’s a 16 MHz , thats how I check them if they are “out of the bag” .

Might help others?

Op vr 3 jul. 2020 om 01:15 schreef Nick McCloud <ni...@descartes.co.uk>
--
You received this message because you are subscribed to the Google Groups "UKHAS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ukhas+un...@googlegroups.com.

Ian Wilde

unread,
Jul 4, 2020, 12:52:25 PM7/4/20
to uk...@googlegroups.com
Nick,
Noted with thanks.
Ian

Sent from my iPhone

On 4 Jul 2020, at 17:47, Ben Z en de rest <hoofdei...@gmail.com> wrote:



Nick McCloud

unread,
Jul 5, 2020, 5:07:56 AM7/5/20
to UKHAS


On Saturday, 4 July 2020 17:47:05 UTC+1, PE2BZ wrote:
Nick, if I put 7 volt on the raw input and get 3.3 v vcc it’s 8 MHz and if vcc measures 5 v it’s a 16 MHz , thats how I check them if they are “out of the bag” 
Might help others?

That's too obvious & sensible for me.

But as I'm building LoRaWAN nodes with Pro Mini's, many of them end up going through the production office for removal of LEDs and the Vreg, and after a big big mixup, I go the cash boxes ...

Ian Leitch

unread,
Jul 21, 2020, 9:58:20 AM7/21/20
to UKHAS
For what it might be worth; when tuning to a signal, tune from low frequency to high. That way you, hopefully, don't pick up image signals before intercepting the real one.

And, humerously, if you are tuning a violin, you know that the obviously incorrect note is low and not high of it's target. Less chance of breaking a string too/

Ian_

Ian Wilde

unread,
Jul 21, 2020, 1:15:27 PM7/21/20
to uk...@googlegroups.com
Hi Ian,
Thanks but it is sorted now thanks to Dave Ackerman plus a few others. Selecting Reverse in fldigi worked.
Ian

Sent from my iPhone

On 21 Jul 2020, at 14:58, 'Ian Leitch' via UKHAS <uk...@googlegroups.com> wrote:


For what it might be worth; when tuning to a signal, tune from low frequency to high. That way you, hopefully, don't pick up image signals before intercepting the real one.

And, humerously, if you are tuning a violin, you know that the obviously incorrect note is low and not high of it's target. Less chance of breaking a string too/

Ian_

--
You received this message because you are subscribed to the Google Groups "UKHAS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ukhas+un...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages