Filter Board

1,017 views
Skip to first unread message

Stephen Weston

unread,
Jun 26, 2024, 1:45:00 AM6/26/24
to Radioberry
Hi

I'm new to RPi and Linux, but I have my Radioberry working nicely. I
have a RPi4 with Bookworm 64 bit installed and a CL025 board.

I have the PTT in and out working and the antenna switch and PA
switching going OK. I have a pre-amp and PA to get about 10 watts on all
bands.

I have a LPF board I am currently switching manually. I have a PCA9995A
breakout board, but I am not sure how to connect it to the Radioberry.

I would appreciate any help on hardware connection and software loading
as required. Thanks, 73 Steve VK2YE.

pa3gsb

unread,
Jun 26, 2024, 4:37:47 AM6/26/24
to Radioberry

Hi Steve,

Nice you got it al working.


Use the radioberry io for connecting your filter board.




The firmware for the radioberry controls via the i2c of the RPI your io extender.

Have fun

73 Johan
PA3GSB
Op woensdag 26 juni 2024 om 07:45:00 UTC+2 schreef stephen....@gmail.com:

Stephen Weston

unread,
Jun 26, 2024, 6:53:54 AM6/26/24
to radio...@googlegroups.com

Hi Johan

Thanks for getting back so quickly. I think you missed the first part of my post, "New to RPI" ...lol

I need more detailed instructions. Currently I have SDA from PCA9555A connected to pin 17 of CN301 on the Radioberry and SCL to pin 18.

sudo i2cdetect -y 1 returns the address 0x20.

Where to from here?

Steve, VK2YE

--
You received this message because you are subscribed to the Google Groups "Radioberry" group.
To unsubscribe from this group and stop receiving emails from it, send an email to radioberry+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/radioberry/46c74aa7-2427-410c-9388-3c0129cd52den%40googlegroups.com.

pa3gsb

unread,
Jun 26, 2024, 7:27:53 AM6/26/24
to Radioberry
Steve,

In the firmware 3 types of filter boards are supported.


#define ADDR_N2ADR 0x20 /* N2ADR is controlled using mcp23008*/
#define ADDR_ALEX 0x21 /* PCA9555 address 1 for Alex Interface Board*/
#define ADDR_FILTERS 0x22 /* Arduino filter board interface switcher address for VA2SAJ Generic Filter Switching Board*/

Get your chip to address 0x21.


In the code:

static inline void handleALEX(char* buffer)
{

if (i2c_alex & ((buffer[523] & 0xFE) == 0x12) || ((buffer[11] & 0xFE) == 0x12)) {

if (((buffer[525] & 0x40) == 0x40) ? 1 : 0) {
i2c_alex_data = ((buffer[526] & 0x8F) << 8) | (buffer[527] & 0xFF);
} else if ((((buffer[13] & 0x40) == 0x40) ? 1 : 0)) {
i2c_alex_data = ((buffer[14] & 0x8F) << 8) | (buffer[15] & 0xFF);
}
else {
//firmware does determine the filter.
uint16_t hpf = 0, lpf = 0;

if (currentfreq < 1416000) hpf = 0x20; /* bypass */
else if (currentfreq < 6500000) hpf = 0x10; /* 1.5 MHz HPF */
else if (currentfreq < 9500000) hpf = 0x08; /* 6.5 MHz HPF */
else if (currentfreq < 13000000) hpf = 0x04; /* 9.5 MHz HPF */
else if (currentfreq < 20000000) hpf = 0x01; /* 13 MHz HPF */
else hpf = 0x02; /* 20 MHz HPF */

if (currentfreq > 32000000) lpf = 0x10; /* bypass */
else if (currentfreq > 22000000) lpf = 0x20; /* 12/10 meters */
else if (currentfreq > 15000000) lpf = 0x40; /* 17/15 meters */
else if (currentfreq > 8000000) lpf = 0x01; /* 30/20 meters */
else if (currentfreq > 4500000) lpf = 0x02; /* 60/40 meters */
else if (currentfreq > 2400000) lpf = 0x04; /* 80 meters */
else lpf = 0x08; /* 160 meters */

i2c_alex_data = hpf << 8 | lpf;
}
}
if (i2c_alex)
{
if (i2c_data != i2c_alex_data)
{
fprintf(stderr, "Set Alex data to output = %d \n", i2c_alex_data);
i2c_data = i2c_alex_data;
unsigned char ldata[3];
ldata[0] = 0x02;
ldata[1] = ((i2c_alex_data >> 8) & 0xFF);
ldata[2] = (i2c_alex_data & 0xFF);
fprintf(stderr, "Set Alex data 0 = %x \n", ldata[0]);
fprintf(stderr, "Set Alex data 1 = %x \n", ldata[1]);
fprintf(stderr, "Set Alex data 2 = %x \n", ldata[2]);
if (write(fd_i2c_alex, ldata, 3) < 0)
fprintf(stderr, "Error %d writing Alex data\n", errno);
}
}
}

So you can see that the filter is setting different outputs (lpf/hpf) as is defined in the ALEX filter boards.

Hope this helps.

73 Johan
PA3GSB



Op woensdag 26 juni 2024 om 12:53:54 UTC+2 schreef stephen....@gmail.com:

Stephen Weston

unread,
Jun 26, 2024, 9:13:36 AM6/26/24
to radio...@googlegroups.com

Hi Johan,

That worked! Just had to jumper A0 to VCC and A1 & A2 to GND on the PCA9555A board.

Thanks again

73 Steve VK2YE

bi...@palomar.pl

unread,
Oct 16, 2024, 1:32:14 PM10/16/24
to Radioberry
Hi,
I'm new on the group so have introduce myself. My callsign is SQ1RES op. Jarek. I love building radio devices, so I use only my home made TRXs. Now, I'd like to build the new transceiver based on Radioberry. Thank you Johan for great project! So, I intend to use the BPF module that I already have. Unfortunately, it has a slightly different bands layout:
80-60
40
30
20
17-15
12-10

I would like to make the following changes to the FILTERS.h module code in my installation:
 if (currentfreq < 1416000) hpf = 0x20; /* bypass */
   else if (currentfreq < 6500000) hpf = 0x10; /* 1.5 MHz HPF */
     else if (currentfreq < 9500000) hpf = 0x08; /* 6.5 MHz HPF */
       else if (currentfreq < 13000000) hpf = 0x04; /* 9.5 MHz HPF */
         else if (currentfreq < 16000000) hpf = 0x01; /* 13 MHz HPF */
           else if (currentfreq < 23000000) hpf = 0x20; /* 16 MHz HPF */

             else hpf = 0x02; /* 20 MHz HPF */

Can you advise me on the most effective way to do this and whether I am even allowed to do it by interfering with your code?

Vy 73,
SQ1RES
Jarek

Ricardo Suarez

unread,
Oct 16, 2024, 2:15:45 PM10/16/24
to radio...@googlegroups.com

Hello

You can use a kind of N2ADR lpf controller, based on the right I2C driver -or-  Arduino based ones.

Using the Open Collectros settings on the phpsdr software, (Menu->OC)  you can select the right filter configuration based on the bands you're operating

Rick LU9DA

bi...@palomar.pl

unread,
Oct 17, 2024, 3:17:31 AM10/17/24
to Radioberry
Thank you very much for your answer, Rick. First. PCA9555 I2C to GPIO controller I've got is also "right" ("named Alex" in Filters.h). Second. Why should buy $52.80 when I have good BPF and LPF modules. The great advantage of SDR is that it allows for hardware customization through software modification. Don't you think? I know what needs to be changed (I provided the code above). I just don't know how to compile and install it. I'm not proficient in Linux. I'm coding but for Windows only.

Vy 73,
SQ1RES
Jarek

pa3gsb

unread,
Oct 20, 2024, 6:02:08 AM10/20/24
to Radioberry

Hi Guys,

This is the beauty of the project; the radioberry is not an end product....; you need to invesigate and learn.

Jarek, the code you highlighted does missed these lines.





if (((buffer[525] & 0x40) == 0x40) ? 1 : 0) {
i2c_alex_data = ((buffer[526] & 0x8F) << 8) | (buffer[527] & 0xFF);
} else if ((((buffer[13] & 0x40) == 0x40) ? 1 : 0)) {
i2c_alex_data = ((buffer[14] & 0x8F) << 8) | (buffer[15] & 0xFF);
}
else {
//firmware does determine the filter

Here we are following the protocol-1 which is defined to get a general connection from your SDR program to your SDR hardware.

You see that you are able to use the settings done in a SDR as Rick told you.

 See the screenshot of the particular part of the protocol.

Hope this helps

73 Johan
PA3GSB

Op donderdag 17 oktober 2024 om 09:17:31 UTC+2 schreef bi...@palomar.pl:
Screenshot 2024-10-20 115827.png

bi...@palomar.pl

unread,
Oct 21, 2024, 3:46:31 AM10/21/24
to Radioberry
Thanks a lot for the information. However, I decided to solve this in a hardware way. I'll not have to modify my version every time with the next update. Secondly, I have very good filters, but controlled by BCD code. Anyway, the PCB project is already done. Everything together. PTT, filter, PA controller (as Radioberry hat). The prototype PCB went to implementation :) Thanks again and Vy73.
Reply all
Reply to author
Forward
0 new messages