pa3gsb / Radioberry-2.x

Ham Radio hat for Raspberry PI
417 stars 88 forks source link

pca9555a and DIY Filter #15

Closed ken016 closed 2 years ago

ken016 commented 2 years ago

Hello, I would like to build a DIY filter with the help of a pca9555a, unfortunately it is not possible for me (due to a lack of knowledge) to control a suitable board. FPGA i2c or RPi, which FW. Which program does it work with? Basically, I can read addresses 21 and 20 switchably using tools. I would be grateful for a suitable link :-) Greetings and many thanks for this cool project.

pa3gsb commented 2 years ago

iam not sure about your question...

the radioberry firmware does support the pca9555 address 021; attached to the rpi .

These RPI i2c pins can be found on the radioberry io connector pin 17 and pin 18

(https://github.com/pa3gsb/Radioberry-2.x/wiki/Radioberry-In-Output)

some code (but maybe it makes clear what you need) https://github.com/pa3gsb/Radioberry-2.x/blob/master/SBC/rpi-4/device_driver/firmware/filters.h

    alex_manual = ((buffer[525] & 0x40) == 0x40) ? 1 : 0;
    if (alex_manual) {
        i2c_alex_data = ((buffer[526] & 0x8F) << 8) | (buffer[527] & 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;
    }

Hope this helps.

73 Johan

ken016 commented 2 years ago

Hello, I've come that far. I'm using a PCA9555A module from Ali ... with LED. When the FW starts, the module is also addressed and all LEDs light up, then 2 switch off. But if I want to address the Alex Board with piHPSDR, nothing changes at all. 73 Ken

pa3gsb commented 2 years ago

Ken

Could you provide some additonal output information of the firmware.

Do you see the message : Set Alex data to output xx ??

This weekend i will give it a try...

73 Johan

pa3gsb commented 2 years ago

No reaction... DB2OJ Manfred reported : it is working fine.