Added the capacitance reading device (based on TSSOP16, paired with an Arduino Nano V3, communication over serial) to the PSI NMR setup

This commit is contained in:
2025-07-11 11:34:48 +02:00
parent 44a4d921af
commit ccd15f50e7
4 changed files with 57 additions and 9 deletions

View File

@@ -0,0 +1,20 @@
import serial
from frappy.core import Readable, Parameter, FloatRange, HasIO, StringIO, Property, IntRange, IDLE, BUSY, WARN, ERROR, Drivable, BoolType, Attached
class TSSOP16_IO(StringIO):
end_of_line = '\r'
identification = [ ('*IDN?', r'0x48,ACM1219,.*') ]
class TSSOP16(HasIO, Readable):
'''only configured for channel 1'''
ioClass = TSSOP16_IO
value = Parameter('capacitance', FloatRange(unit='pF'), readonly=True)
pollinterval = Parameter(default=0.1)
def read_value(self):
l = self.communicate('readCVT')
vals = l.split(',')
vals = [ float(v) for v in vals ]
return vals[0]

View File

@@ -232,6 +232,7 @@ class ProgrammedSequence(fc.Readable):
filename = filepath + '/sequences/' + filename.replace('.','')
seq_gen.save_sequence(filename, seq)
seq_gen.save_sequence_cfg(filename, seq)
print(filename)
dashboard_params = { 'Observe Freq.': self.read_obs_freq(),
'Scans 1D': self.read_num_scans(),
@@ -247,6 +248,7 @@ class ProgrammedSequence(fc.Readable):
# then, load the thing into TNMR
self.tnmr().load_sequence(filename)
print(filename)
# load some parameters back to TNMR
for key, val in dashboard_params.items():