F5OEO / librpitx

Radio frequency transmitter library - Engine of rpitx
GNU General Public License v3.0
87 stars 35 forks source link

Which specific GPIO pins can be used for RF output #9

Open erichVK5 opened 5 years ago

erichVK5 commented 5 years ago

I have built a single band RPi WSPR shield which is successfully transmitting. I would like to design a multi band shield, where each band is generated by a different GPIO pin. How many distinct pins are available for RF output, and which pins are they on the header?

I think I will be able to modify the code to allow all this to work, but want to confirm how many pins can be used for distinct RF outputs before working on the new board.

Regards Erich VK5HSE

erichVK5 commented 5 years ago

I have reviewed the code, specifically the function

gpio.cpp:559 void clkgpio::enableclk(int gpio)

which allows for GPIO pins 4, 20, 32, 34 and it seems 6, to be selected as the output, although line 580

dbg_printf(1, "gpio %d has no clk - available(4,20,32,34)\n", gpio);

suggests otherwise regarding GPIO6.

Based on standard pinouts for the RPi, and the following thread

https://www.raspberrypi.org/forums/viewtopic.php?t=118711

It seems that pins 32 and 34 are not physically accessible.

In conclusion, it seems that GPIO4 and GPIO20 can be used on standard RPi boards, but not pins 32 or 34. Is GPIO6 also supported?

If you could confirm my conclusion re GPIO{4, 20, 32, 34} and clarify Re: GPIO 6, I would be much obliged.

Regards, Erich VK5HSE

F5OEO commented 5 years ago

Hi Erich,

Well analyzed : GPIO 4 and 20 are available for CLK0 on GPIO header. GPIO 32 and 34 are not accessible. I let them here because it is available on compute module.

GPIO6 is for CLK2 , accessible on the GPIO pin header, however, this CLK2 is used by Wifi. It could be used only if you don't use Wifi !

For multiband, I used the solution of a multiband selector (command by GPIO). For now I use SV1AFN band filter selector. With this solution, I need only one output from GPIO.

Let me know if this kind of solution is not suitable for your needs.

73 Evariste

erichVK5 commented 5 years ago

Thanks for the detailed reply. I think two clock sources will be adequate for most users keen to transmit on a pair of bands at very low cost and minimal complexity (i.e. also ideal for STEM settings).

My current design is much like Bruce Raymond's (ND8I) design. I will create a new version of the shield, supporting two bands, with duplication of the buffer amplifiers and LPF sections of the layout, and a BNC output for each band.

I will do two versions of the revised board

1) provide for discrete through hole inductors for the two butterworth filters, aimed mostly at amateurs wanting to transmit on two HF bands with a pair of aerials

2) implement PCB inductors for the 6m and 2m LPFs, aimed at amateurs wanting to transmit WSPR or other modes on these VHF bands with a pair of aerials, who don't like or are scared off by winding coils.

A version of the shield with relay switched filters would be a subsequent project!

73 Erich

F5OEO commented 5 years ago

OK, very nice project as I think that a lot of Hams could be interested in this HAT project. Having two bands is a very good idea. As my latest test, I suggest to power the Raspberry with 5V on GPIO instead of micro-USB : with powering from USB you will see sidebands at +/- N*100Hz at -40dbc, none measured with a 5V GPIO. But you could maybe measure and test to confirm.

6m and 2m will also be great !

erichVK5 commented 5 years ago

vk5hse-wspr-hat-2m-layout-top-view

I'm nearly done on the 2m version here. Enough pins to drive a 8 digit frequency display too

lu7did commented 5 years ago

Hello, I've got a fried GPIO04 pin on one of my beacons and I would like to keep it running it with pift8 but using other pin (I believe GPIO20 can be used as well). Could you provide some insight on what is the best way to implement it? From what I'd reviewed the code all calls to enableclk(4) and disableclk(4) should be changed into enableclk(20) and disableclk(20), I can make an argumento for that on my programs using librpitx however no argument allows this change at pift8. In order to avoid a branch to be created just for that should I add an argument and try to push the code into the repository with that? Other change is needed that I just didn't understood? Thanks, Pedro LU7DID