PU2CLR QN8066 Arduino Library 1.3.0
Arduino Library for QN8066Devices - By Ricardo Lima Caratti
Loading...
Searching...
No Matches
TX Functions

Functions

void QN8066::resetAudioPeak ()
 TX Audio peak clear signal.
 
void QN8066::setTX (uint16_t frequency)
 Sets the TX mode.
 
void QN8066::setTxStereo (bool value=true)
 Set TX Stereo or Mono.
 
void QN8066::setTxMono (uint8_t value=0)
 Set TX Stereo or Mono (Same setTxStereo )
 
uint8_t QN8066::getTxMono ()
 Gets TX Stereo or Mono setup.
 
void QN8066::setTxPreEmphasis (uint8_t value=75)
 Pre-emphasis and de-emphasis time constant.
 
void QN8066::setPreEmphasis (uint8_t value=1)
 Pre-emphasis and de-emphasis time constant - Same setTxPreEmphasis.
 
void QN8066::setTxPilotGain (uint8_t value)
 Gain of TX pilot to adjust pilot frequency deviation.
 
void QN8066::setTxSoftClipThreshold (uint8_t value)
 TX soft clip threshold.
 
void QN8066::setTxOffAfterOneMinuteNoAudio (bool value)
 Set of 1 minute time for PA off when no audio.
 
void QN8066::setTxOffAfterOneMinute (uint8_t value)
 Sets PA Off after 1 minute time when no audio.
 
void QN8066::setAudioAnalogGain (uint8_t value)
 Sets volume control gain of analog portion.
 
void QN8066::setAudioDigitalGain (uint8_t value)
 Sets set digital volume gain.
 
void QN8066::setAudioDacHold (bool value)
 DAC output control.
 
void QN8066::setAudioTxDiff (bool value)
 Tx audio input mode selection.
 
void QN8066::setTxInputImpedance (uint8_t value)
 TX mode input impedance for both L/R channels.
 
void QN8066::setTxDigitalGain (uint8_t value)
 TX digital gain.
 
void QN8066::setTxInputBufferGain (uint8_t value)
 TX input buffer gain.
 
void QN8066::setTxSoftClippingEnable (bool value)
 TX soft clipping enable.
 
void QN8066::setTxFrequencyDerivation (uint8_t value)
 Specify total TX frequency deviation.
 
void QN8066::setPAC (uint8_t PA_TRGT)
 PA output power target control.
 
void QN8066::updateTxSetup ()
 Reset the system kepping the TX current STATUS.
 
void QN8066::setToggleTxPdClear ()
 TX Audio peak clear signal.
 
int QN8066::getAudioPeakValue ()
 Audio peak value at ADC input.
 

Detailed Description

The functions defined in this group are responsible for controlling the transmitting of the QN8066.

Function Documentation

◆ resetAudioPeak()

void QN8066::resetAudioPeak ( )
inline

TX Audio peak clear signal.

Same setToggleTxPdClear (synonym)

Audio peak value is max-hold and stored in aud_pk (see STATUS register). Once TXPD_CLR is toggled, the aud_pk value is cleared and restarted again

Example

#include <QN8066.h>
QN8066 tx;
void setup() {
tx.setup();
tx.setTX(1069); // Set the transmitter to 106.9 MHz
...
}
void loop() {
}
QN8066 Class.
Definition: QN8066.h:846
void setup(uint16_t xtalDiv=1000, bool mono=false, bool rds=false, uint8_t PreEmphasis=0, uint8_t xtalInj=0, uint8_t imageRejection=1, uint8_t txSoftClipThreshold=0, uint8_t oneMinutOff=3, uint8_t gainTxPLT=9, uint8_t txFreqDev=125, uint8_t rdsLineIn=0, uint8_t rdsFreqDev=60, uint8_t inImpedance=1, uint8_t txAgcDig=0, uint8_t txAgcBuffer=1, uint8_t txSoftClip=0)
QN8066 initial configuration.
Definition: QN8066.cpp:291
void resetAudioPeak()
TX Audio peak clear signal.
Definition: QN8066.h:1009
void setTX(uint16_t frequency)
Sets the TX mode.
Definition: QN8066.cpp:659

References QN8066::setToggleTxPdClear().

◆ setTX()

void QN8066::setTX ( uint16_t  frequency)

Sets the TX mode.

To avoid working with the float data type, the frequency parameter must be the desired frequency multiplied by 10.

For example, if the user wants to tune to 106.9 MHz, the parameter to be sent is 1067.

This approach reduces the size of the final code (binary) as well as avoids the inaccuracies of floating-point mathematical operations.

Parameters
frequency- Frequency to be set

Example

#include <QN8066.h>
QN8066 tx;
void setup() {
tx.setup();
tx.setTX(1069); // Set the transmitter to 106.9 MHz
}
void loop() {
}
Todo:
Under improvements - Need to be optimized to improve space size

◆ setTxStereo()

void QN8066::setTxStereo ( bool  value = true)

Set TX Stereo or Mono.


Parameters
value(true = stereo; false = mono)

Example

#include <QN8066.h>
QN8066 tx;
void setup() {
tx.setup();
tx.setTX(1069); // Set the transmitter to 106.9 MHz
tx.setTxStereo(true);
}
void loop() {
}
void setTxStereo(bool value=true)
Set TX Stereo or Mono.
Definition: QN8066.cpp:754

◆ setTxMono()

void QN8066::setTxMono ( uint8_t  value = 0)

Set TX Stereo or Mono (Same setTxStereo )


Parameters
value(1 = Mono, 0 = Stereo )

Example

#include <QN8066.h>
QN8066 tx;
void setup() {
tx.setup();
tx.setTX(1069); // Set the transmitter to 106.9 MHz
tx.setTxMono(0); // Sets Stereo
}
void loop() {
}
void setTxMono(uint8_t value=0)
Set TX Stereo or Mono (Same setTxStereo )
Definition: QN8066.cpp:781

◆ getTxMono()

uint8_t QN8066::getTxMono ( )

Gets TX Stereo or Mono setup.

Returns
uint8_t - 1 = Mono; 0 = Stereo

Example

#include <QN8066.h>
QN8066 tx;
void setup() {
tx.setup();
tx.setTX(1069); // Set the transmitter to 106.9 MHz
if ( tx.getTxMono() ) {
// It is in mono mode
}
}
void loop() {
}
uint8_t getTxMono()
Gets TX Stereo or Mono setup.
Definition: QN8066.cpp:809

◆ setTxPreEmphasis()

void QN8066::setTxPreEmphasis ( uint8_t  value = 75)

Pre-emphasis and de-emphasis time constant.

The valid values are 50 and 75. Any value not equal to 75 sets the Pre-emphasis to 50.

Parameters
value(valids values: 50 or 75);

Example

#include <QN8066.h>
QN8066 tx;
void setup() {
tx.setup();
tx.setTX(1069); // Set the transmitter to 106.9 MHz
}
void loop() {
}
void setTxPreEmphasis(uint8_t value=75)
Pre-emphasis and de-emphasis time constant.
Definition: QN8066.cpp:833

◆ setPreEmphasis()

void QN8066::setPreEmphasis ( uint8_t  value = 1)

Pre-emphasis and de-emphasis time constant - Same setTxPreEmphasis.

The valid values are 0 and 1.

Parameters
value(valids values: 0 = 50us or 1 = 75us );

Example

#include <QN8066.h>
QN8066 tx;
void setup() {
tx.setup();
tx.setTX(1069); // Set the transmitter to 106.9 MHz
tx.setPreEmphasis(1); // 75 us
}
void loop() {
}
void setPreEmphasis(uint8_t value=1)
Pre-emphasis and de-emphasis time constant - Same setTxPreEmphasis.
Definition: QN8066.cpp:861

◆ setTxPilotGain()

void QN8066::setTxPilotGain ( uint8_t  value)

Gain of TX pilot to adjust pilot frequency deviation.

Refers to peak frequency deviation of MPX signal when audio input is full scale. Valid values: between 7 and 10.

the frequency deviation is value (%) * 75 kHz.

Parameters
value

Example

#include <QN8066.h>
QN8066 tx;
void setup() {
tx.setup();
tx.setTX(1069); // Set the transmitter to 106.9 MHz
tx.setTxPilotGain(7); // 7 * 75 kHz
}
void loop() {
}
void setTxPilotGain(uint8_t value)
Gain of TX pilot to adjust pilot frequency deviation.
Definition: QN8066.cpp:889

◆ setTxSoftClipThreshold()

void QN8066::setTxSoftClipThreshold ( uint8_t  value)

TX soft clip threshold.

See table below.

tx_sftclpth value
0 - 00 12’d2051 (3db back off from 0.5v)
1 - 01 12’d1725 (4.5db back off from 0.5v)
2 - 10 12’d1452 (6db back off from 0.5v)
3 - 11 12’d1028 (9db back off from 0.5v)
Parameters
value

Example

#include <QN8066.h>
QN8066 tx;
void setup() {
tx.setup();
tx.setTX(1069); // Set the transmitter to 106.9 MHz
tx.setTxSoftClipThreshold(2); // 2 = 12’d1452 (6db back off from 0.5v)
}
void loop() {
}
void setTxSoftClipThreshold(uint8_t value)
TX soft clip threshold.
Definition: QN8066.cpp:926

◆ setTxOffAfterOneMinuteNoAudio()

void QN8066::setTxOffAfterOneMinuteNoAudio ( bool  value)

Set of 1 minute time for PA off when no audio.

Parameters
value(true = Infinity (never turn it off); false = turn it ofafter about 1 minue )

Example

#include <QN8066.h>
QN8066 tx;
void setup() {
tx.setup();
tx.setTX(1069); // Set the transmitter to 106.9 MHz
tx.setTxOffAfterOneMinuteNoAudio(false); // Do not sleep after 1 minute with no audio
}
void loop() {
}
void setTxOffAfterOneMinuteNoAudio(bool value)
Set of 1 minute time for PA off when no audio.
Definition: QN8066.cpp:952

◆ setTxOffAfterOneMinute()

void QN8066::setTxOffAfterOneMinute ( uint8_t  value)

Sets PA Off after 1 minute time when no audio.

do almost the same setTxOffAfterOneMinuteNoAudio

Parameters
value(3 = Infinity (never turn it off); 2 = off after 59s; 1 = off after 58s; 0 = off after 57s )

Example

#include <QN8066.h>
QN8066 tx;
void setup() {
tx.setup();
tx.setTX(1069); // Set the transmitter to 106.9 MHz
tx.setTxOffAfterOneMinute(3); // Never sleep
}
void loop() {
}
void setTxOffAfterOneMinute(uint8_t value)
Sets PA Off after 1 minute time when no audio.
Definition: QN8066.cpp:979

◆ setAudioAnalogGain()

void QN8066::setAudioAnalogGain ( uint8_t  value)

Sets volume control gain of analog portion.

Valid values are 0 to 7.

Parameters
value

Example

#include <QN8066.h>
QN8066 tx;
void setup() {
tx.setup();
tx.setTX(1069); // Set the transmitter to 106.9 MHz
tx.setAudioAnalogGain(5); // -24 dB
}
void loop() {
}
void setAudioAnalogGain(uint8_t value)
Sets volume control gain of analog portion.
Definition: QN8066.cpp:1006

◆ setAudioDigitalGain()

void QN8066::setAudioDigitalGain ( uint8_t  value)

Sets set digital volume gain.

Valid values are 0 to 5.

Parameters
value

Example

#include <QN8066.h>
QN8066 tx;
void setup() {
tx.setup();
tx.setTX(1069); // Set the transmitter to 106.9 MHz
tx.setAudioDigitalGain(3); // -3 dB
}
void loop() {
}
void setAudioDigitalGain(uint8_t value)
Sets set digital volume gain.
Definition: QN8066.cpp:1036

◆ setAudioDacHold()

void QN8066::setAudioDacHold ( bool  value)

DAC output control.

If value is 0 (false), then "Normal operation"; if true, Hold DAC output to a fixed voltage.

Parameters
value(true or false)

Example

#include <QN8066.h>
QN8066 tx;
void setup() {
tx.setup();
tx.setTX(1069); // Set the transmitter to 106.9 MHz
tx.setAudioDacHold(false); // Normal operation
}
void loop() {
}
void setAudioDacHold(bool value)
DAC output control.
Definition: QN8066.cpp:1066

◆ setAudioTxDiff()

void QN8066::setAudioTxDiff ( bool  value)

Tx audio input mode selection.

If value is 0 (false), then "Single ended"; if true, Differential

Parameters
value(true or false)

Example

#include <QN8066.h>
QN8066 tx;
void setup() {
tx.setup();
tx.setTX(1069); // Set the transmitter to 106.9 MHz
tx.setAudioTxDiff(true); // Differential
}
void loop() {
}
void setAudioTxDiff(bool value)
Tx audio input mode selection.
Definition: QN8066.cpp:1094

◆ setTxInputImpedance()

void QN8066::setTxInputImpedance ( uint8_t  value)

TX mode input impedance for both L/R channels.

Sets the imput impedance Left and Rihgt channels

RIN Value Input impedance (k)
00 (0) 10
01 (1) 20
10 (2) 40
11 (3) 80
Parameters
value(true or false)
See also
Data Sheet - Quintic - QN8066 - Digital FM Transceiver for Portable Devices, pag. 35

Example

#include <QN8066.h>
QN8066 tx;
void setup() {
tx.setup();
tx.setTX(1069); // Set the transmitter to 106.9 MHz
tx.setTxInputImpedance(0); // 10 K Ohms
}
void loop() {
}
void setTxInputImpedance(uint8_t value)
TX mode input impedance for both L/R channels.
Definition: QN8066.cpp:1132

◆ setTxDigitalGain()

void QN8066::setTxDigitalGain ( uint8_t  value)

TX digital gain.

TX digital gain

TXAGC_GDB Digital gain
00 (0) 0 dB
01 (1) 1 dB
10 (2) 2 dB
11 (3) Reserved
Parameters
value
See also
Data Sheet - Quintic - QN8066 - Digital FM Transceiver for Portable Devices, pag. 35

Example

#include <QN8066.h>
QN8066 tx;
void setup() {
tx.setup();
tx.setTX(1069); // Set the transmitter to 106.9 MHz
tx.setTxDigitalGain(2); // 2dB
}
void loop() {
}
void setTxDigitalGain(uint8_t value)
TX digital gain.
Definition: QN8066.cpp:1170

◆ setTxInputBufferGain()

void QN8066::setTxInputBufferGain ( uint8_t  value)

TX input buffer gain.

Sets TX input buffer gain

TXAGC_GVGA Attenuation depending on RIN - 0, 1, 2 AND 3 RESPECTIVELY
0 - 000 3; -3; -9; -15
1 - 001 6; 0; -6; -12
2 - 010 9; 3; -3; -9
3 - 011 12; 6; 0; -6
4 - 100 15; 9; 3; -3
5 - 101 18; 12; 6; 0
Others Reserved
Parameters
value
See also
Data Sheet - Quintic - QN8066 - Digital FM Transceiver for Portable Devices, pag. 35

Example

#include <QN8066.h>
QN8066 tx;
void setup() {
tx.setup();
tx.setTX(1069); // Set the transmitter to 106.9 MHz
tx.setsetTxInputImpedance(0); // Sets the input impedance to 10 Kohms
tx.setTxInputBufferGain(5); // Now the Gain will be 18dB
}
void loop() {
}
void setTxInputBufferGain(uint8_t value)
TX input buffer gain.
Definition: QN8066.cpp:1210

◆ setTxSoftClippingEnable()

void QN8066::setTxSoftClippingEnable ( bool  value)

TX soft clipping enable.

Parameters
value(true = enabled; false = disabled)

Example

#include <QN8066.h>
QN8066 tx;
void setup() {
tx.setup();
tx.setTX(1069); // Set the transmitter to 106.9 MHz
tx.setTxSoftClippingEnable(true); // Enabled
}
void loop() {
}
void setTxSoftClippingEnable(bool value)
TX soft clipping enable.
Definition: QN8066.cpp:1238

◆ setTxFrequencyDerivation()

void QN8066::setTxFrequencyDerivation ( uint8_t  value)

Specify total TX frequency deviation.

TX frequency deviation = 0.69KHz*TX_FEDV. The default value is 108 (Binary: 01101100)

Parameters
value

Example

#include <QN8066.h>
QN8066 tx;
void setup() {
tx.setup();
tx.setTX(1069); // Set the transmitter to 106.9 MHz
tx.setTxFrequencyDerivation(120); // About +- 84 kHz
}
void loop() {
}
void setTxFrequencyDerivation(uint8_t value)
Specify total TX frequency deviation.
Definition: QN8066.cpp:1266

◆ setPAC()

void QN8066::setPAC ( uint8_t  PA_TRGT)

PA output power target control.

PA output power target is 0.91*PA_TRGT+70.2dBu. .

Parameters
pacValue

Example

#include <QN8066.h>
QN8066 tx;
void setup() {
tx.setup();
tx.setTX(1069); // Set the transmitter to 106.9 MHz
tx.setPAC(56); //
}
void loop() {
}
void setPAC(uint8_t PA_TRGT)
PA output power target control.
Definition: QN8066.cpp:1290

◆ updateTxSetup()

void QN8066::updateTxSetup ( )

Reset the system kepping the TX current STATUS.

Some functions do not affect the system when the TX mode is on. In this case, you must use these functions after configuring certain parameters.

Todo:
Make it work - Under construction

◆ setToggleTxPdClear()

void QN8066::setToggleTxPdClear ( )

TX Audio peak clear signal.

Audio peak value is max-hold and stored in aud_pk (see STATUS register). Once TXPD_CLR is toggled, the aud_pk value is cleared and restarted again

Example

#include <QN8066.h>
QN8066 tx;
void setup() {
tx.setup();
tx.setTX(1069); // Set the transmitter to 106.9 MHz
}
void loop() {
}
void setToggleTxPdClear()
TX Audio peak clear signal.
Definition: QN8066.cpp:1374

Referenced by QN8066::resetAudioPeak().

◆ getAudioPeakValue()

int QN8066::getAudioPeakValue ( )

Audio peak value at ADC input.

Audio peak value at ADC input is aud_pk * 45mV. See STATUS3 register.

Returns
integer value result of aud_pk * 45 (in mV).

Example

#include <QN8066.h>
QN8066 tx;
void setup() {
tx.setup();
tx.setTX(1069); // Set the transmitter to 106.9 MHz
int audioPeak = tx.getAudioPeakValue(); // Stores the current audio peak value
...
}
void loop() {
}
int getAudioPeakValue()
Audio peak value at ADC input.
Definition: QN8066.cpp:1403

References QN8066::getStatus3().