pavel-demin / red-pitaya-notes

Notes on the Red Pitaya Open Source Instrument
http://pavel-demin.github.io/red-pitaya-notes/
MIT License
337 stars 209 forks source link

Can't make the I2C PCA9555 interface work with QUISK v 4.1.12 #783

Closed satfan52 closed 5 years ago

satfan52 commented 5 years ago

Hello Pavel,

I am currently using the "4 Hermes Control Bits" to switch my band-pass and low-pass filters as this works quite well with QUISK, no issues at all.

Today I decided to try instead to use I2C interface with the PCA9555 chip as I want to optimize my set-up. Unfortunately, I have not much success and I wonder where is the problem. Is the functioning of this PC9555 I2C interface application dependent ? If yes is it supported by QUISK ? Has someone tested it before with QUISK (as opposed to PowerSDR) ? I am using the latest Alpine distribution and QUISK version 4.12, under Ubuntu 16.04.

It seems to me that I have strictly followed the instructions and the schematics presented on the tutorial: 1) I made my test at Address 1 (0X21) corresponding to the following settings on the PCA9555

When I reset the PCA9555 (ie cut the power and reconnect it) while the HPSDR server and QUISK are still running, then all input/output pins of the PCA9555 go to high (4.8V) and of course changing "bands" has not effects. If after that simple test, I kill both the HPSDR server and the QUISK client and then hit the reload button of the browser to restart the HPSDR server then all input/output pins of the PCA9555 go immediately to 0.56V (LOW). Restarting QUISK has actually no effects and changing bands no effects either, all input/output pins of the PCA9555 stay in the low state "for ever"

Not sure what to try next/

Regards Peter

pavel-demin commented 5 years ago

Hello Peter,

It's quite possible that QUISK doesn't support the commands controlling the filters. So, I think that the very first step should be to check what commands QUISK sends to the server running on Red Pitaya.

BTW. PCA9555 should be connected to the Red Pitaya board before the application is started.

Best regards,

Pavel

satfan52 commented 5 years ago

Good Morning Pavel,

I will put an oscilloscope on the SDR and SDA data line to see what comes out of it and/or use an I2C address scanner as soon as I can. I need to pick-up on I2C though as I never used it before. But.............. I am afraid this test may be some wasted time.......

Looking at this old discussion from 2016 and 2017 on the QUISK support forum regarding the red pitaya and the topic of switching band-pass /low-pass filters, it is quite clear that the red-pitaya PCA9555 I2C interface was NOT working with QUISK at that time (in 2016/ early 2017). I checked ALL the releases notes of QUISK and didn't find any added functionality/fix addressing this very unfortunate situation.

As a matter of fact, Jim (N2ADR) makes it crystal clear that QUISK does not manage the I2C interface of the redpitaya. According to the Jim QUISK passes the band information to the red pitaya via the hpsdr protocol and "it is up to the red pitaya" to use the band information and manage accordingly all its interfaces. So for Jim, the issue is clearly in the red pitaya HPSDR server software

If there is no intention to make this nice I2C interface work with the QUISK client, neither in the QUISK client and/or in the redpitaya HPSDR server software, then I suggest to make the life of QUISK users simpler, to indicate clearly in the redpitaya documentation of the PCA9555 I2C interface that this feature has been tested positively with PowerSDR and that TO DATE it is not currently supported for QUISK.

Regards Peter

pavel-demin commented 5 years ago

I'm afraid that there is some misunderstanding somewhere.

First of all, PowerSDR mRX PS communicates with the SDR transceiver compatible with HPSDR using the HPSDR/Metis communication protocol:

https://github.com/TAPR/OpenHPSDR-SVN/raw/master/Metis/Documentation/Metis-%20How%20it%20works_V1.33.pdf https://github.com/TAPR/OpenHPSDR-SVN/raw/master/Documentation/USB_protocol_V1.58.doc

Next, the I2C interface in the SDR transceiver compatible with HPSDR is controlled by the commands from the HPSDR/Metis communication protocol.

Since the I2C interface in the SDR transceiver compatible with HPSDR works with PowerSDR mRX PS, it means that all the commands are implemented correctly in the code running on the Red Pitaya board.

If something does work with PowerSDR mRX PS but doesn't work with Quisk, then it's obvious that the problem is in Quisk.

Jim (N2ADR) writes that "Quisk can send band info to the Pitaya with the Hermes Protocol". However, it's unclear if Quisk does send the band info by default or it should be activated somehow.

satfan52 commented 5 years ago

OK thanks for the clarifications Pavel, I will install the latest version of QUISK, check I2C signals and report results here. I will also do the checking with PowerSDR just to validate my test set-up

pavel-demin commented 5 years ago

I've just reread the comments in this issue and at the links from your comments and here are some new thoughts.

If Quisk controls the four Hermes Ctrl bits (pins DIO4_P-DIO7_P on the Red Pitaya board), then PCA9555 at address 0x20 should also work with Quisk. The same HPSDR/Metis commands (C0 00000000 on page 8 in USB_protocol_V1.58.doc) are used to control the pins DIO4_P-DIO7_P on the Red Pitaya board and the pins P00-P06 on the PCA9555 chip at address 0x20.

PCA9555 at address 0x21 is controlled by a different HPSDR/Metis command (C0 0001001x on page 9 in USB_protocol_V1.58.doc). Since this command was never mentioned in the discussion on the Quisk forum, it's possible that this command isn't implemented in Quisk.

So the right question to Jim (N2ADR) would be the following:

Does Quisk support the HPF and LPF commands for the Alex board (command C0 0001001x on page 9 in USB_protocol_V1.58.doc)?

satfan52 commented 5 years ago

Thank you for this key feedback. I will ask the question of course. So logically based on this analysis I should be able to make Pin P00 to P06 work at address 0X20, I will test too before I ask the question to Jim.

I started some tests yesterday evening at address 0X21 with PowerSDR mRX PS v 3.4.9 (latest version) as I want to see this functionality working and in action with PowerSDR to validate my test set up. I was expecting to see the LPF and HPF pins of the PCA9555 change state as I change bands on PowerSDR mRX PS v 3.4.9. I could not make this work though I think I have activated the right hermes option in the PowerSDR program, at least based on issue #326 opened here in August 2016.

"I've gotten the I2C interface to work. Took me a bit of time to find this the BIG secret was just turning on the interfaces in HPSDR that I missed! You got to the Configuration option to control what the outputs are on the OC drivers for Transmit/receive and you MUST highlight the buttons on the bottom of the form for it to send the information. Maybe that was obvious to others, but it was something I missed initially. Hope that helps. Steve KA6S"

and

"Martin - please note the two highlighted buttons on the bottom of the form {EXT CONTROL and HERCULES AMP} If you don't hit those - the function isn't enabled in the software and it doesn't send the control codes. My I2C interface was done using a PSoC - and it powers up running the I2C code that translates over to the filters I'm using, i.e. same problem that you had."

So if I can t make this work even with PowerSDR mRX PS v 3.4.9, I suspect something is wrong with my test set-up, and I need to find what because it does not make sense to test with QUISK if I can t validate my setup with PowerSDR mRX PS v 3.4.9 first. I don't see the glimpse of an I2C clocking signal on the SDL line of the RP, it stays high (3.3v) at all time as if the RP didn't detect any I2C slave. I will double check my PCA9555 chip is not dead though it would surprise me if it was. I will do some more testing this weekend

satfan52 commented 5 years ago

OK, I was able to make the IC2 PCA9555 interface to work with with PowerSDR mRX PS v 3.4.9 but so far only with the version of the SDR transceiver compatible with HPSDR available on the official app-store of STEMLAB and using the official red pitaya image downloaded from STEMLAB. This works fine and like a charm as a matter of fact, there are NO specific options to set in the set-up menu of PowerSDR, I just indicated that I used Hermès+Alex and during the first time installation of PowerSDR mRX PS v 3.4.9 and that is it!

I have not YET been able to make the I2C PCA9555 interface work with the with the version of the HPSDR compatible SDR server available with the version of the Alpine distribution that I currently use. I need to double check that I use the latest Alpin distribution and I need cross the RP hardware that I use with the Alpin distribution with the one that I use with official STEMLAB image (they are two different RP systems) to confirm/infirm a possible issue with the Alpin distribution

Next tests after that will focuss on QUISK only (now that I have a working set-up with PowerSDR).

pavel-demin commented 5 years ago

Since I don't have PCA9555, I can't test if it works with the latest release.

I know that PCA9555 has been successfully used with one of the previous releases: https://github.com/pavel-demin/red-pitaya-notes/releases/tag/20180523

satfan52 commented 5 years ago

Ok so here are the conclusions of my tests

1) PowerSDR

Everything works with the official STEMLAB releases as well as with the two last Alpin releases!! I got lost with some of the complex settings of PowerSDR.

2) QUISK

Well of course you were right, the PCA9555 I2C interface WORKS at address 0X20 for the open Collector/Drain pins P00 to P06 of the PCA9555....Actually, each of these 7 pins can be controlled from the QUISK band config menu, so it is possible to decide which open collector:drain pin is activated for which band. This is a good news

I also retested at address 0X21 and I confirm that none of the LPF/HPF pins are activated/deactivated when switching bands. The adress 0X23 does not work either. For address 0X20, the only thing that works are the P00 to P06 PIns, the other signals on the other Pins are not enabled.

I have asked the question to Jim regarding the support of more Metis commands & controls (via the n2adr yahoo group)

Regards Peter

pavel-demin commented 5 years ago

I've just found your new post in the n2adr yahoo group. If Jim (N2ADR) doesn't have a Red Pitaya board, then I'm afraid that mentioning to him all the internal details of the I2C implementation on the Red Pitaya board isn't the most efficient way to discuss this problem with him.

Anyway, the Hermes-Lite2 protocol table shows that the Hermes-Lite2 protocol implemented in Quisk isn't exactly the HPSDR/Metis protocol implemented in PowerSDR mRX PS.

Since Quisk doesn't implement all the commands of the HPSDR/Metis protocol, it explains why the I2C PCA9555 interface doesn't work with Quisk.

satfan52 commented 5 years ago

To the attention of QUISK users: The problem has been fixed in release 4.1.31 of QUISK.