I am currently doing experiments with the Elektor-SDR and the software from Frank.
I have noticed that the Teensy 4 emits HF, and tried to minimize the HF-radiation by optimizing the settings.
The most important thing was to increase the BUS frequency (150MHZ at 600MHZ CPU clock):
Code:
CCM_CBCDR = (CCM_CBCDR & ~CCM_CBCDR_IPG_PODF_MASK) | CCM_CBCDR_IPG_PODF(1); //Overclock IGP = F_CPU_ACTUAL / 2 (300MHz Bus for 600MHz CPU)
Beyond that, I continued experimenting.
The following code changes the cpu-clock-source to PLL2. This PLL has the option "Spread spectrum" which should further minimize the radiation. (A disadvantage is that the CPU speed can't be controlled in small steps anymore). The code below sets 594MHz. The no longer needed PLL 1 is switched off.
There are commented out lines in it that turn off some parts of the CPU. They might be helpful too.
Code:
#define USE_T4_PLL2
void init_cpu()
{
CCM_ANALOG_PLL_SYS_SS = 0xfffff000; //enable spread spectrum for PLL2. TODO: Find best value.
//Disable some parts:
//CCM_ANALOG_PFD_528_SET = (1 << 31) | (1 << 15) ; //Disable PLL2: PFD3, PFD1 (not needed)
//CCM_ANALOG_PFD_480_SET = (1 << 31) | (1 << 23) | (1 << 15); //Disable PLL3: PFD3, PFD2, PFD1 (not needed)
CCM_CCGR1 &= ~CCM_CCGR1_ADC1(CCM_CCGR_ON); //Disable ADC1
CCM_CCGR1 &= ~CCM_CCGR1_ADC2(CCM_CCGR_ON); //Disable ADC2
#ifdef USE_T4_PLL2
set_arm_clock(594'000'000);
F_BUS_ACTUAL = 594'000'000 / 2;
CCM_ANALOG_PFD_528_CLR = (0x3f << 16);
CCM_ANALOG_PFD_528_SET = (0x10 << 16);
CCM_CBCDR |= CCM_CBCDR_PERIPH_CLK_SEL;
while (CCM_CDHIPR & CCM_CDHIPR_PERIPH_CLK_SEL_BUSY) ; // wait
CCM_CBCMR &= ~(1 << 19); //ARM - Clock Source PLL2 - PFD0
CCM_CBCDR &= ~CCM_CBCDR_PERIPH_CLK_SEL;
while (CCM_CDHIPR & CCM_CDHIPR_PERIPH_CLK_SEL_BUSY) ; // wait
CCM_ANALOG_PLL_ARM &= ~(1 << 12); //Disable ARM-PLL
#endif
CCM_CBCDR = (CCM_CBCDR & ~CCM_CBCDR_IPG_PODF_MASK) | CCM_CBCDR_IPG_PODF(1); //Overclock IGP = F_CPU_ACTUAL / 2 (297MHz Bus for 594MHz CPU)
}
Next Step would be to try to reduce the CPU Voltage now..
I don't own equipment to measure ift these additional things are hepful or not( the Overclock IGP helped!!). I have the feeling the additional Steps helped too - but that's very subjective and I'm biased, maybe.
Edit: ILI9341_t3n allows to set the used SPI-Frequency (tft.begin(xxx, yyy)) - I'd choose the highest frequency possible - For higher speeds, it helps to add 100OHM to SCLK and MOSI)