Compare commits
35 commits
Author | SHA1 | Date | |
---|---|---|---|
1fe4633601 | |||
347582cfc1 | |||
49cf85006d | |||
f866c97fcb | |||
82c1c12195 | |||
5868a1ade9 | |||
3410740b4a | |||
6b444587b6 | |||
7382677af8 | |||
71543c70da | |||
2068d3a01f | |||
0db366b602 | |||
f5fb02c190 | |||
24d6acdb53 | |||
f7d2dd3629 | |||
f294b09c98 | |||
178ba7bee0 | |||
63ca3c6439 | |||
884d84bbf9 | |||
5a9a0f7acc | |||
b52f772845 | |||
8974b812f2 | |||
3054904768 | |||
821cd9189d | |||
9997b63c7e | |||
518d6f55db | |||
4e6a29abbc | |||
09b4c2c169 | |||
34a4df9b1a | |||
dd66571945 | |||
bc96b5a9ee | |||
0e1fc91279 | |||
eaad670abb | |||
574c474c6e | |||
38b7ec34f6 |
5 changed files with 495 additions and 428 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,2 +1,3 @@
|
|||
/build/
|
||||
/grc/*.py
|
||||
/src/.clangd
|
||||
|
|
|
@ -2,11 +2,13 @@
|
|||
|
||||
Using RP2040 / Raspberry Pi Pico as a software-defined radio receiver.
|
||||
|
||||
See the [blog post](https://blog.porucha.net/2024/pico-sdr/) for more information. Older code the article is mostly referring to can be found in the branch `old`.
|
||||
See the [blog post](https://blog.porucha.net/2024/pico-sdr/) for more information. Older code the article is mostly referring to can be found in the branch `old` and a more up-to-date approach in the branch `master`.
|
||||
|
||||
This branch contains code to use RP2040 and some passives as a superheterodyne receiver. It is still very much work in progress.
|
||||
|
||||
## Circuit
|
||||
|
||||
![](circuit.svg)
|
||||
Please refer to [the simulation](https://www.falstad.com/circuit/circuitjs.html?ctz=CQAgjCBMB0CsCmBaMAGEAOW0AsLboHYA2SWSIsWMIkAtFaFFCWNBZMAKEoE5wV06ENiE8ekYULZpUTOfM4BzfoMnhU2NfU4AlED2ybERTeh41jmmfpHyZ0IrHAOn9OJ0goC4AMyQhiOa+RGiBNE4AkgBi3ESihiBh-LiJQehgBlAgPtA+INp6BkZ+NprUwiBOPnZy2bn5DQywnABOtGSJGRIEHUkydpwA7smhXSOpNCicAMaVIRMgjhZBMkjeyA7YYjzoXiGwPuJGYC6cADaLsMs0PRJ9+Yzy288vz4k5B8REPGAi2HSQHzoNb5GbtO5BW6NcBIIQnEzbIgmMCQOiwWDEZyOJTghpQ8raYZQpLoEQLKbDUkBIJFcmtbJxBbYEzkypTTwQVEQmiQSBGFY2ELySS1BhPV4SsTgcRyTgRcbIcSlTpK6w5HxDOahIJXNBkqYANygBG5DOpk3AGHQnmF9Ea7jaGm1NDAYB81warBxbv8DR9cItU1m-oWIbtYFhiTFzDi4lYkDA1oIQJQVnO4EBppD92jcklkqjj2YifQPhN5BIBgIgm8FOViokVJVEjrTYbuPbUwARhgiOs+TJsK79LXOAAPXtORCkPgGPjTq4VPkgHQABU8uHHtBNiU8eWtRhtFXKAHFVxEAPIAHQAzs0J8R56gaNaIMgUHkyjQz5fb+hNU6iQsoBJR1mIEhkrqWhbgQBAQIcGCAsIEHgN+57XjePCalBSTMvykycD2GRvpQEDMnkiBAqCE7ugE1A0ORnREJ+UCaAAggAdgALvAHEcQAhmCrruqGmasrmTAQPCQJXL8sDiD4PhuhiWLNAA9tklQon6PiwNgPhWHAZZIjsyImO6PCuEWEBoBIeQakAA).
|
||||
|
||||
## Software
|
||||
|
||||
|
@ -32,4 +34,4 @@ See the [blog post](https://blog.porucha.net/2024/pico-sdr/) for more informatio
|
|||
|
||||
4. Open `grc/PicoSDR-WBFM.grc` in GNU Radio Companion, adjust carrier frequency to match your favorite FM radio station and press `F6`.
|
||||
|
||||
5. Alternatively [gqrx](https://www.gqrx.dk/) works fine with `rtl_tcp` input mode. Maximum sample rate seem to be 400 ksps, above that the samples are dropped. Make sure to adjust LNA gain to +30 dB. It's not accurate, but it does control bias strength which in turn does affect analog gain.
|
||||
5. Alternatively [gqrx](https://www.gqrx.dk/) works fine with `rtl_tcp` input mode. Maximum sample rate seem to be 400 ksps, above that the samples are dropped. Make sure to set LNA gain to 0, gain control is digital and does not provide any benefits unless you lower your sampling rate significantly.
|
||||
|
|
862
src/main.c
862
src/main.c
File diff suppressed because it is too large
Load diff
2
src/vendor/pico-stdio-usb-simple
vendored
2
src/vendor/pico-stdio-usb-simple
vendored
|
@ -1 +1 @@
|
|||
Subproject commit b6b09e34b844326a156bc6734146a88111138473
|
||||
Subproject commit ed4858dda407ec66626aade9b7c6ad6016539f4c
|
50
tools/clangd.py
Normal file
50
tools/clangd.py
Normal file
|
@ -0,0 +1,50 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os.path
|
||||
import sys
|
||||
from glob import glob
|
||||
|
||||
import click
|
||||
import yaml
|
||||
|
||||
|
||||
@click.command()
|
||||
def clangd():
|
||||
"""Generate .clangd file for local development."""
|
||||
|
||||
assert "PICO_SDK_PATH" in os.environ, "PICO_SDK_PATH not set"
|
||||
|
||||
pico_sdk_path = os.path.realpath(os.environ["PICO_SDK_PATH"])
|
||||
cwd = os.path.realpath(os.getcwd())
|
||||
|
||||
includes = [
|
||||
*glob(f"{pico_sdk_path}/src/common/*/include"),
|
||||
*glob(f"{pico_sdk_path}/src/rp2040/*/include"),
|
||||
*glob(f"{pico_sdk_path}/src/rp2_common/*/include"),
|
||||
f"{pico_sdk_path}/lib/tinyusb/src",
|
||||
*glob(f"{cwd}/src/**/include", recursive=True),
|
||||
f"{cwd}/build/generated/pico_base",
|
||||
f"{cwd}/build/sdk",
|
||||
]
|
||||
|
||||
flags = [
|
||||
"-Wall",
|
||||
"-Wextra",
|
||||
"-xc",
|
||||
"-DCFG_TUSB_MCU=OPT_MCU_RP2040",
|
||||
"-I/usr/arm-none-eabi/include",
|
||||
]
|
||||
|
||||
yaml.safe_dump(
|
||||
{
|
||||
"CompileFlags": {
|
||||
"Compiler": "arm-none-eabi-gcc",
|
||||
"Add": [*flags, *[f"-I{inc}" for inc in includes]],
|
||||
}
|
||||
},
|
||||
sys.stdout,
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
clangd()
|
Loading…
Reference in a new issue