uSDR-pico/README.md

58 wiersze
4.7 KiB
Markdown
Czysty Zwykły widok Historia

2021-04-03 19:36:34 +00:00
# uSDR-pico
2021-04-19 06:40:48 +00:00
A uSDR implementation based on a RP2040 Pi Pico.
2021-04-19 06:40:26 +00:00
This code is experimental, intended to investigate how the HW and SDK work with an application like this. So download and play with it, ask questions and suggest improvements, but do not expect any kind of "product" support.
2021-04-03 20:04:54 +00:00
This is the repository for an experimental implementation of the control and signal processing for a QSD/QSE based transceiver. The platform used is a Pi Pico module with an RP2040 processor. This processor has dual core, running at 125MHz each and very configurable I/O which eases the HW design.
2021-05-15 20:28:41 +00:00
The software is distributed over two cores, core0 takes care of all user I/O and control functions, while core1 performs all signal processing. The core1 functionality consists of a TX-branch and an RX-branch, each called from a function that waits for inter-core FIFO words popping out. This happens every 16usec, because on core0 a 16usec timer callback ISR pushes the RX/TX status into that FIFO. Hence the signal processing rythm on core1 effectively is 62.5kHz.
On core1 the three ADC channels are continuously sampled at maximum speed in round-robin mode. Samples are therefore taken every 6usec for each channel, maximum delay between I and Q channels is 2usec, which has a negligible effect in the audio domain.
The TX-branch
- takes lates audio audio sample input from ADC2 (rate = 62.5 kHz),
- applies a low-pass filter at Fc=3kHz,
- reduces sampling by 2 to get better low frequency response Hilbert xform (rate = 31.25 kHz),
2021-04-03 20:04:54 +00:00
- splits into an I-channel 7 sample delay line and a Q-channel 15-tap DHT
2021-05-15 20:28:41 +00:00
- scales and outputs I and Q samples on PWM based DACs, towards QSE output
2021-04-11 10:06:59 +00:00
2021-05-15 20:28:41 +00:00
The RX-branch
- takes latest I and Q samples from QSD on ADC0 and ADC1 (rate = 62.5 kHz)
- applies a low-pass filter at Fc=3kHz,
- reduces sampling by 2 to get better low frequency response Hilbert xform (rate = 31.25 kHz),
2021-04-03 20:04:54 +00:00
- applies 15-tap DHT on Q channel and 7 sample delay on I channel
2021-05-15 20:28:41 +00:00
- subtracts I and Q samples
- scales and outputs audio on an PWM based DAC, towards audio output
2021-04-03 20:04:54 +00:00
2021-05-15 20:28:41 +00:00
On core0 the main loop takes care of user I/O, all other controls and the monitor port. There is also a LED flashing timer callback functioning as a heartbeat.
2021-04-03 20:04:54 +00:00
2021-04-11 10:08:30 +00:00
The Pico controls an Si5351A clock module to obtain the switching clock for the QSE and QSD. The module outputs two synchronous square wave clocks on ch 0 and 1, whith selectable phase difference (0, 90, 180 or 270 degrees). The clock on ch2 is free to be used for other goals. The module is controlled over the **i2c1** channel.
The display is a standard 16x2 LCD, but with an I2C interface. The display is connected through the **i2c0** channel.
2021-04-03 20:04:54 +00:00
2021-04-07 08:46:07 +00:00
## Open issues:
2021-04-07 09:03:54 +00:00
- [x] take care of processing cycles, by moving signal processing parts to the second core
2021-04-19 06:42:29 +00:00
- [X] add some more filtering
2021-04-19 20:13:56 +00:00
- [x] implement the user I/O bit: LCD+Rotary encoder+buttons
2021-04-19 06:42:29 +00:00
- [ ] implement AGC and RSSI
2021-04-19 20:16:12 +00:00
- [ ] implement other modes than USB
2021-04-07 09:03:54 +00:00
- [ ] sort out the surrounding HW
2021-04-19 20:16:12 +00:00
- [ ] maybe design a PCB?
2021-04-03 20:04:54 +00:00
2021-04-07 08:46:07 +00:00
## Installing and using the SDK for Windows:
Please refer to https://github.com/ndabas/pico-setup-windows/releases where the latest installer can be downloaded (e.g. **pico-setup-windows-0.3-x64.exe**).
Execute the installer to set up the SDK environment, e.g. in **~/Documents/Pico** (let's call this folder $PICO).
2021-04-03 20:18:44 +00:00
2021-04-07 08:46:07 +00:00
## Building uSDR-pico:
Clone/copy the uSDR-pico code files into a subdirectory, e.g. **$PICO/uSDR-pico**
Create the build folder: **$PICO/uSDR-pico/build**
2021-05-15 19:13:19 +00:00
Before doing any building you need to adapt the file **$PICO/uSDR-pico/CMakeLists.txt**, using your favourite browser, to reflect your own directory structure. Also, select whether you want **stdio** to use the UART on pins 1 and 2 or the USB serial port. The monitor terminal is on **stdio**.
2021-04-07 08:53:23 +00:00
In **$PICO/** you will find a command to start a Developer Command Prompt window. Within this DCP all environment settings are initialized to enable building.
In the DCP window, chdir to the build folder and execute: **cmake -G "NMake Makefiles" ..**
Now you have initialized the make environment, and by executing **nmake** in that same build folder, the Pi Pico loadable file **uSDR.uf2** is created.
Rebooting the Pico while the bootsel button is pressed will open a file explorer window with the Pico as a Mass Storage Device. Moving the binary to the Pico is as easy as dragging and dropping this uf2 file into that MSD.
2021-04-03 20:18:44 +00:00
2021-04-07 08:46:07 +00:00
# Background
2021-04-07 08:58:18 +00:00
The folder **$PICO/docs** also contains some manuals, of which the *C-SDK description*, the *RP2040 datasheet* and the *Pico Pinout* are absolute must-reads when you start writing software.
2021-04-07 08:53:23 +00:00
For calculating filters I have used the free software from Iowa Hills (http://www.iowahills.com/8DownloadPage.html)
I also used the online FIR filter calculator T-Filter (http://t-filter.engineerjs.com/)
2021-04-07 08:46:07 +00:00