开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

PTT line to Raduino?


 

Hi,

Quick question, maybe I am missing something here?;-)?The brown/black wire on the the PTT connector on the main board obviously puts the Bitx40 into transmission mode. Question however is how does the Raduino know about the board being in transmission mode? From the original sketch by??the code is not really conclusive either. The remarks in the code state A2 is the PTT line but a few lines below we see:??PTT (A6). Now all good and well but neither are connected to the PTT line on the mainboard somehow? Now the source also states that to use this we need some extra wiring ie an NPN transistor and 4.7k resistor? Just curious how everybody tackeled this??


Regards,


Leo PD1LDB


 

The Raduino does not know if the rig is transmitting or receiving. ?All the Raduino does now is create the VFO through the Si5351, and the VFO frequency does not shift when switching to transmit. ?

Eventually, the Raduino could take on more duties. ?For example, use of a CW key into the Raduino could cause the Raduino to activate the PTT wire into the Bitx40, giving semi-breakin CW. ?There would still be a PTT switch at the mike for SSB operation but that switch would only be sensed by the Raduino and passed on from there to the Bitx40. ?Also, it would be useful to have RIT, where the Raduino shifts the VFO frequency when transmitting. ?Code for these features is in Ashhar's sketch but not finalized or debugged, and not supported by the wiring recommendations by the WireUp webpage at hfsigs. ?Left as an exercise for the reader.

Jerry, KE7ER


On Sun, Mar 26, 2017 at 08:16 am, Leo de Blaauw wrote:

how does the Raduino know about the board being in transmission mode?

?


 

Sketch revisions thus far have been focused on various schemes for changing how to tune the VFO and cleaning up bugs in the calibrate feature. ?I don't believe anyone has yet implemented semi-breakin CW or RIT and posted their Raduino sketch to the group. ? Your chance to be famous!

Jerry, KE7ER

On Sun, Mar 26, 2017 at 08:16 am, Leo de Blaauw wrote:

Just curious how everybody tackeled this??

?


 

开云体育

While the Arduino, with an external transistor is capable of putting the rig in to transmit, it is not used at this time. The only connection, other than supply voltage is the frequency out to the main board replacing the old on board oscillator.

?

v/r

Fred W4JLE

?

?

From: [email protected] [mailto:[email protected]] On Behalf Of Leo de Blaauw
Sent: Sunday, March 26, 2017 11:16 AM
To: [email protected]
Subject: [BITX20] PTT line to Raduino?

?

Hi,

Quick question, maybe I am missing something here?;-)?The brown/black wire on the the PTT connector on the main board obviously puts the Bitx40 into transmission mode. Question however is how does the Raduino know about the board being in transmission mode? From the original sketch by??the code is not really conclusive either. The remarks in the code state A2 is the PTT line but a few lines below we see:??PTT (A6). Now all good and well but neither are connected to the PTT line on the mainboard somehow? Now the source also states that to use this we need some extra wiring ie an NPN transistor and 4.7k resistor? Just curious how everybody tackeled this??


Regards,


Leo PD1LDB


 

Hi Fred and others thanks for your remarks and clarifications. Well definitely something to look into or maybe just wire the PTT wires into the Raduino as well so that it knows the BiTx40 is in Tx ?

All good fun and experimentation for sure and learning lots!


regards,

Leo


 

Be aware that PTT has 12v on it, and some ringing from the inductance of the relay coil ?The Raduino could blow if fed much more than 5v. ?I'd start with a 10k+7k resistive divider or thereabouts, plus a 0.1uF cap from Raduino pin to ground. ? Verify it's 5v or less before hooking it up to the Raduino.


On Sun, Mar 26, 2017 at 10:49 am, Leo de Blaauw wrote:

maybe just wire the PTT wires into the Raduino as well so that it knows the BiTx40 is in Tx ?

?


 

About a month ago I tried Jerry's flutter fix by copy and pasting the snippet into my copy of the code. At that time I started reading the comments that are in the code which explains everything it does and how to use it. Here is a chunk of the code with comments about the transistor on the PTT line for CW and also talks about RIT. Elsewhere in the code CW offset is defined as 8001 which is 800hz sidetone. I uploaded a fixed copy into the files section, and it runs great. I suggest folks get it or some other copy and read the parts that tell you how to use it's features. I haven't used the CW feature because the BITX 40 board is simple SSB transceiver. And that's how I want to use it. But the CW function could be used as "tune" button like other radios have for transmitting a tone for tuning the antenna tuner for lowest SWR when changing frequency. I haven't changed any part in this piece of code. It's just here as a free sample example of the info within. ?

?* The Checkt TX toggles the T/R line. The current BITX wiring up doesn't use this

?* but if you would like to make use of RIT, etc, You must wireup an NPN transistor to to the PTT line

?* as follows :

?* emitter to ground,?

?* base to TX_RX line through a 4.7K resistr(as defined at the top of this source file)

?* collecter to the PTT line

?* Now, connect the PTT to the control connector's PTT line (see the definitions on the top)

?*?

?* Yeah, surprise! we have CW supported on the Raduino

?*/


void checkTX(){

??

? // We don't check for ptt when transmitting cw

? // as long as the cwTimeout is non-zero, we will continue to hold the

? // radio in transmit mode

? if (cwTimeout > 0)

? ? return;

? ??

? if (digitalRead(PTT) == 0 && inTx == 0){

? ? inTx = 1;

? ? digitalWrite(TX_RX, 1);

? ? updateDisplay();

? }

? if (digitalRead(PTT) == 1 && inTx == 1){

? ? inTx = 0;

? ? digitalWrite(TX_RX, 0);

? ? updateDisplay();

? }

}


/* CW is generated by injecting the side-tone into the mic line.

?* Watch http://bitxhacks.blogspot.com for the CW hack

?* nonzero cwTimeout denotes that we are in cw transmit mode.

?*?

?* This function is called repeatedly from the main loop() hence, it branches

?* each time to do a different thing

?*?

?* There are three variables that track the CW mode

?* inTX ? ? : true when the radio is in transmit mode?

?* keyDown ?: true when the CW is keyed down, you maybe in transmit mode (inTX true)?

?* ? ? ? ? ? ?and yet between dots and dashes and hence keyDown could be true or false

?* cwTimeout: Figures out how long to wait between dots and dashes before putting?

?* ? ? ? ? ? ?the radio back in receive mode

?*/


void checkCW(){


? if (keyDown == 0 && analogRead(ANALOG_KEYER) < 50){

? ? //switch to transmit mode if we are not already in it

? ? if (inTx == 0){

? ? ? digitalWrite(TX_RX, 1);

? ? ? //give the relays a few ms to settle the T/R relays

? ? ? delay(50);

? ? }

? ? inTx = 1;

? ? keyDown = 1;

? ? tone(CW_TONE, sideTone);

? ? updateDisplay();

? }


? //reset the timer as long as the key is down

? if (keyDown == 1){

? ? ?cwTimeout = CW_TIMEOUT + millis();

? }


? //if we have a keyup

? if (keyDown == 1 && analogRead(ANALOG_KEYER) > 150){

? ? keyDown = 0;

? ? noTone(CW_TONE);

? ? cwTimeout = millis() + CW_TIMEOUT;

? }


? //if we are in cw-mode and have a keyuup for a longish time

? if (cwTimeout > 0 && inTx == 1 && cwTimeout < millis()){

? ? //move the radio back to receive

? ? digitalWrite(TX_RX, 0);

? ? inTx = 0;

? ? cwTimeout = 0;

? ? updateDisplay();

? }

}


/**

?* A trivial function to wrap around the function button

?*/

int btnDown(){

? if (digitalRead(FBUTTON) == HIGH)

? ? return 0;

? else

? ? return 1;

}


/**

?* A click on the function button toggles the RIT

?* A double click switches between A and B vfos

?* A long press copies both the VFOs to the same frequency

?*/

void checkButton(){

? int i, t1, t2, knob, new_knob, duration;


? //rest of this function is interesting only if the button is pressed

? if (!btnDown())

? ? return;


? // we are at this point because we detected that the button was indeed pressed!

? // we wait for a while and confirm it again so we can be sure it is not some noise

? delay(50);

? if (!btnDown())

? ? return;

? ??

? // note the time of the button going down and where the tuning knob was

? t1 = millis();

? knob = analogRead(ANALOG_TUNING);

? duration = 0;

??

? // if you move the tuning knob within 3 seconds (3000 milliseconds) of pushing the button down

? // then consider it to be a coarse tuning where you you can move by 100 Khz in each step

? // This is useful only for multiband operation.

? while (btnDown() && duration < 3000){



 

I should have directly commented on the A2 and A6 pins for PTT. Back in January Jerry recommended I change my A7 tuning pin to A6 because a short burned out the A7 input cell. I just did it and nothing happened with regards to PTT. A comment says this about that pin- "A6 is to implement a keyer, it is reserved and not yet implemented".?

The point is read all the comments, experiment, and keep in mind the raduino is a project starting out with the 20 meter BITX 20. That's why the info about the VFO is about an14khz example.


Jack Purdum
 

Similar problem again that might trip some people up. The constant:

#define CW_OFFSET (800l)

has the last character in the symbolic constant defined as an 'l' (el), not a one ('1'). This is easier to see if you change the constant to:

#define CW_OFFSET (800L)

It makes it easier to spot the type specifier.

Jack, W8TEE


From: John Smith via Groups.Io <johnlinux77@...>
To: [email protected]
Sent: Sunday, March 26, 2017 2:27 PM
Subject: Re: [BITX20] PTT line to Raduino?

About a month ago I tried Jerry's flutter fix by copy and pasting the snippet into my copy of the code. At that time I started reading the comments that are in the code which explains everything it does and how to use it. Here is a chunk of the code with comments about the transistor on the PTT line for CW and also talks about RIT. Elsewhere in the code CW offset is defined as 8001 which is 800hz sidetone. I uploaded a fixed copy into the files section, and it runs great. I suggest folks get it or some other copy and read the parts that tell you how to use it's features. I haven't used the CW feature because the BITX 40 board is simple SSB transceiver. And that's how I want to use it. But the CW function could be used as "tune" button like other radios have for transmitting a tone for tuning the antenna tuner for lowest SWR when changing frequency. I haven't changed any part in this piece of code. It's just here as a free sample example of the info within. ?
?* The Checkt TX toggles the T/R line. The current BITX wiring up doesn't use this
?* but if you would like to make use of RIT, etc, You must wireup an NPN transistor to to the PTT line
?* as follows :
?* emitter to ground,?
?* base to TX_RX line through a 4.7K resistr(as defined at the top of this source file)
?* collecter to the PTT line
?* Now, connect the PTT to the control connector's PTT line (see the definitions on the top)
?*?
?* Yeah, surprise! we have CW supported on the Raduino
?*/

void checkTX(){
??
? // We don't check for ptt when transmitting cw
? // as long as the cwTimeout is non-zero, we will continue to hold the
? // radio in transmit mode
? if (cwTimeout > 0)
? ? return;
? ??
? if (digitalRead(PTT) == 0 && inTx == 0){
? ? inTx = 1;
? ? digitalWrite(TX_RX, 1);
? ? updateDisplay();
? }
? if (digitalRead(PTT) == 1 && inTx == 1){
? ? inTx = 0;
? ? digitalWrite(TX_RX, 0);
? ? updateDisplay();
? }
}

/* CW is generated by injecting the side-tone into the mic line.
?* Watch http://bitxhacks.blogspot.com for the CW hack
?* nonzero cwTimeout denotes that we are in cw transmit mode.
?*?
?* This function is called repeatedly from the main loop() hence, it branches
?* each time to do a different thing
?*?
?* There are three variables that track the CW mode
?* inTX ? ? : true when the radio is in transmit mode?
?* keyDown ?: true when the CW is keyed down, you maybe in transmit mode (inTX true)?
?* ? ? ? ? ? ?and yet between dots and dashes and hence keyDown could be true or false
?* cwTimeout: Figures out how long to wait between dots and dashes before putting?
?* ? ? ? ? ? ?the radio back in receive mode
?*/

void checkCW(){

? if (keyDown == 0 && analogRead(ANALOG_KEYER) < 50){
? ? //switch to transmit mode if we are not already in it
? ? if (inTx == 0){
? ? ? digitalWrite(TX_RX, 1);
? ? ? //give the relays a few ms to settle the T/R relays
? ? ? delay(50);
? ? }
? ? inTx = 1;
? ? keyDown = 1;
? ? tone(CW_TONE, sideTone);
? ? updateDisplay();
? }

? //reset the timer as long as the key is down
? if (keyDown == 1){
? ? ?cwTimeout = CW_TIMEOUT + millis();
? }

? //if we have a keyup
? if (keyDown == 1 && analogRead(ANALOG_KEYER) > 150){
? ? keyDown = 0;
? ? noTone(CW_TONE);
? ? cwTimeout = millis() + CW_TIMEOUT;
? }

? //if we are in cw-mode and have a keyuup for a longish time
? if (cwTimeout > 0 && inTx == 1 && cwTimeout < millis()){
? ? //move the radio back to receive
? ? digitalWrite(TX_RX, 0);
? ? inTx = 0;
? ? cwTimeout = 0;
? ? updateDisplay();
? }
}

/**
?* A trivial function to wrap around the function button
?*/
int btnDown(){
? if (digitalRead(FBUTTON) == HIGH)
? ? return 0;
? else
? ? return 1;
}

/**
?* A click on the function button toggles the RIT
?* A double click switches between A and B vfos
?* A long press copies both the VFOs to the same frequency
?*/
void checkButton(){
? int i, t1, t2, knob, new_knob, duration;

? //rest of this function is interesting only if the button is pressed
? if (!btnDown())
? ? return;

? // we are at this point because we detected that the button was indeed pressed!
? // we wait for a while and confirm it again so we can be sure it is not some noise
? delay(50);
? if (!btnDown())
? ? return;
? ??
? // note the time of the button going down and where the tuning knob was
? t1 = millis();
? knob = analogRead(ANALOG_TUNING);
? duration = 0;
??
? // if you move the tuning knob within 3 seconds (3000 milliseconds) of pushing the button down
? // then consider it to be a coarse tuning where you you can move by 100 Khz in each step
? // This is useful only for multiband operation.
? while (btnDown() && duration < 3000){




 

Yea I see it. I was thinking of that when I saw it this time. So this time I looked very carefully and saw it is a number one.

?#define CW_OFFSET (800l) pasted in here on this page with this font, you can't tell what it is. But in the Arduino IDE it's easier to see it is a number 1 on line #178 of my copy.

I made a mistake before, but now I know what to be mindful of before I make a statement that might mislead someone who doesn't know better to figure it for themselves. Another one down, a bunch more to go.

I know I said I wanted to use it as a simple SSB. But I would like to implement a change of starting up on USB with the knob turned all the way to the right so I can try line in audio for a digital mode. I saw something in the code before, but I also saw someone else mention the knob thing. Does anyone have a code snippet that be pasted in for an easy upgrade?


 

开云体育

It is the letter L not the number one.? You can determine this by using the” find” function under “edit”.? If you search for ?8001 (with a one) you will not find it in the referenced line but you will if you search for 800l (with the letter “L”)

Mike

K5ESS

?

From: [email protected] [mailto:[email protected]] On Behalf Of John Smith via Groups.Io
Sent: Sunday, March 26, 2017 3:12 PM
To: [email protected]
Subject: Re: [BITX20] PTT line to Raduino?

?

Yea I see it. I was thinking of that when I saw it this time. So this time I looked very carefully and saw it is a number one.

?#define CW_OFFSET (800l) pasted in here on this page with this font, you can't tell what it is. But in the Arduino IDE it's easier to see it is a number 1 on line #178 of my copy.

I made a mistake before, but now I know what to be mindful of before I make a statement that might mislead someone who doesn't know better to figure it for themselves. Another one down, a bunch more to go.

I know I said I wanted to use it as a simple SSB. But I would like to implement a change of starting up on USB with the knob turned all the way to the right so I can try line in audio for a digital mode. I saw something in the code before, but I also saw someone else mention the knob thing. Does anyone have a code snippet that be pasted in for an easy upgrade?


 

Damn, I did it again. Look at this-?Related imageIt looks just like what's in the Arduino IDE except the top is not slanted down. Indicating a lower case L. You guys are right. I am glad I didn't make a bigger ass of myself than I did.

So.... how bout that upper side, huh?


 

That last bit was bout that single side band. So to clarify which case is that character? Upper or lower?

I am gonna take a break now so I don't stir up any nerd rage.?


 

开云体育

Just remember the PTT is dealing with 12V and you never want that going to any input/output of the Raduino. The only exception is the 12 volts sent to the 5 volt regulator via the orange wire on the oscillator plug.

?

v/r

Fred W4JLE

?

From: [email protected] [mailto:[email protected]] On Behalf Of Leo de Blaauw
Sent: Sunday, March 26, 2017 1:50 PM
To: [email protected]
Subject: Re: [BITX20] PTT line to Raduino?

?

Hi Fred and others thanks for your remarks and clarifications. Well definitely something to look into or maybe just wire the PTT wires into the Raduino as well so that it knows the BiTx40 is in Tx ?

All good fun and experimentation for sure and learning lots!

?

regards,

Leo