Coder Social home page Coder Social logo

pyadf435x's Introduction

pyadf435x

pyadf435x is a suite of software and firmware for controlling the Analog Devices ADF435x series of wide-band RF synthesizers.

The software suite consists of the following components:

  • adf435x - A python library that can control the ADF4350/1 via various hardware interface back-ends.
  • adf435xctl - A command line tool to control the ADF4350/1 manually.
  • fx2adf435xfw - A firmware for the Cypress FX2 that replaces the proprietary firmware for the EVAL-ADF4351 board.
  • stm32adf435xfw - A similar firmware for the STM32F103.

It's also possible to use the Bus Pirate as the interface for the SPI communications, simply using the adf435x.interfaces.BusPirate class.

adf435x

Installation

  1. Install depedencies:

    On Debian/Ubuntu:

    $ sudo apt install python3-setuptools python3-usb
    
  2. Build the python module:

    $ python3 setup.py build
    
  3. Install the python module:

    $ sudo python3 setup.py install
    
  4. (Optional) Install udev rules:

    $ sudo cp contrib/z60_adf435x.rules /etc/udev/rules.d/
    

Usage

See examples/ sub-directory.

adf435xctl

Requires adf435x to be installed.

Usage Examples

Sets the output frequency to 1000MHz:

./adf435xctl --freq=1000

fx2adf435xfw

The Cypress FX2 firmware project controls the synthesizer over SPI by bit-banging the FX2's GPIOs.

The firmware requires the following wiring:

FX2 Pin ADF4350/1 Pin
PA0 LE
PA1 CLK
PA2 DAT

Building

  1. First init/update all the sub-modules within the git repository:

    $ git submodule update --init
    
  2. Install AutoTools and the SDCC (Small Devices C Compiler).

    On Debian/Ubuntu:

    $ sudo apt install autoconf automake make sdcc
    
  3. Build the firmware:

    $ ./autogen.sh
    $ ./configure
    $ make
    

    You will now have the firmware file fx2adf435xfw.ihx

Usage

  1. Install cycfx2prog.

    On Debian/Ubuntu:

    $ sudo apt install cycfx2prog
    
  2. Load the firware on to the Cypress FX2 with the following command:

    $ cycfx2prog prg:./firmware/fx2/fx2adf435xfw.ihx
    
  3. Run the firmware:

    $ cycfx2prog run
    

    The device will no renumerate as with the VID/PID 0456:b40d, as an Analog Devices board.

stm32adf435xfw

The firmware requires the following wiring:

STM32F103 Pin ADF4350/1 Pin
PA4 LE
PA5 CLK
PA7 DAT

Building & Installation

  1. First init/update all the sub-modules within the git repository:

    $ git submodule update --init
    
  2. Install GNU Make, OpenOCD, and ARM builds of GCC compiler and Newlib.

    On Debian/Ubuntu:

    sudo apt install gcc-arm-none-eabi libnewlib-arm-none-eabi make openocd
    
  3. Build libopencm3:

    $ cd firmware/stm32/libopencm3
    $ make
    
  4. Build stm32f103adf435xfw:

    $ cd ..
    $ make
    
  5. Run OpenOCD:

    sudo openocd -f /usr/share/openocd/scripts/interface/stlink-v2.cfg -f /usr/share/openocd/scripts/target/stm32f1x.cfg
    
  6. Install the firmware:

    telnet localhost 4444
    
    > reset halt
    > flash write_image erase /path/to/stm32adf435xfw.bin 0x08000000
    > reset
    

pyadf435x's People

Contributors

ffy00 avatar gipi avatar jhol avatar mayankm276 avatar ncicek avatar thewyliestcoyote avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pyadf435x's Issues

Question: Regarding the sweep example provided

Hello,
Thank you for this nice Linux software, I tested it and it works fine. I have been testing the sweep function and unfortunately I could noy find a way to change the "Channel Spacing" to a different setting than 1 Mhz. I need scanning steps in the order of 100Khz not 1 Mhz and unless I am mistaken I could not find a parameter to set steps of 0.1 Mhz as I can do it using the Windows UI. How could I do it with your programme ?
Thanks
Regards
Peter

question: commands to run under ubuntu

Hello,
I have tested this tool in the past and I know it used to work. But for some reasons I can't make it work in my environment (latest version of Ubuntu 16.04). I have installed everything as per the installation instructions, including the firmware compilation and installation, but it does not seems to work:

Please advise on the right commands to use.
Please find below some debuging info

Thanks for your help
Regards
Peter

root@on7yi-ubuntu:/usr/src/pyadf435x# lsusb
Bus 001 Device 005: ID 0456:b403 Analog Devices, Inc

root@on7yi-ubuntu:/usr/src/pyadf435x# cycfx2prog prg:./firmware/fx2/fx2adf435xfw.ihx
No unconfigured Cypress FX2 attached.

root@on7yi-ubuntu:/usr/src/pyadf435x# cycfx2prog run
No unconfigured Cypress FX2 attached.

root@on7yi-ubuntu:/usr/src/pyadf435x# ./adf435xctl --freq 1000
Traceback (most recent call last):
File "./adf435xctl", line 72, in
intf = getattr(adf435x.interfaces, args['interface'])()
File "/usr/src/pyadf435x/adf435x/interfaces.py", line 27, in init
raise ValueError('Device not found')
ValueError: Device not found

Compile STM32 on OSX, flash with JLink - guide

Maybe this will be helpful for someone, this is how I've compiled STM32 firmware on OSX.

update submodules

git submodule update --init

bootstrap-mac.sh

Create a bootstrap-mac.sh file in firmware/stm32 and copy script content attached below.

Bootstrap

cd firmware/stm32
source ./bootstrap-mac.sh

Build

cd libopencm3
make
cd ..
make

Flash using JLink

JLinkExe -Device STM32F103C8 -Speed 4000 -If SWD -Autoconnect 1
loadbin stm32adf435xfw.bin 0x08000000
r
g

bootstrap-mac.sh

#!/bin/bash

if [ ! -d gcc-arm-none-eabi-8-2019-q3-update ]; then
  wget https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/8-2019q3/RC1.1/gcc-arm-none-eabi-8-2019-q3-update-mac.tar.bz2
  tar -xjf gcc-arm-none-eabi-8-2019-q3-update-mac.tar.bz2
  rm -f gcc-arm-none-eabi-8-2019-q3-update-mac.tar.bz2
fi

export PATH="$PATH:$(pwd)/gcc-arm-none-eabi-8-2019-q3-update/bin/"

echo "OK"

Code Correction

In adf435x, under interfaces.py, idProduct=0xb40d needs to be idProduct=0xb403.

DeprecationWarning: inspect.getargspec()

Hi, thanks for this project, everything works great. I spotted deprecations warning in adxf435xctl, it is recommended to replace inspect.getargspec with inspect.getfullargspec.

./adf435xctl:30: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
  calculate_regs_spec = inspect.getargspec(adf435x.calculate_regs)
./adf435xctl:31: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
  make_regs_spec = inspect.getargspec(adf435x.make_regs)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.