Compare commits

..

3 commits
qsd ... master

Author SHA1 Message Date
4ce91c54b3 Fix frequency rounding 2024-08-02 20:34:51 +02:00
a78bdc509f Bunch of fixes and improvements
- Use less DMAs
- Improve bit counting
- Fix sample_rate changes and other fixes
2024-08-02 19:33:15 +02:00
2bd44e45df Track vendor/pico-stdio-usb-simple 2024-08-02 15:41:03 +02:00
7 changed files with 324 additions and 626 deletions

1
.gitignore vendored
View file

@ -1,3 +1,2 @@
/build/ /build/
/grc/*.py /grc/*.py
/src/.clangd

View file

@ -2,9 +2,11 @@
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` and a more up-to-date approach in the branch `master`. 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`.
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
![](circuit.svg)
## Software ## Software
@ -30,4 +32,4 @@ This branch contains code to use RP2040 with a 1:4 multiplexer and some passives
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 experiment with LNA gain. It might be digital, but it's supposed to be somewhere north of 12 dB. 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.

View file

@ -49,7 +49,7 @@ blocks:
id: variable id: variable
parameters: parameters:
comment: '' comment: ''
value: '200_000' value: '192_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: '6' gain0: '0'
gain1: '10' gain1: '10'
gain10: '10' gain10: '10'
gain11: '10' gain11: '10'

View file

@ -401,7 +401,7 @@ blocks:
freq7: 100e6 freq7: 100e6
freq8: 100e6 freq8: 100e6
freq9: 100e6 freq9: 100e6
gain0: '30' gain0: '0'
gain1: '10' gain1: '10'
gain10: '10' gain10: '10'
gain11: '10' gain11: '10'

File diff suppressed because it is too large Load diff

View file

@ -1,50 +0,0 @@
#!/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()

View file

@ -62,10 +62,6 @@ def bridge(frequency, device):
print("Begin") print("Begin")
header = fp.read(12)
if header:
peer.send(header)
try: try:
cmd = b"" cmd = b""