Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can harmonics help you? #1

Open
mungewell opened this issue Dec 2, 2024 · 6 comments
Open

Can harmonics help you? #1

mungewell opened this issue Dec 2, 2024 · 6 comments

Comments

@mungewell
Copy link

Firstly, nice work.... It takes time to put ideas like this together. Thanks for making your open-source.

My first though when seeing this was APRS, which you mentioned does work (too high freq), but did you think about (ab)using the harmonics?

There's a very interesting video on LoRa:
https://www.youtube.com/watch?v=eIdHBDSQHyw

Also, the PIO blocks can cause interrupts and are clocked by the very same SYS clock... wonder if this would get you easy FSK/PSK?

@mungewell
Copy link
Author

Also you say "Occupies Core1 (can't use for other purposes)"... In my experience the interrupt routine can be run on (randomly) either core!

@thomasabbott
Copy link

@kaduhi here are some spectrum analyser plots to use as you wish. Demo FM radio transmitter uf2. Direct from pin 21 to the 50 ohm input of the analyser. Battery powered so there's no computer noise (but possibly the code still sends some audio, RDS, I didn't look)
https://imgur.com/a/sARW8wO

There's a strong third harmonic, easily filtered. But also a fine structure in the 87.5 MHz nominal tone, making it quite wide and messy. Still sounds good on the radio.

@kaduhi
Copy link
Owner

kaduhi commented Dec 9, 2024

Hi @thomasabbott
Thank you for measuring the spectrum of the output signal.
Since I'm not an expert, I cannot interpret them very well, but the many spurious in the 500kHz span are concerned me.
Is it possible to measure several different mode in same condition? e.g. compare between my library, pico-hf-oscillator library output signal at exact same frequency (e.g. 14097100Hz)? If you are ok, I can prepare such test apps (in .uf2 files) and send them to you. I'm really curious.
Thank you,
Kazu.

@kaduhi
Copy link
Owner

kaduhi commented Dec 9, 2024

Hi @mungewell

My first though when seeing this was APRS, which you mentioned does work (too high freq), but did you think about (ab)using the harmonics?

Thank you for the info, no, I haven't thought about using harmonics, because for my use cases all I need is FM (or FSK) modulated RF signal up to 150MHz.

There's a very interesting video on LoRa: https://www.youtube.com/watch?v=eIdHBDSQHyw

Oh, this is interesting... I just watched the first 5 min, I will watch entire video tomorrow. I have very little knowledge about LoRa, so this is good info. Thank you.

Also, the PIO blocks can cause interrupts and are clocked by the very same SYS clock... wonder if this would get you easy FSK/PSK?

I really need an interrupt that is in sync with the 12MHz XO clock that is the reference clock of the PLL.
Also, the M0+ sys tick interrupt is actually an exception and higher priority than any other regular interrupts, that's the reason I choose that.

Also you say "Occupies Core1 (can't use for other purposes)"... In my experience the interrupt routine can be run on (randomly) either core!

I use the separate interrupt vector table for Core0 and Core1, so no longer "(randomly) either core".

Thank you,
Kazu.

@thomasabbott
Copy link

Hi @thomasabbott Thank you for measuring the spectrum of the output signal. Since I'm not an expert, I cannot interpret them very well, but the many spurious in the 500kHz span are concerned me. Is it possible to measure several different mode in same condition? e.g. compare between my library, pico-hf-oscillator library output signal at exact same frequency (e.g. 14097100Hz)? If you are ok, I can prepare such test apps (in .uf2 files) and send them to you. I'm really curious. Thank you, Kazu.

Hi, yes the harmonics and spurs are to be expected, but I was also surprised by how noisy it looked close-in. It's possible some of that comes from the FM you're doing deliberately, even if there's no USB sound source?

Possible sources of this 10 kHz - 40 kHz - 200 - 300 kHz modulation:

  • Power supply or other external noise (I used batteries but didn't disable the SMPS, next time I'll feed it 3.3 V)
  • Internal coupling from all sort of things running in the processor
  • Spread-spectrum mode deliberately spreading the clock, they use >40 kHz to make it wider than the EMC test spec.
  • Actual bad behavior of the VCOs in the PLL

Useful tests I think would include:

  1. Processor and clocks all running at a similar speed but no output, no adjustments to the PLL divider
  2. Chip running the full non-integer algorithm but PIO not driving the pin, just set it High and leave it high
  3. PIO output of a clean tone, i.e. an existing ratio that it can generate without fast-adjustments
  4. PIO output of a PLL clock. Full algorithm running, but skip the actual writes so the clock stays at a fixed freq
  5. The whole thing, producing a non-integer frequency (already measured)

I'd prefer not to set up to build these, if you can... either a series of uf2s or some sort of mode switch by reading GPIOs or one potentiometer. Then I'll measure some spectra. I don't think the raw non-integer division (rpiks) is worth comparing, when I did look at it, it was very messy.

Did you test the PLL loop bandwidth somehow? I can imagine doing that by toggling between two frequencies, one step apart, faster and faster, watching the spectrum, until the two tones and spurs turn into a single tone. I wonder if the act of writing to the register generates a very short spike in the feedback path (it's unlikely to be gray-coded so perhaps several bits have to flip). This spike may be large, and not well filtered as it's never intended to operate like that...

Final thought - if you are generating the spurs with your technique, perhaps you can "whiten" their spectrum by adding some randomness to the changes you make - the magnitude and the time you apply them, even at the expense of accuracy. We'lll see.

@kaduhi
Copy link
Owner

kaduhi commented Dec 11, 2024

Hi @thomasabbott

I will create a test app with menu system on USB Serial so you can choose the different modes.
I will include all your suggested modes.
I will try to create the app this weekend (if I have enough time), then send you a .uf2 file.

Thank you for your help!
Kazu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants