Skip to content

mariocannistra/pyLMS7002M

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LMS7002M Python package

The pyLMS7002M Python package is platform-independent, and is intended for fast prototyping and algorithm development. It provides low level register access and high level convenience functions for controlling the LMS7002M chip and evaluation boards. Supported evaluation boards are:

  • LMS7002_EVB
  • LimeSDR

The package consists of Python classes which correspond to physical or logical entities. For example, each module of LMS7002M (AFE, SXT, TRF, ...) is a class. The LMS7002M chip is also a class containing instances of on-chip modules. The evaluation board class contains instances of on-board chips, such as LMS7002, ADF4002, etc. Classes follow the hierarchy and logical organization from evaluation board down to on-chip register level.

Python 3 porting

The core scripts have been ported to Python 3.x using the standard python tool 2to3.py Also the VNA examples have been patched and tested. This porting has been performed and tested on Windows 8.1, using Python 3.5.6 in Anaconda 3 environment. Current version of pySmithPlot (as of April 18, 2018) has been successfully used commenting out a couple of options (waiting for author to solve those small issues).

Installation

The pyLMS7002M package is installed in a usual way:

python setup.py install

Module installation can be verified from Python:

python

from pyLMS7002M import *

If there is no error, the module is correctly installed.

USB communications

USB communication can be established in two ways.

Direct

Python communicates directly to the USB driver. This is the simplest and recommended option.

  • Pros: Lightweight solution, simple installation
  • Cons: Windows users - other applications that are communicating with LimeSDR (such as LimeSuiteGUI and PothosSDR) use LimeSDR-USB Windows driver. The pyLMS7002M cannot use this driver. This means that the user has to change the driver each time he/she switches from using pyLMS7002M library to using e.g. LimeSuiteGUI, and vice versa.

With Linux use there are no problems, since all applications use the same driver.-

Via LimeAPI

Python communicates to the LimeAPI library, which communicates to the USB driver.

  • Pros: Windows users: No need to change the drivers. LimeSDR-USB Windows drivers can be used both for pyPLS7002M library, and other applications such as LimeSuiteGUI and PothosSDR.
  • Cons: More complicated installation and setup.

With Linux use there is no advantage, since all applications use the same driver.

Drivers

Linux

Communication is via libusb and can be direct or via the LimeAPI.

Windows

USB communication via LimeAPI

This option is recommended only for Windows users that frequently use both pyLMS7002M python library and other applications for communication with LimeSDR, such as LimeSuiteGUI, or PothosSDR.

USB direct communication

This is the preferred option.

The default Windows drivers for LimeSDR boards are not compatible with the Python module pyUSB. Drivers can be changed by using the Zadig software.

When Zadig is run, click on Options->List All Devices, as shown in the figure below.

Zadig List All Devices

Then select the LimeSDR and libusb-win32 from drop-down lists and click on Replace Driver button.

Zadig select LimeSDR-USB

Examples

  • basic
    • Find LimeSDR
    • Find LMS7002EVB
    • LimeSDR Tx CW
    • LimeSDR Tx CW power out sweep
    • LimeSDR Tx NCO
    • LimeSDR Tx NCO hopping
  • Vector Network Analyser (VNA)

Licensing

pyLMS7002M is copyright 2016, 2017 Lime Microsystems and provided under the Apache 2.0 License.

Releases

No releases published

Packages

No packages published

Languages

  • Python 77.3%
  • C 19.3%
  • C++ 3.4%