Microcontroller.py¶
Microcontroller.py¶
This file has a class that is used to interact with a microcontroller to extract information about the running circuit. This interacts with serial.
- class Microcontroller.Microcontroller(config: Config, logger: Logger)[source]¶
This is a class that represents the microcontroller connected to the FPGA. It is primarily used to interpret the serial output into values that are useful for the rest of the program. It mostly deals with values for fitness functions.
- __init__(config: Config, logger: Logger)[source]¶
Initializes Microcontroller Object
- Parameters:
config (Config) – Configuration object that determines what Microcontroller does.
logger (Logger) – Logger object where this object stores its logging information.
- measure_pulses(circuit: CircuitLegacy)[source]¶
Measures the number of pulses generated by the circuit provided.
- Parameters:
circuit (Circuit) – The circuit we are measuring pulses of
- measure_signal(data_filepath)[source]¶
Measures the signal, writing the waveform data to the provided data file
- Parameters:
circuit (Circuit) – The circuit we are measuring the signal of
- measure_signal_td(data_filepath)[source]¶
Measures (1) the FPGA waveform directly from FPGA output pin and (2) the “state”/frequency waveform directly from the signal-generating Nano. Writes 1000 sample points’ data to a file.
- Parameters:
circuit (Circuit) – The circuit we are measuring the signal of