Compare commits
37 commits
Author | SHA1 | Date | |
---|---|---|---|
06695041ba | |||
c9da22afec | |||
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 |
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,2 +1,3 @@
|
||||||
/build/
|
/build/
|
||||||
/grc/*.py
|
/grc/*.py
|
||||||
|
/src/.clangd
|
||||||
|
|
|
@ -2,11 +2,9 @@
|
||||||
|
|
||||||
Using RP2040 / Raspberry Pi Pico as a software-defined radio receiver.
|
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`.
|
||||||
|
|
||||||
## Circuit
|
This branch contains code to use RP2040 with a 1:4 multiplexer and some passives as a quadrature sampling decoder receiver. It is still very much work in progress.
|
||||||
|
|
||||||
![](circuit.svg)
|
|
||||||
|
|
||||||
## Software
|
## Software
|
||||||
|
|
||||||
|
@ -32,4 +30,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`.
|
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 experiment with LNA gain. It might be digital, but it's supposed to be somewhere north of 12 dB.
|
||||||
|
|
|
@ -49,7 +49,7 @@ blocks:
|
||||||
id: variable
|
id: variable
|
||||||
parameters:
|
parameters:
|
||||||
comment: ''
|
comment: ''
|
||||||
value: '192_000'
|
value: '200_000'
|
||||||
states:
|
states:
|
||||||
bus_sink: false
|
bus_sink: false
|
||||||
bus_source: false
|
bus_source: false
|
||||||
|
@ -374,7 +374,7 @@ blocks:
|
||||||
freq7: 100e6
|
freq7: 100e6
|
||||||
freq8: 100e6
|
freq8: 100e6
|
||||||
freq9: 100e6
|
freq9: 100e6
|
||||||
gain0: '0'
|
gain0: '6'
|
||||||
gain1: '10'
|
gain1: '10'
|
||||||
gain10: '10'
|
gain10: '10'
|
||||||
gain11: '10'
|
gain11: '10'
|
||||||
|
|
|
@ -401,7 +401,7 @@ blocks:
|
||||||
freq7: 100e6
|
freq7: 100e6
|
||||||
freq8: 100e6
|
freq8: 100e6
|
||||||
freq9: 100e6
|
freq9: 100e6
|
||||||
gain0: '0'
|
gain0: '30'
|
||||||
gain1: '10'
|
gain1: '10'
|
||||||
gain10: '10'
|
gain10: '10'
|
||||||
gain11: '10'
|
gain11: '10'
|
||||||
|
|
865
src/main.c
865
src/main.c
File diff suppressed because it is too large
Load diff
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()
|
|
@ -62,6 +62,10 @@ def bridge(frequency, device):
|
||||||
|
|
||||||
print("Begin")
|
print("Begin")
|
||||||
|
|
||||||
|
header = fp.read(12)
|
||||||
|
if header:
|
||||||
|
peer.send(header)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
cmd = b""
|
cmd = b""
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue