I2C board setup for LPF/BPF

335 views
Skip to first unread message

SNAIL

unread,
Jun 5, 2025, 8:58:25 PMJun 5
to Radioberry
I'm trying to set LPF/BPF board to work but can't achieve success. I have MCP23017 I2C board connected, address set as N2ADR and detected by RPI. N2ADR filter board selected in RADIO menu. Nothing out of MCP 23017. 
Browsing the Radioberry group I found a post from Yado-San on how he used MCP 23018. But I can't find the file filters.h he used to edit for adopting MCP23018.
Appreciate any suggestions. 
Screenshot_5-6-2025_183243_02958008727264119222.googlegroups.com.jpeg.crdownload

Yado-san

unread,
Jun 6, 2025, 11:15:38 PMJun 6
to Radioberry
Hi SNAIL,

As shown in the diff results of filter.h, only the register address needs to be changed.
> ldata[0] = 0x09; -> 0x12;
Of course, the same I2C address 0x20 (A2=A1=A0=GND) is required.

fyi:
MCP23008: 8-bit parallel I/O expansion
 IODIR registter(addr_00): Write initial 00 to set GP as output.
 GPIO register(addr_09): Write GP[7:0] output data

MCP23017 or MCP23018: 8-bit x2 (23018=Open-drain outputs)
 IODIRA registter(addr_00): Write initial 00 to set GPA as output.
 GPIOA registter(addr_12): Write GPA[7:0] output data 

Yado-san,
2025年6月6日金曜日 9:58:25 UTC+9 SNAIL:

SNAIL

unread,
Jun 7, 2025, 8:08:46 PMJun 7
to Radioberry
Found what was wrong. I have software installed without Radioberry-2.x/SBC/rpi-4/device_driver/firmware
/filters.h. Need to reinstall proper version and try again.

Yado-san

unread,
Jun 8, 2025, 1:38:54 AMJun 8
to Radioberry
Yes, We can see rhe filter.h in Radioberry-2.x-master/SBC/rpi-4/device_driver/firmware/filters.h,

Edit and Recompile the firmware:
$ cd Radioberry-2.x-master/SBC/rpi-4/device_driver/firmware
$ vi filters.h
  (edit line 109,142   0x09  -> 0x12 )
$ make
  (compile and check no error.. )

$ sudo systemctl stop radioberry
  (stop radioberry for replace firmware)
$ sudo cp radioberry /usr/local/bin/.
$ sudo radioberry
  (start radioberry agin)
//
2025年6月8日日曜日 9:08:46 UTC+9 SNAIL:

SNAIL

unread,
Jun 24, 2025, 12:16:46 AMJun 24
to Radioberry
Thank you Yado-san for advice. Was out of home for long time and back to project. Unfortunately, Yado-san trick doesn't work on my PI.
1. If Radioberry software stack loaded by PA3GSB script i can't locate file "filters.h" or Radioberry-2.x directory on my RPI-4.
2. If Radibrry software loaded by this way 
cd /tmp
git clone --depth=1 https://github.com/pa3gsb/Radioberry-2.x.git
cd Radioberry-2.x
git submodule update --init --recursive --depth=1
  I can open "filters.h" file and edit it in Radioberry-2.x directory before running command "./radioberry_install.h". There is fatal error during the compilation and installation. No reaction on MCP 23017. All pins are low. A and B ports.
Radioberry itself is looks like working fine.
I think there is a library problem in software. I can see activity on I2C with oscilloscope, but MCP doesn't react. Checked expansion board with Arduino. It's working. Ordered MCP2308 just to check my suspicions. 
Thank you again for support.

SNAIL

unread,
Jul 6, 2025, 5:10:11 PMJul 6
to Radioberry
Looks like I'm losing this battle. Even with file edited I don't see any activity on I2C during the band change. 
My questions -
1. Which I2C bus to connect MCP? RPI I2C pins 17, 18 or Radiberry pins 13, 14 on CN301? Pullup resistors installed.
2. Will N2ADR filter connection be detected automatically or somehow confirmed when N2ADR marked in filter menu?
MCP checked with ESP and working perfectly switching BPF and LPF boards.

Mario Vano

unread,
Jul 6, 2025, 9:33:53 PMJul 6
to Radioberry
I have designed an n2adr like board that stacks with the radioberry. The original design was for use with another radioberry-like card and was not  software compatible with the n2adr board at all, but I was able to make my filter board work by ignoring the gateware and driver completely and patching only the pihpsdr source files to use a different base address and OC bit order for my relays. I eventually got tired of patching and modified the board design to be more compatible with N2ADR.

In theory, you should be able to make your board work this way, but you'll have to patch almost all radio software to make it work. with the MCP23017. That part has the default register mapping incompatible with the MCP23008. It requires a different initialization sequence than is usually sent to the MCP23008 to make it compatible, and the next piece of software that tries to initialize it will clobber your patch.

I run my MCP23008 directly off the regular I2C pins for user I2C bus on gpio 1,3,5 and 9. The other Pi Bus (I believe it's called bus 0) is reserved for use only by the RPI operating system - usually for configuration eeroms. My board usually stacks BETWEEN the Pi and the Radioberry because most of them don't come with pass through GPIO pins so I pick up the I2C there. You may have to solder to the back of the radioberry gpio connector to get at them. My first prototypes connected via the radioberry 20 pin connector's I2C and that worked as well.

Because my original design was for another radio, I didn't have enough relays for all the N2ADR filters. I chose to keep an HPF always in the receive circuit and just ignore the bit that controls it and the one for the 160 meter LPF. It seems to work great. on 80-10 and it receives fine on 160 as well.  I've built several radios with this board and radioberrys I built from the latest gerbers and they all work very well.

I suggest you abandon the MCP23017 and try to stay N2ADR base address and bit compatible if possible...

Hope this info helps - good luck with your board.

Mario (AE0GL)


SNAIL

unread,
Jul 7, 2025, 9:06:13 PMJul 7
to Radioberry
Thank you Mario. 
MCP2308 arrived this morning and I made prototype board. MCP2308 is working and I found the problem why MCP23017 wasn't. I can't locate file "filters.h" on RPI-4 after installation to edit it as Yado-san mentioned. Instead, I copied PA3GSB stack to my github, edited "filters.h" file and did installation from my github. BUT! in installation script installation was redirected back to PA3GSB.
OK, now I have MCP2308 working and need just one more step to change MCP2308 output to mate it with my BPF. BPF is 9 band filters and have decoder to convert binary to decimal.
Where to change? In "filters.h" or in PIHPSDR? And how? 

SNAIL

unread,
Jul 8, 2025, 12:43:57 AMJul 8
to Radioberry
Figure out how to change band code in OC.



--
You received this message because you are subscribed to a topic in the Google Groups "Radioberry" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/radioberry/FwDDFV7-5Q8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to radioberry+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/radioberry/6b128787-c661-49c1-8fe0-7cf300eb94dfn%40googlegroups.com.
Message has been deleted
Message has been deleted
Message has been deleted

Mario Vano

unread,
Jul 11, 2025, 9:07:11 AMJul 11
to Radioberry
HI Snail and Yado-san!

Yado-san's advice is spot on. All I would add is that I suggest you still try to stay compatible with N2ADR hardware  (or some other supported board) where possible to prevent surprises.

One problem with using the decoder you are suggesting is that it only has 4 active inputs, so it can't take into account all the bits n2adr's board looks at, so it can't scramble all 128 possible band select signals sent to n2adr.

Also, even if it could, you are trying to extract more band info than is normally sent to an n2adr card. The bits sent to it control

160
80
40
20
15
10
HPF

and that's all!  Furthermore the HPF bit is assumed to be controlled by hardware logic that disables it during transmit.

There's another "cultural" problem and that's that all the receiver software programs seem to make additional assumptions about what the bits mean. For example:  piHPSDR only sends filter information out when it thinks you are inside an amateur band. It seems to disable all filters (even via the OC bits) at times when it thinks you are in "SWL" mode. This means you must conform to what it "thinks" you are doing.

There is another interface supported by the radioberry firmware that sends full frequency information for a board that uses a microcontroller to do arbitrary band control. Unfortunately I haven't looked into it much myself. The only info about it I could find seems to be in "filters.h" which refers to it as a "Generic Filter Interface". It would certainly require a microcontroller to implement. and probably would need low latency response to commands it receives.

I think you probably need to rething what you are trying to do. Until you solve the problem of reconciling all these specifications, I'd suggest you consider only enabling BPFs when there is no ambiguity involved, or perhaps retuning them to also include the added two bands you are trying to cover.

If you listed the bands you are trying to get output bits for it might help. Are you adding VLF support or trying to more selectively filter WARC bands? Does you filter go into pass through mode if no inputs are selected?

If the filter board can be bypassed when no filters are selected, then try enabling just a few filters as N2ADR bits and trying to configure Thetis, piHPSDR, sparkSDR, Quisk and any other apps you are interested in using to see what they can and cannot do.

Hope this general info  helps, but eventually you may have to do more of your own homework. You are trying to add  BPF support which is not part of the usual HL2 hardware. It might help to explain exactly what you are trying to do and why.

M
On Tuesday, July 8, 2025 at 6:52:22 AM UTC-5 Yado-san wrote:
Hi SNAIL,

I got that you were unable to successfully update the RB2 firmware.
Please try to execute the following command.

-> already running on MCP23008, recompile and replace only the firmware with the make command.
   No need to execute 'radioberry_install.sh'.
//
$ cd /home/pi/tmp

$ sudo systemctl stop radioberry

$ git clone  --depth=1 https://github.com/pa3gsb/Radioberry-2.x  (get RB2 codes to local dir.)
$ cd Radioberry-2.x/SBC/rpi-4/device_driver/firmware

$ vi filters.h  (edit mcp23008 PIO-register address)
$ sudo make     (compile firmware)
$ sudo cp radioberry  /usr/local/bin   (replace RB2-firmware)

$ sudo radioberry   (run radioberry again)
//

By modifying the firmware (filters.h), the filter board will also work with other SDR software (such as Thetis and SparkSDR).

 the pihpsdr version of DL1YCF released after February 20, 2025 supports Radioberry-v2 GPIO.
 The local CW keyer built into pihpsdr can be used.
 https://groups.google.com/g/radioberry/c/y0WDipy2p_0/m/_u_fxJXrAAAJ

ps.
 AI-web sites are very convenient for researching the details of filters.h and modifying the code.  
Simply attach the code and give instructions such as “Please explain the contents of this program.”
AI will also help you modify the code :)
 ..I use free Copilot and Gemini or ChatGPT.

hope helps, Yado-san

2025年7月8日火曜日 13:43:57 UTC+9 SNAIL:
Message has been deleted

SNAIL

unread,
Jul 13, 2025, 6:49:18 PMJul 13
to Radioberry
Thanks Mario. No problems to adopt BPF and LPF using N2ADR software part. I choose to use it just because MPC 23017 is cheap and available on Amazon as a development board. Don't need to play with KiCad and orders. MPC outputs 0 - 3 were set to provide binary combination for filter board to set right filter for the band. 9 BPF for RX and 7 LPF for TX. BDC on filter board converts binary to decimal and activate relays. For bands out of HAM frequencies output 4 is set to activate additional relay to bypass filter board for RX. 

On Friday, July 11, 2025 at 7:07:17 AM UTC-6 SNAIL wrote:
Thank you Yado-san. I made it. Different way but who cares. I forked PA3GSB Radiberry-2.x to my page, edited filters.h and radioberry_install.sh and it's went thru. If radoberry_install.sh not edited it will go back to PA3GSB github and download unedited files.


On Tuesday, July 8, 2025 at 5:52:22 AM UTC-6 Yado-san wrote:
Hi SNAIL,

I got that you were unable to successfully update the RB2 firmware.
Please try to execute the following command.

-> already running on MCP23008, recompile and replace only the firmware with the make command.
   No need to execute 'radioberry_install.sh'.
//
$ cd /home/pi/tmp
$ sudo systemctl stop radioberry

$ git clone  --depth=1 https://github.com/pa3gsb/Radioberry-2.x  (get RB2 codes to local dir.)
$ cd Radioberry-2.x/SBC/rpi-4/device_driver/firmware

$ vi filters.h  (edit mcp23008 PIO-register address)
$ sudo make     (compile firmware)
$ sudo cp radioberry  /usr/local/bin   (replace RB2-firmware)

$ sudo radioberry   (run radioberry again)
//

By modifying the firmware (filters.h), the filter board will also work with other SDR software (such as Thetis and SparkSDR).

 the pihpsdr version of DL1YCF released after February 20, 2025 supports Radioberry-v2 GPIO.
 The local CW keyer built into pihpsdr can be used.
 https://groups.google.com/g/radioberry/c/y0WDipy2p_0/m/_u_fxJXrAAAJ

ps.
 AI-web sites are very convenient for researching the details of filters.h and modifying the code.  
Simply attach the code and give instructions such as “Please explain the contents of this program.”
AI will also help you modify the code :)
 ..I use free Copilot and Gemini or ChatGPT.

hope helps, Yado-san

2025年7月8日火曜日 13:43:57 UTC+9 SNAIL:
Figure out how to change band code in OC.


Mario Vano

unread,
Jul 13, 2025, 6:55:09 PMJul 13
to Radioberry
Yes, It became clear later that your board was quite different and I'm glad you got it going. Good luck with radioberry - I'm certainly having a lot of fun with the 3 of them I've built with various LPF and power amps....

73, M

Robert Dale

unread,
Jul 14, 2025, 1:19:35 PMJul 14
to Radioberry
Mario,
I have a RB2 and 5W Preamp board. I was thinking of building it all into a self-contained TRX but I need help with the filtering parts. I DO have a spare N2ADR filter board (from Hermes-Lite 2 build I did some time ago) and would like to use it in this project. While I am pretty good mechanically, (I design my own PCBs, 3D print parts & enclosures etc) I am an absolute neophyte when it comes to programming, modifying scripts, coding etc... 

I would be very interested in:
A) Learning more about the filter board you designed and use on your RB
  • Is this something I can duplicate and use?
  • Would you be willing to share gerbers, BoM, software etc?
B) Understanding how to interface my N2ADR board with the RB 
  • If I'm unable to use your designed filter board, I'd like to use my N2ADR board - how to make that work?
  • Software required and how to implement it?
My preference would the A above as I had bought the N2ADR board as a "spare" in the event something went amiss with the three HL2 transceivers I have built...

Looking forward to hearing back from you. 
73,
Robert VE7ZN (old call VE7BDO)

PS: my ham email is on QRZ.com

Mario Vano

unread,
Jul 15, 2025, 11:19:11 AMJul 15
to Radioberry
Hi Robert!

1. I'm fairly certain we can help you get your N2ADR board connected, but I, for one will have to do a little research first to give you any advice. I have an HL2 myself and am very familiar with it.

2. My LPF filter board is at a very mature stage, but it's lacking documentation and clean up for uploading it to github as a new project in my account. In addition, there are two small modifications that I'm currently implementing with "yellow wires" that I made to improve compatibility that I have incorporated into the design but have not yet ordered from my PCB supplier.

All my projects are sadly on hold waiting for Tariff and Shipping issues to resolve themselves to some sort of stability. Right now I'm unwilling to place board orders since it's not clear whether the boards will cost the usual $75 or the $300 some people have reported for similar orders!

If you feel confident you can handle the current state of the project and the yellow wire modifications, I can send you a couple of the current revision boards, a link to my Digikey BOM order file,  and the Kicad project files if you agree not to distribute them further - since I don't want a bunch of alpha versions floating around. I have no plans to sell anything, but the project is completely open source and once on github. I'm pretty slow at getting around to finishing projects like this so the final github may not appear until fall.

3. I'll send more info tomorrow, but the board is basically the same size as the raspberry pi. It stacks under or over the Radioberry. I build my Radioberry boards with GPIO connectors that have long enough pins to stack the board above the radioberry and that's the preferred way to do things, but most of the commercial boards don't have pins to allow stacking another board on top of the radioberry. Either way works.

The board currently runs off unregulated 12 V power that my power amp runs on. The untested new revision requires only the Pi's 5V power.

It implements the very common  RSGB style Toroid low pass filters for 80, 40, 20, 15, and 10 meters and the values are optimized for WARC bands as well. The relay decoding lines for 160 and the HPF filter are currently ignored.

It has a 2Mhz HPF inline with the receiver output - but it has no relay and so cannot be disconnected.

It has a T/R antenna relay.

The TR switching requires a fly lead to the Radioberry PTT line as it's not available on the GPIO connector.

It contains a great VSWR bridge, but it's ADC chip is not compatible with the HL2 one, so it presently requires another simple Python app floating on the screen for use with piHPSDR and other SDR programs. I haven't got around to modifying it to incorporate it into the Gateware driver or any of the SDR source files.

If this discussion is not appropriate for the Radioberry forum, I'd be glad to take it offline, or we can move it to my own "RadioHat" group mailing list.

Here's a schematic and 3d from Kicad of the current revision. I'll send some more  tomorrow of the new (unbuilt) version and some photos of the current version - I need to take some things apart to photograph them....

txfilters3dB.jpg

txfilters3dF.jpg

Mario Vano
AE0GL
schematic.pdf

Mario Vano

unread,
Jul 15, 2025, 11:35:23 AMJul 15
to Radioberry
Here's the schematic of the new (untested) version I referred to that that needs no yellow wires, has a jack for PTT input and can be built to use 5V or 12V relays. The appearance is similar to the old board, except that has provisions for alternate rf connectors and adds a connector for the PTT input.

M (AE0GL)


schematic.pdf

Robert Dale

unread,
Jul 15, 2025, 8:43:42 PMJul 15
to Radioberry
Mario,
Thank you for that. I don’t know who your PCB supplier is, but I just ordered some PCBs for another project I’m working on. The cost was as before, except JLCPCB added about $5 for “customs duty”. 

I like the N2ADR board and it would fit into the enclosure I’m planning, but having a RPi-sized board would be much more preferable!

I’m not so concerned with the VSWR bridge as I built and use daily Johan’s and Robert’s (WA2T) LJ-2K+ digital meter. A couple of yellow wires doesn’t scare me either.

I’d be very interested in trying out your design for my project particularly because of the form factor. I’d be more than happy to,pay for,any costs you incur and I do have a US mailing address - I’m unconcerned with US Customs officials and the Canadian ones only seem to care if I’m bringing “alcohol or tobacco” across the line. Also, I do use Digikey for most of my parts procurement needs and their shipping to Canada is fast, cheap and efficient. 

Let me know what you think. 

73,
Robert VE7ZN 

PS my ham email is ve7zn at Jasero dot com

Mario Vano

unread,
Jul 16, 2025, 10:51:02 AMJul 16
to Radioberry
Thanks Robert:

The problem with customs is that it appears unpredictable and depends on the shipping method. I was aboout to run a test with Seeed studio and DHL (my usual supplier and shipper) when once again, the situation is all supposed to change on August 1! I've also used JLCPCB and liked the results. I may switch to them for other reasons...

Thanks for your interest. It's just what I need to get me to get my act together on the LPF board. I design and build a lot of things, but have found few people seem to have any interest in them. I need to do more "market research" first!

Give me a couple of days to review the situation and then I'll contact you by email about shipping info and to let you know where to download the Kicad files. You're welcome to 2 boards from the last rev for free, since I usually order 10 of each rev. I'll probably also start a PCB order for the latest rev and let you know if it's worth waiting for the newer board. It's really no problem sending them to a US address and not worth worrying about the costs. You're doing me a favor taking them off my hands....

I also need to caution you that I have never explored the preamp board and don't know what differences in the interfacing and mechanical details will be required to work with it. I don't see any obvious electrical or mechanical problem - other than the fact that my board will probably have to be on the bottom. I'm very keen to see how this works. I need to obtain a preamp board myself for testing - I've built all my radios with QRPLabs 10W linear amplifier boards with heat sinks the size of a RPI installed - but they lack some features I believe the preamp board has...

Photos will follow later today after I take a radio apart to photograph the filter board.

M

Mario Vano

unread,
Jul 18, 2025, 10:59:01 AMJul 18
to Radioberry
This is a response to Robert's request for info about how to use the N2ADR Filter with Radioberry...


This would be my first cut at how to connect the N2ADR FIlter board to Radioberry. Others will probably have suggestions or corrections.

Note that the following is untested and is only a suggestion that comes from reviewing the N2ADR schematic.

Proceed with caution! 

1. Note that it looks like you need to add your own Transmit/Receive RF relay between the Radioberry  input/output and the N2ADR board input.

2. This also assumes that you do not intend to use the VSWR bridge outputs as they are analog and Radioberry has no analog inputs. There are other threads explaining how to build an ADC board and patch the firmware and software to use it.

3. It's possible that the PI 3.3V on board supply may not be enough to handle the N2ADR board's needs or that it may react badly to transients generated by the relays. You may need to add an external regulator to supply 3.3V,

4. You may need to add 3.9K pull up resistors from pin 18 to pins 17 and 16 for reliable I2C operation.

5. As the Pi has no "reset" line on the GPIO board, you may need to add a pull down resistor of about 3.3k on the INTTR line to prevent the board doing something unexpected before the FPGA has been loaded as the pin floats at mid rail.

n2adr excerpt.jpg


Comments?

Mario (AE0GL)

Mario Vano

unread,
Jul 18, 2025, 11:05:51 AMJul 18
to Radioberry

Here are the additional photos of the last revision(with yellow wires) of my own 80-10 meter Filter board. I'm going to go ahead and send off a PCB order of the corrected board as soon as possible and after I build one I will add a new github repository for this design to my account ad report the link back to here...

M
(AE0GL)

IMG_3566.JPG


IMG_3565.JPG

Joey G.

unread,
Jul 18, 2025, 4:38:04 PMJul 18
to Mario Vano, Radioberry
I used that filter board on Radioberry before I purchased a HL2 then moved it over and can confirm it will work.  What you described is pretty much how I did it.  Used a 3.3v regulator off of my 5v rail to power it.  Used transistors to make a RX/TX relay off of the Radioberry outputs.  Worked well.  Didn't use the VSWR part of the board.  

--
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 visit https://groups.google.com/d/msgid/radioberry/7c87cb41-b719-4b27-8d65-a2f0a177a627n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages