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.
Why Flip the Display
Section titled “Why Flip the Display”- 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
Flip Display via Menu
Section titled “Flip Display via Menu”- Tap the screen to open the menu
- Navigate to
CONFIG - Tap
FLIP DISPLAY - The display immediately rotates 180 degrees
Save the Setting
Section titled “Save the Setting”To make the flip permanent:
- After flipping, go to
CONFIG - Tap
SAVEor use shell commandsaveconfig
Without saving, the display returns to default orientation on power cycle.
What Happens When You Flip
Section titled “What Happens When You Flip”The firmware coordinates four subsystems when you toggle flip:
LCD Hardware Rotation
Section titled “LCD Hardware Rotation”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 orderDISPLAY_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.
Touch Coordinate Inversion
Section titled “Touch Coordinate Inversion”When flip mode is active, the firmware inverts touch coordinates after the normal calibration transform:
tx = LCD_WIDTH - 1 - txty = LCD_HEIGHT - 1 - tyThis happens transparently — every touch event is remapped so tapping the upper-left corner still registers as upper-left, regardless of physical orientation.
Touch Calibration Point Swap
Section titled “Touch Calibration Point Swap”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.
Jog Wheel Direction Swap
Section titled “Jog Wheel Direction Swap”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.
Default Orientation
Section titled “Default Orientation”| Model | Default USB Position | Default SMA Position |
|---|---|---|
| NanoVNA-H | Top edge | Bottom edge |
| NanoVNA-H4 | Side edge | Opposite side |
“Default” means DISPLAY_ROTATION_0 — the orientation programmed into the LCD initialization sequence.
Shell Command
Section titled “Shell Command”The flip is controlled through the config command, which manages all VNA mode toggle bits:
# Enable display flipconfig flip 1
# Disable display flip (return to normal)config flip 0
# Save so it persists across power cyclessaveconfigThe 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.
Practical Scenarios
Section titled “Practical Scenarios”Desktop Stand (USB at Bottom)
Section titled “Desktop Stand (USB at Bottom)”For a tilting stand where the USB cable exits downward:
- Place device in stand with USB connector at the bottom
- The display will appear upside down
- Go to
CONFIG > FLIP DISPLAY - Save with
CONFIG > SAVE
Panel Mount in Enclosure
Section titled “Panel Mount in Enclosure”When mounting the NanoVNA-H behind a panel cutout:
- Determine the required physical orientation for your enclosure
- Mount the device
- If the display is inverted, flip it via menu or shell
- Save configuration
Replacement LCD Module
Section titled “Replacement LCD Module”Some aftermarket LCD modules have the ribbon cable on the opposite side, resulting in a 180-degree rotated image:
- Install the new LCD module
- Power on — if the display is upside down, the module has opposite scan direction
- Flip the display via
CONFIG > FLIP DISPLAY - Run
CONFIG > TOUCH CALto calibrate touch for the new panel - Save configuration
Troubleshooting
Section titled “Troubleshooting”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:
- Connect via USB serial terminal (115200 baud)
- Type
config flip 1and press Enter - The display flips immediately
- Type
saveconfigto 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.
Touch Feels Offset After Flipping
Section titled “Touch Feels Offset After Flipping”The coordinate inversion should handle this automatically. If touch accuracy is poor:
- Go to
CONFIG > TOUCH CAL - Tap the two calibration targets accurately
- Save configuration
The calibration procedure accounts for the current flip state — it swaps the calibration point storage order so the data is correct.
Jog Wheel Moves Marker Wrong Direction
Section titled “Jog Wheel Moves Marker Wrong Direction”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
Flip Doesn’t Persist After Power Off
Section titled “Flip Doesn’t Persist After Power Off”The flip state is stored in config._vna_mode, which lives in flash memory. If it doesn’t persist:
- Make sure you ran
saveconfig(orCONFIG > SAVE) after flipping - Check that flash save completed — the device briefly pauses during save
- If the device has flash corruption, a full reset and reconfiguration may be needed
Feature Flag
Section titled “Feature Flag”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__Related Settings
Section titled “Related Settings”- 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