stefanodi
Member
Hi, after solving the code to generate the amplitude modulation in a radio transmitter (thanks again Bob!), Now I ask for help to solve the problem of the harmonic generated by the 11025Khz oscillator visible in the photo.
I am attaching the schematic of the Tayloe based mixer board designed by my radio friend Giampietro (IK3MAX) which works great in SSB.
I tried some filters (FIR), but the problem remains ... Thanks in advance to those who will help me.
Stefano.
I am attaching the schematic of the Tayloe based mixer board designed by my radio friend Giampietro (IK3MAX) which works great in SSB.
I tried some filters (FIR), but the problem remains ... Thanks in advance to those who will help me.
Stefano.
Code:
/* File: AM_TEST_TX-FORUM-1.ino
* Project's name: "Old Style A.M. RTX"
* Initial project request by Stefano Homebrew
* @ https://forum.pjrc.com/forum.php
* Forum code by BOB LARKIN
* Developed for Teensy 4.0 https://www.pjrc.com/teensy/
* Audio shield PCM1808 & PCM5102A
*/
//****
#include <Wire.h>
#include <si5351.h>
#include <ILI9341_t3.h>
#include <Audio.h>
#include <SPI.h>
#include <SerialFlash.h>
//****Display ILI9341
#define TFT_DC 9
#define TFT_CS 10
#define TFT_RST 255
#define TFT_MOSI 11
#define TFT_SCLK 13
#define TFT_MISO 12
#define BLACK 0x0000//My alternative colors
#define MARRONE 0x5041//My alternative colors
#define IF_FREQ 11025.0 //15000//****sine gen.
//****var pll frequency init.
volatile long freq = 25000000;//test lab. frequency
volatile uint32_t vfoFreq = 0;//for next implementations
//****var print frequency
byte unita,decine,centinaia,migliaia,decinemigliaia,centmigliaia,milioni ; //variabili stampa freq.
//////////////////////////////////////////////
// GUItool: begin automatically generated code
AudioInputI2S i2s2; //xy=151.66675567626953,142.0000286102295
AudioSynthWaveformDc dc1; //xy=307.6666831970215,73.00003051757812
AudioFilterBiquad biquad1; //xy=309.6666831970215,137.00004863739014
AudioMixer4 mixer1; //xy=490.2820587158203,85.0000228881836
AudioSynthWaveform waveform1; //xy=493.12828826904297,186.00009155273438
AudioEffectMultiply multiply1; //xy=722.4359931945801,84.15388488769531
AudioOutputI2S i2s1; //xy=1117.6666526794434,77.00004529953003
AudioConnection patchCord1(i2s2, 0, biquad1, 0);
AudioConnection patchCord2(dc1, 0, mixer1, 0);
AudioConnection patchCord3(biquad1, 0, mixer1, 1);
AudioConnection patchCord4(mixer1, 0, multiply1, 0);
AudioConnection patchCord5(waveform1, 0, multiply1, 1);
AudioConnection patchCord6(multiply1, 0, i2s1, 0);
AudioControlSGTL5000 sgtl5000_1; //xy=312.6666679382324,200.00005531311035
// GUItool: end automatically generated code
//*******
ILI9341_t3 tft=ILI9341_t3(TFT_CS, TFT_DC, TFT_RST, TFT_MOSI, TFT_SCLK, TFT_MISO);
Si5351 si5351;
//************************
void setup() {
Serial.begin(9600);
//****init ILI9341
tft.begin();
tft.setRotation(3);
tft.fillScreen(ILI9341_BLACK);
//*****DISPLAY REM
tft.setCursor(2, 232);
tft.setTextColor(ILI9341_GREEN, ILI9341_BLACK);
tft.setTextSize(1);
tft.print("AM_TEST_TX-FORUM-1");
//*****PLL SET
si5351.init(SI5351_CRYSTAL_LOAD_8PF, 0, 0);
si5351.set_correction(210000, SI5351_PLL_INPUT_XO);//My XTAL correction
si5351.set_pll(SI5351_PLL_FIXED, SI5351_PLLA);
si5351.drive_strength(SI5351_CLK2, SI5351_DRIVE_6MA);
si5351.set_freq((freq-IF_FREQ) * 400ULL, SI5351_CLK2);
//*****Audio shield SETUP**************************************************
AudioNoInterrupts();
AudioMemory(16);
sgtl5000_1.enable();
sgtl5000_1.inputSelect(AUDIO_INPUT_LINEIN);
sgtl5000_1.volume(1.0);
waveform1.begin(1.0f,IF_FREQ,WAVEFORM_SINE);
dc1.amplitude(0.5f);//*****************************livello modulazione
mixer1.gain(0,1.0f);
mixer1.gain(1,1.0f);
biquad1.setLowpass(0,8000,0.7);//passa basso
biquad1.setHighpass(1,100,0.7);//passa alto
AudioInterrupts();
delay(100);
stampafrq();
}
//****Setup End
void loop() {
}
//***************PRINT @frequency DISPLAY
void stampafrq()
{
vfoFreq=freq; ///////////////////////////////////////////////////
milioni = int(vfoFreq/1000000);
centmigliaia = ((vfoFreq/100000)%10);
decinemigliaia = ((vfoFreq/10000)%10);
migliaia = ((vfoFreq/1000)%10);
centinaia = ((vfoFreq/100)%10);
decine = ((vfoFreq/10)%10);
unita = ((vfoFreq/1)%10);
//******************************************
tft.fillRect(112, 44, 169, 32, BLACK);
tft.setTextSize(3);
tft.setCursor(121,44);
tft.setTextColor(ILI9341_WHITE);
tft.print(milioni);//
tft.print(".");
tft.print(centmigliaia);
tft.print(decinemigliaia);
tft.print(migliaia);
tft.print(".");
tft.print(centinaia);
tft.print(decine);
}