Skip to content

Latest commit

 

History

History
11 lines (11 loc) · 3.04 KB

DEBUGGING.md

File metadata and controls

11 lines (11 loc) · 3.04 KB

Right now my tests are taking ~10 seconds to pass, and I have no idea why. Previously they would all run in ~1-2 seconds. I suspect there is some communication issue when multiple devices are on the bus.

  • When I unplugged the MCP board and plugged it back in, this issue went away. I need to make my library more robust to multiple devices on the bus, and to ask the user which ID they require. Unique IDs are going to be the only real way to solve this problem.
  • I'm having this hanging issue again. It looks like a problem communicating with the MCP.
  • Sometimes the MCP hangs after getting a data request, and I'm not sure why. This persists even after rebooting the MCP, which implies it's something wrong with pyvisa not cleaning up properly. This even persists after re-uploading code, which tells me that pyvisa fucks with some shit at the system level that it really should not. It appears to be hanging at the list_resources command. I will attempt to reboot my machine. I tried to uninstall and reinstall pyvisa, but it's still hanging at the list_resources command. I'm going to try rebooting my machine now.
  • After rebooting my machine and plugging everything in, pyvisa isn't finding any resources at all. After plugging in and unplugging stuff, it finally started working again.
  • On top of that, when I try to close my MCP with the .close() method, it takes literally forever. It appears the measure() command is really not working the way it is supposed to. Now, pyvisa is again hanging, but after waiting for an extended period of time (~30 seconds) it raised a timeout error.
  • This might actually be an error on my device's end. It looks like when I request 1000 measurements and try to actually do the measurement, it's not working even with the Teensyduino serial monitor. It just hangs indefinitely. It won't even let me close out of the serial monitor. Something really bizarre is happening on my device end. Now the program is crashing.
  • This issue seems to persist. I am able to take 100 measurements without issue, but taking 1000 measurements appears to be impossible. It spits out part of the measurement and then just hangs, and I cannot get it to respond to commands after that. This is something badly wrong with my firmware, or perhaps the Teensy hardware itself. After trying to read 1000 measurements manually, I need to manually reset the Teensy. If I can get this working, all my tests should pass.
  • For some reason, now data transfers are working just fine. I can do 100, 1000, 10000 measurements without issue.
  • AHA! It appears to be an issue with the synchronization interrupts. I am able to replicate the issue reliably. These interrupts are, for some reason, causing my device to hang indefinitely.
  • Sure enough, the synchronization interrupt is getting activated WAY too many times. It looks like the Agilent interface is actually 3.3V, not 5V like the SDG. I am going to have to remove the resistive divider. This is probably getting triggered because we're constantly in an intermediate range where we aren't high or low. Making this tweak should fix the issue.