Installation Guide
This guide covers the installation and setup of the microsync project, including both the Python driver and firmware.
Python Driver Installation
Prerequisites
Python 3.7 or higher
pip package manager
Serial port access (for device communication)
Install Dependencies
Install the required Python packages:
pip install pyserial
Install the microsync Driver
Option 1: Copy the Python directory
# Clone or download the repository
git clone https://github.com/stjude-smc/microsync.git
cd microsync
# Copy the python directory to your project cp -r python/ /path/to/your/project/
# Or add to your Python path export PYTHONPATH=”${PYTHONPATH}:/path/to/microsync/python”
Option 2: Install as a package (recommended for development)
# From the project root directory
pip install -e .
Verify Installation
Test that the driver can be imported:
from microsync import SyncDevice
print("Installation successful!")
Firmware Installation
Prerequisites
Microchip Studio (free download from Microchip)
Arduino Due board
USB cable
Atmel ICE debugger (optional, for debugging)
Build the Firmware
Open the project in Microchip Studio:
# Open the solution file microsync.atsln
Configure build settings:
Set build target to “Release”
Ensure all dependencies are resolved
Build the project:
Press F7 or use Build → Build Solution
Verify successful compilation
Upload to Arduino Due
Method 1: Using Atmel ICE Debugger (Recommended)
Connect Atmel ICE to Arduino Due via JTAG interface
In Microchip Studio, go to Tools → External Tools
Configure ArduinoBootloader tool:
Executable: C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avrdude.exe Arguments: -C"C:\Program Files (x86)\Arduino\hardware\tools\avr\etc\avrdude.conf" -v -patmega2560 -cwiring -PCOM11 -b115200 -D -Uflash:w:"$(ProjectDir)Release\$(TargetName).hex":i
Run the tool to upload firmware
Method 2: Using Arduino IDE (Alternative)
Open Arduino IDE
Set board to “Arduino Due (Programming Port)”
Upload the compiled .hex file
Hardware Setup
Required Connections
USB Connection: Connect Arduino Due to host computer
Laser Shutters: Connect to pins A0-A3 (configurable)
Camera Trigger: Connect to pin A12
Interlock Circuit: Connect between D12 (input) and D13 (output)
Power Supply
The device is powered through the USB connection. No external power supply is required.
Driver Installation (Windows)
Download Arduino drivers from arduino.cc
Install the drivers when prompted
The device will appear as “Arduino Due” in Device Manager
Verification
Test the Complete Setup
Connect the device:
from microsync import SyncDevice # Connect to device (replace COM4 with your port) sd = SyncDevice("COM4") print(f"Connected to device version: {sd.version}")
Test basic functionality:
# Test event scheduling sd.pos_pulse("A0", 1000, N=5, interval=10000) sd.go() # Check status print(sd.get_status())
Verify communication:
# Test property access print(f"System timer running: {sd.running}") print(f"Number of events: {sd.N_events}")
Troubleshooting
Common Issues
Connection Error: - Verify correct COM port - Check USB cable connection - Ensure drivers are installed
Version Mismatch: - Update firmware to match Python driver version - Check version compatibility
Permission Errors: - Run as administrator (Windows) - Check serial port permissions (Linux/Mac)
Build Errors: - Verify Microchip Studio installation - Check ASF (Atmel Software Framework) installation - Ensure all dependencies are resolved
Getting Help
Check the README for troubleshooting tips
Review the README for hardware documentation
Open an issue on GitHub
Next Steps
After successful installation:
Read the Quick Start Guide guide
Explore the Python API Reference documentation
Try the examples in the Jupyter notebook
Review the README for hardware setup