Skip to main content

Analog I/O Operations

AT1000 device has 32 Inputs/outputs (which may be further extended by daisy-chaining). Any of those I/Os can be configured as Analog or Digital, independently from the other I/Os. This chapter focuses on the analog mode of operation.

Configuring Analog I/O​

The following code snipped shows how to declare I/Os as analog mode and use them as inputs or outputs.

let test_pin3 = tester.analog_io(3; // GPIO 3 
let test_pin4 = tester.analog_io(4); // GPIO 4

test_pin3.config_input(); // Configure as input
test_pin4.config_output(2.5); // Default output = 2.5V

Let's break this down to different steps:

analog_io method creates an analog Input/output object. It as a parameters the number of the I/O (from 0 to 31)

test_pin3 is a analog I/O, it's configured as an input using the config_input() method. test_pin4 is configured as an analog output using the config_output() method. If no default output voltage is provided, 0.0V is assumed by default.

AT1000 is sequential!

AT1000 and its API are designed to operate in a sequential fashion. Hence, a pin can be configured as an input, then it can be configured as output. The code will be executed sequentially as it was written.

Reading analog input​

To read the analog value of an input that was properly configured, use the read() function. This will return a floating-point voltage value that represents the measured signal on the selected GPIO pin.

let analog_pin5 = tester.analog_io(5); // GPIO 5 
analog_pin5.config_input(); // Configure as analog input
let voltage = analog_pin5.read(); // Read the voltage on GPIO 5

Writing analog output​

To generate an analog output signal on a configured GPIO pin, use the write(value) function. The function takes a voltage value (within the supported range) and sets the output to that level.

let analog_pin6 = tester.analog_io(6); // GPIO 6 
analog_pin6.config_output(2.5); // Default output voltage set to 2.5V
analog_pin6.write(12.9); // Set GPIO 6 to output 12.9V