Was just exploring some options to configure LMS 7002M chip.
Is it possible to use I2C to configure LMS7002M registers? I am not sure because in LimeSDR design, I2C has been used to interface with EEPROM where LMS Chip is the master. If we want to use I2C to interface with EEPROM in the same way (LMS is master) as well as to interface with FPGA for configuration (LMS as slave), will it be ok?
Also, do you know of any particular reason why I2C was not used instead of SPI at the first place? Was it due to any technical issue or it’s just a matter of choice?
I2C is dedicated for LMS7002M internal MCU first of all. But it is possible to connect another I2C EEPROM memory with different address as it is in LimeSDR-USB board. Just one note - you have to initiate LMS7002M MCU to boot from EEPROM. Hence it should be something like this:
External SPI master initiates LMS7002M internal MCU boot from EEPROM;
LMS7002M MCU reads register settings from another EEPROM and configures LMS7002M registers.
You will need a custom LMS7002M MCU firmware for this task.
SPI is much simpler to deal with from external master point of view. Virtually any MCU may be SPI master. I2C is doable as well, but it is more complex to implement if there is no dedicated module for this.
I meant doing everything through I2C. For example. the steps would be:
I2C master (FPGA in this case) initiates LMS7002M internal MCU boot from EEPROM. My doubt is whether the same chip (LMS7002M) can be master and slave one after the other or it’s an issue?
I2C master configures LMS7002M registers directly using I2C.
I understand that a custom MCU would be needed, but is it possible technically? I understand SPI is simpler to implement but we are just exploring the options at the moment.
No chance. It should be done via SPI. You may use some small MCU, or even very simple logic to transfer a few commands via SPI to initiate LMS7002M boot. You mentioned I2C will be implemented in FPGA. Hence you may make SPI master module which will do this task.
I still don’t understand why? If the LMS chip has I2C pins, it should be possible to make it a slave and FPGA sends command as master? Am I missing something important here?
Ok I understand your point. So as per HW implementation of LMS Chip, it can only be used as a Master. Correct?
This is being already done in provided LimeSDR code right? As per the documents, FPGA resets LMS Chip that triggers MCU boot from EEPROM. Isn’t it the case? Otherwise how this is being handled please?
In LimeSDR-USB FPGA implementation all the settings are initiated from a software running on PC. FPGA in this case is just a glue logic (well, a little bit more, but it doesn’t matter) between USB MCU and LMS7002M. But you can implement your own FPGA code which does exactly what you want.
You mean LimeSuite kind-of software right that would send command like MCU_FW_WR to write to LMS MCU. But which command is used to Reset I am not aware. Is it “CMD_SSTREAM_RST”?