Skip to content

Flip Display

The NanoVNA-H display can be rotated 180 degrees to accommodate different mounting orientations or user preferences. The flip affects the LCD, touch input, and jog wheel simultaneously.

  • Device mounted upside down in an enclosure or on a stand
  • Preferred viewing angle (USB cable running up vs down)
  • After screen replacement with different ribbon cable orientation
  • Accessibility — positioning the SMA connectors on a more reachable side
  1. Tap the screen to open the menu
  2. Navigate to CONFIG
  3. Tap FLIP DISPLAY
  4. The display immediately rotates 180 degrees

To make the flip permanent:

  1. After flipping, go to CONFIG
  2. Tap SAVE or use shell command saveconfig

Without saving, the display returns to default orientation on power cycle.

The firmware coordinates four subsystems when you toggle flip:

The LCD controller (ILI9341, ST7789, or ST7796S) receives a MADCTL (Memory Access Control) register write that changes the pixel scan direction. This is a hardware-level rotation — the controller reads its frame buffer in the opposite order, so no CPU cycles are spent rearranging pixels. The firmware stores a lookup table of MADCTL values for each LCD type and rotation:

DISPLAY_ROTATION_0 → Normal scan order
DISPLAY_ROTATION_180 → MX + MY flags set (mirror both axes)

Different LCD controllers use different MADCTL bit patterns for the same visual rotation. The firmware auto-detects the LCD type at startup and indexes the correct lookup table entry.

When flip mode is active, the firmware inverts touch coordinates after the normal calibration transform:

tx = LCD_WIDTH - 1 - tx
ty = LCD_HEIGHT - 1 - ty

This happens transparently — every touch event is remapped so tapping the upper-left corner still registers as upper-left, regardless of physical orientation.

Touch calibration (CONFIG > TOUCH CAL) asks you to tap two corner targets: upper-left and lower-right. When the display is flipped, the firmware swaps which calibration storage slots receive which point. This ensures the calibration data is stored correctly even though the physical screen is rotated.

If you flip the display after calibrating, the existing calibration data remains valid — the coordinate inversion handles the remapping. You only need to recalibrate if touch accuracy feels off.

The hardware jog wheel (lever) uses two GPIO lines for left and right rotation. When flip mode is active, the firmware swaps these bits so that turning the wheel clockwise still moves markers to the right (higher frequency) even though the physical device is upside down.

ModelDefault USB PositionDefault SMA Position
NanoVNA-HTop edgeBottom edge
NanoVNA-H4Side edgeOpposite side

“Default” means DISPLAY_ROTATION_0 — the orientation programmed into the LCD initialization sequence.

The flip is controlled through the config command, which manages all VNA mode toggle bits:

Terminal window
# Enable display flip
config flip 1
# Disable display flip (return to normal)
config flip 0
# Save so it persists across power cycles
saveconfig

The config command accepts 0 (clear bit) or 1 (set bit). There is no query form — if you need to check the current flip state, look at the display orientation or check config._vna_mode in a memory dump.

For a tilting stand where the USB cable exits downward:

  1. Place device in stand with USB connector at the bottom
  2. The display will appear upside down
  3. Go to CONFIG > FLIP DISPLAY
  4. Save with CONFIG > SAVE

When mounting the NanoVNA-H behind a panel cutout:

  1. Determine the required physical orientation for your enclosure
  2. Mount the device
  3. If the display is inverted, flip it via menu or shell
  4. Save configuration

Some aftermarket LCD modules have the ribbon cable on the opposite side, resulting in a 180-degree rotated image:

  1. Install the new LCD module
  2. Power on — if the display is upside down, the module has opposite scan direction
  3. Flip the display via CONFIG > FLIP DISPLAY
  4. Run CONFIG > TOUCH CAL to calibrate touch for the new panel
  5. Save configuration

Can’t Navigate Menu (Display Upside Down)

Section titled “Can’t Navigate Menu (Display Upside Down)”

If the display is inverted and touch coordinates don’t match:

  1. Connect via USB serial terminal (115200 baud)
  2. Type config flip 1 and press Enter
  3. The display flips immediately
  4. Type saveconfig to persist

This is the most common reason to use the shell command — the touch screen is unusable when the display is flipped but the touch coordinates are not.

The coordinate inversion should handle this automatically. If touch accuracy is poor:

  1. Go to CONFIG > TOUCH CAL
  2. Tap the two calibration targets accurately
  3. Save configuration

The calibration procedure accounts for the current flip state — it swaps the calibration point storage order so the data is correct.

This should not happen — the firmware swaps the lever GPIO bits when flip mode is active. If it does occur:

  • Verify the firmware version supports __FLIP_DISPLAY__ (all recent DiSlord-based firmware does)
  • Try toggling flip off and on again
  • Power cycle the device

The flip state is stored in config._vna_mode, which lives in flash memory. If it doesn’t persist:

  1. Make sure you ran saveconfig (or CONFIG > SAVE) after flipping
  2. Check that flash save completed — the device briefly pauses during save
  3. If the device has flash corruption, a full reset and reconfiguration may be needed

The flip display feature is compiled conditionally under the __FLIP_DISPLAY__ flag in nanovna.h. All current production firmware includes this flag. If you are building custom firmware and the FLIP DISPLAY menu item is missing, ensure this define is present:

#define __FLIP_DISPLAY__
  • Touch Calibration (CONFIG > TOUCH CAL): May improve accuracy after flipping
  • Brightness (CONFIG > BRIGHTNESS): Viewing angle changes may benefit from brightness adjustment
  • Grid Style (config grid / config dot): Visual preference toggles stored in the same mode bitfield