Wiki

This version is outdated by a newer approved version.DiffThis version (27 Apr 2023 16:27) is a draft.
Approvals: 0/1
The Previously approved version (20 Apr 2023 16:45) is available.Diff

This is an old revision of the document!


EVAL-CN0566-RPIZ Quick Start Guide

CN0566 “Phaser” Quick Start Guide.

This is the minimum amount of setup to get the phaser up and running.

Videos


(The Phaser comes mostly assembled. Start at around 12:45, after it's been completely assembled.)

Equipment Required

  • Hardware
    • EVAL-CN0566-RPIZ Board
    • Raspberry Pi 4
    • ADALM-Pluto
    • 5 V, 3 A, USB-C wall adapter
    • HB100 microwave source
      • 3V benchtop supply or 2 AA cells for HB100 power
    • Micro HDMI to HDMI cable (or suitable adapters)
    • 16GB or larger SD card
    • USB keyboard and mouse
    • Monitor with HDMI display
    • Tripod
  • Software
    • ADI Kuiper Linux image
  • Other
    • Wired or Wireless network connection, with access to the internet (for accessing update files from Github.)



Overview Photo

Figure 2. EVAL-CN0566-RPIZ Circuit Evaluation Block assignment



SD card / Software Setup

The SD card that ships with the first phaser production run MUST be updated with a new image.
In order to control the CN0566 from the Raspberry Pi, you will need to install ADI Kuiper Linux on an SD card. A summary of the minim steps follows, while complete instructions, including where to download the SD card image, how to write it to the SD card, and how to configure the system are provided at Analog Devices Kuiper Linux.

Kuiper 2021_r2 is not documented at Download Linux Image yet. Remove this box once it is. Until then, use this direct link to the file:
image_2023-04-02-ADI-Kuiper-full.zip

Pay particular attention to the localization settings, keyboard settings, etc. if you will be running examples on the Raspberry Pi itself (versus remotely.)
Download the Kuiper Linux SD card image and unzip it to a convenient location, and write the image to the SD card. The Kuiper Linux wiki pages give a few options, but the “official” Raspberry Pi imager is very straightforward:
Raspberry Pi Imager

Switch to ADI Kuiper Imager once it's stable and documented on the wiki.

After burning, if a window pops up saying “this card needs to be formatted, would you like to format it now?”, the answer is NO. Eject the card and insert it into the Raspberry Pi's SD card slot.

Assembling, Booting and Configuring the System

Figure 3. Test Setup Functional Block Diagram

  1. Connect ADALM-Pluto's CENTER micro-USB port to Raspberry Pi via micro-USB to USB cable.
  2. CAREFULLY thread the tripod into the tripod mount. Please minmize stress on the tripod mount while plugging in cables and other operations, as it is screwed directly to the PC board.
  3. Connect the Raspberry Pi to the monitor via the HDMI cable.
  4. Connect the keyboard and mouse to the USB port of Raspberry Pi.
  5. Verify that the burned SD card is properly inserted into the slot on the Raspberry Pi.
  6. Power up the setup through the type-C port of the CN0566. Do NOT connect a supply to the Raspberry Pi.
  7. Wait for Raspberry Pi to boot. Upon booting, open a terminal as seen on the taskbar.
  8. Configure the device tree overlay file. See software section for detailed instructions.
  9. Make sure to reboot the Raspberry Pi after saving the config.txt file.
  10. Wait for the Raspberry Pi to boot up again.



Configuring the SD Card

After burning the image above, log into the Raspberry Pi and open the Raspberry Pi configuration utility.
Set the hostname to “phaser”, set the locale, keyboard, and wifi country (if you'll be connecting to your network by wifi.) Next, run the following commands (and take a look at the setup script if you're suspicious, and note that there may be some updates as newer versions of Kuiper Linux are released.)

wget https://github.com/mthoren-adi/rpi_setup_stuff/raw/main/phaser/phaser_sdcard_setup.sh
sudo chmod +x phaser_sdcard_setup.sh
./phaser_sdcard_setup.sh
sudo reboot

(Wait for the system to reboot)

Software Quick Start

At this point, the GUI can be run from the command line. Power up the HB100 source with either a 3V benchtop power supply or two AA cells and aim it a the phaser antenna. Run the following command to find the HB100 frequency:

cd ~/pyadi-iio/examples/phaser
python cn0566_find_hb100.py

Ideally, there should be a single, sharp peak as shown in the figure below.

Figure 1. Find HB100 script

If there is a single prominent peak, enter “y”. If there are several peaks or no visible peak, close the plot and enter 'n' at the prompt. Reposition the HB100 (and make sure there are no other sources nearby), then re-run the script.
Next run the GUI:

cd ~/pyadi-iio/examples/phaser
python cn0566_gui.py

The GUI should load and begin displaying the beam pattern as shown below. Figure x. Phaser GUI

Initial Calibration

The phaser board is initially uncalibrated; each element will have a slightly different gain and slight phase error due to numerous factors. the cn0566_examples.py script provides a calibration utility that will generate calibration files. Make sure an antenna is attached to J1, and is facing straight at the antenna array from approximately 1.5m away. Then run:

cd ~/pyadi-iio/examples/phaser
python3 cn0566_examples.py cal

The script provides debug information and plots as it is running, you may have to close out of each plot for the script to proceed. After running this script, files gain_cal_val.pkl and phase_cal_val.pkl will be placed in the working directory. The GUI program will also load these files automatically.

Refer to CN0566 Calibration for additional details

Appendix: Pluto Setup

The Pluto that ships with the phaser kit has been pre-configured. In case something goes wrong, here is how to update the firmware and settings.

A Pluto Rev C or higher is required. For the CN0566, a custom firmware image is used that incorporates a TDD engine and additional control signals.

REMOVE this when it's got a proper home on Github releases
The first step is to update the firmware to the latest release, following the procedure at:\ Pluto/M2k Firmware Updates. Make sure to upload the entire zip file, not the pluto.frm contained within.
Next, download and unzip the updated firmware image, located here:
pluto_dw_march_16_2022.zip

(Yes, unzip, UNlike upgrading to the latest release.)
Drag and drop the pluto_DW_feb_7_2022.frm to the Pluto mass storage device, then eject.

For Reference - OLD version (do NOT use):
pluto_dw_march_9_2022.zip
pluto_dw_feb_7_2022.zip

The next step is to update the Pluto configuration to enable the AD9361's second channel. Follow the directions at:
Updating to the AD9364,
For setting the mode of a Rev. C PlutoSDR to 2r2t, the following would be sequence of commands:

Verify that the configuration was programmed properly by entering the following commands:

fw_printenv attr_name
fw_printenv attr_val
fw_printenv compatible
fw_printenv mode

Wihich should return:

# fw_printenv attr_name
attr_name=compatible
# fw_printenv attr_val
attr_val=ad9361
# fw_printenv compatible
compatible=ad9361
# fw_printenv mode
mode=2r2t
#

Appendix: Configuration Script Notes

A complete config.txt file is posted for convenience. Enter the following commands from a terminal to download and apply a complete config.txt file with all edits above included:

wget https://github.com/mthoren-adi/rpi_setup_stuff/raw/main/phaser/config_phaser.txt
rename config_phaser.txt config.txt
sudo mv /boot/config.txt /boot/config_original.txt
sudo cp config.txt /boot/


Or alternatively, follow the Hardware Configuration procedure under Preparing the Image: Raspberry Pi in the Analog Devices Kuiper Linux page, adding the following lines to the very end of /boot/config.txt:

# Phaser board overlay:
dtoverlay=rpi-cn0566

# Heartbeat blinky:
dtparam=act_led_gpio=26
dtparam=act_led_trigger=heartbeat

# Short GPIO121 (pin 40) to ground for shutdown:
dtoverlay=gpio-shutdown,gpio_pin=21,active_low=1,gpiopull=up

If you will be logging in via VNC, comment out the following line, and set the HDMI group and mode accordingly:

# dtoverlay=vc4-kms-v3d

# uncomment to force a specific HDMI mode (this will force 1920x1080)
hdmi_group=2
hdmi_mode=82


REMOVE this when merged:
For now - the CN0566 GUI and required pyadi-iio additions are in a development branch. The pyadi-iio that is pre-installed on Kuiper needs to be cleanly removed and replaced. Run the following commands:

cd ~
# Uninstall existing pyadi, reinstall from source:
sudo pip3 uninstall -y pyadi-iio
git clone https://github.com/analogdevicesinc/pyadi-iio.git
cd pyadi-iio
git checkout cn0566_dev
sudo python3 setup.py install

End of Document

resources/eval/user-guides/circuits-from-the-lab/cn0566/quickstart.1682605629.txt.gz · Last modified: 27 Apr 2023 16:27 by Jon Kraft