Jump to content

Search the Community

Showing results for tags 'raspberry pi'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • News
    • New Users Introduction
    • Announcements
  • Digilent Technical Forums
    • FPGA
    • Test and Measurement
    • Measurement Computing (MCC)
    • Add-on Boards
    • Digilent Microcontroller Boards
    • Non-Digilent Microcontrollers
    • LabVIEW
    • FRC
    • Other
  • General Discussion
    • Project Vault
    • Learn
    • Suggestions & Feedback
    • Buy, Sell, Trade
    • Sales Questions
    • Off Topic
    • Educators
    • Technical Based Off-Topic Discussions
    • Archived

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL







Found 12 results

  1. We are using a raspberry pi to collect temperature measurements using the USB-TC. We have successfully downloaded the correct usb drivers and have been able to read the temperature from just 1 thermocouple using the test-usb-tc program, but we do not have a way to collect data from multiple inputs and save them to a file like txt. We followed the instructions provided from MCC here https://www.mccdaq.com/TechTips/TechTip-9.aspx but do not know the way forward after that.
  2. Our team at the moment is trying to determine whether a single, remotely-accessible headless Raspberry Pi 4 could possibly drive two Digital Discovery logic analyzers in parallel(both sampling at the same time) allowing for a total of 64 sampling channels. We would like to receive some insight on whether this implementation could be conducted in a stable and efficient manner based on the hardware and software capabilities of the logic analyzer and Raspberry Pi in combination. If this implementation is possible, would it require two instances of the Waveforms software or could both analyzers operate under a single instance of the software? Finally, in order to utilize the full functionality of the Waveforms software, or at least that which pertains to adjusting and automating the sampling and capturing of signals, is it assumed that the Pi will need to have a GUI in effect? Initially we were looking for an analyzer which could be driven via console commands exclusively, but we can set up the GUI if it is necessary for the Waveforms operation. Any help and clarification would be greatly appreciated. Thank you!
  3. I just want to read back something besides 0x00 on my raspberry pi. Is it possible to adjust the MISO to be 0xAA for example? This is with respect to the WaveForms program under the Logic sub menu. The Analog discovery is showing me what the Master is writing (DEADBEEF), so I am confident I have hooked things up correctly. I'm not sure if this is even possible, please feel free to correct me either way. Edit: I found the protocol submenu where I can write custom scripts, this will probably achieve what I want. I will add what I find to this topic if I get it working.
  4. I have just installed Windows 11 ARM64 on my Raspberry Pi 4. It works great, but WaveForms seems to be not able to start. After a successful installation I tried to run WaveForms beta v3.17.17 64-bit, and I got the following error: "The code execution cannot proceed because VCRUNTIME140.dll was not found. Reinstalling the program may fix this problem." Can I do something differently or is ARM64 Windows simply not supported (yet)?
  5. Hi, I am using Raspberry Pi 4 and Analog discovery 2 to building a sampling system. The trigger signal is generated by the raspberry pi and routed to the second analog input channel. The trigger signal has a voltage of 4 V and the trigger mode is set as Positive edge. From the lab oscilloscope, the trigger signal is observed while it is not read out by the analogIn channel of the Analog discovery 2 oscilloscope (it shows that the system stopped at Reading analog in status) . I am wondering whether there is anything wrong with my codes (shown as attached codes, especially in the trigger setting part), hope to have your advice. Best regards, Zeyu from time import sleep import RPi.GPIO as GPIO import signal from ctypes import * from dwfconstants import * import math import time import matplotlib.pyplot as plt import sys import numpy from csv import writer import pandas as pd if sys.platform.startswith("win"): dwf = cdll.dwf elif sys.platform.startswith("darwin"): dwf = cdll.LoadLibrary("/Library/Frameworks/dwf.framework/dwf") else: dwf = cdll.LoadLibrary("libdwf.so") #declare ctype variables hdwf = c_int() sts = c_byte() hzAcq = c_double(1e8) nSamples = int(1e4) cAvailable = c_int() cLost = c_int() cCorrupted = c_int() fLost = 0 fCorrupted = 0 #print(DWF version version = create_string_buffer(16) dwf.FDwfGetVersion(version) print("DWF Version: "+str(version.value)) #open device for j in range(1, 3, 1): print("Opening first device") dwf.FDwfDeviceOpen(c_int(-1), byref(hdwf)) rgSamples1 = (c_int16*nSamples)() if hdwf.value == hdwfNone.value: szerr = create_string_buffer(512) dwf.FDwfGetLastErrorMsg(szerr) print(str(szerr.value)) print("failed to open device") quit() print("Generating sine wave...") dwf.FDwfAnalogOutNodeEnableSet(hdwf, c_int(0), AnalogOutNodeCarrier, c_bool(True)) dwf.FDwfAnalogOutNodeFunctionSet(hdwf, c_int(0), AnalogOutNodeCarrier, funcSine) dwf.FDwfAnalogOutNodeFrequencySet(hdwf, c_int(0), AnalogOutNodeCarrier, c_double((90.0+j)*hzAcq.value/nSamples)) dwf.FDwfAnalogOutNodeAmplitudeSet(hdwf, c_int(0), AnalogOutNodeCarrier, c_double(5)) dwf.FDwfAnalogOutConfigure(hdwf, c_int(0), c_bool(True)) #set up acquisition dwf.FDwfAnalogInChannelEnableSet(hdwf, c_int(0), c_bool(True)) dwf.FDwfAnalogInChannelRangeSet(hdwf, c_int(0), c_double(5)) dwf.FDwfAnalogInAcquisitionModeSet(hdwf, acqmodeRecord) dwf.FDwfAnalogInFrequencySet(hdwf, hzAcq) dwf.FDwfAnalogInRecordLengthSet(hdwf, c_double(nSamples/hzAcq.value)) # -1 infinite record length def lopper(): for i in range(1,300): GPIO.output(7,0) sleep(0.001) GPIO.output(8,1) sleep(0.001) GPIO.output(8,0) GPIO.output(7,1) sleep(0.001) GPIO.output(7,0) GPIO.setmode(GPIO.BCM) GPIO.setup(7,GPIO.OUT) GPIO.setup(8,GPIO.OUT) lopper() dwf.FDwfAnalogInTriggerAutoTimeoutSet(hdwf, c_double(0)) #disable auto trigger dwf.FDwfAnalogInTriggerSourceSet(hdwf, trigsrcDetectorAnalogIn) #one of the analog in channels dwf.FDwfAnalogInTriggerTypeSet(hdwf, trigtypeEdge) dwf.FDwfAnalogInTriggerChannelSet(hdwf, 1) # first channel dwf.FDwfAnalogInTriggerLevelSet(hdwf, c_double(3.5)) # 0.5V dwf.FDwfAnalogInTriggerConditionSet(hdwf, trigcondRisingPositive) # dwf.FDwfAnalogInTriggerHoldOffSet(hdwf, c_double(0.01)) GPIO.cleanup() print("Starting dwf.FDwfAnalogInConfigure(hdwf, c_bool(False), c_bool(True)) dwf.FDwfAnalogOutConfigure(hdwf, c_int(0), c_bool(True)) dwf.FDwfAnalogOutReset(hdwf, c_int(0)) iSample = 0 while True: dwf.FDwfAnalogInStatus(hdwf, c_int(0), byref(sts)) dwf.FDwfAnalogInStatusRecord(hdwf, byref(cAvailable), byref(cLost), byref(cCorrupted)) iSample += cLost.value iSample %= nSamples if cLost.value : fLost = 1 if cCorrupted.value : fCorrupted = 1 iBuffer = 0 #wait at least 2 sec while cAvailable.value>0: cSamples = cAvailable.value # we are using circular sample buffer, make sure to not overflow if iSample+cAvailable.value > nSamples: cSamples = nSamples-iSample dwf.FDwfAnalogInStatusData16(hdwf, c_int(0), byref(rgSamples1, sizeof(c_int16)*iSample), c_int(iBuffer), c_int(cSamples)) # get channel 1 dat iBuffer += cSamples cAvailable.value -= cSamples iSample += cSamples iSample %= nSamples if sts.value == DwfStateDone.value : # done break dwf.FDwfDeviceCloseAll() if iSample != 0 : rgSamples1 = rgSamples1[iSample:]+rgSamples1[:iSample] print("Recording done "+str(iSample)) if fLost: print("Samples were lost! Reduce frequency") if fCorrupted: print("Samples could be corrupted! Reduce frequency") List = [] for v in rgSamples1: List.append(v) with open("record5.csv", "a") as f_object: writer_object = writer(f_object) writer_object.writerow(List) f_object.close() plt.plot(numpy.fromiter(rgSamples1, dtype = numpy.int16)) plt.show() file=open("record6.csv","w") df=pd.read_csv("record5.csv",header=None, low_memory=False) data=df.values data=list(map(list,zip(*data))) data=pd.DataFrame(data) data.to_csv(file,header=0,index=0) text = open("record6.csv", "r") text = ' '.join([i for i in text]) text = text.replace(",", " ") file = open('read.txt', 'w') file.write(text) file.close()
  6. Materials to be used 1、STONE STWI101WT-01 2、FTP thermal printer head 3、Raspberry Pi pico 4、Coin-operated machine Function The control function is displayed on the serial screen, the main interface selects the floor, after entering the main interface selects the parking space, at the same time it will display the parking space number in the text box on the top right, then selects the stay time, it is two scrolling text selectors, then also the same will display the order information in the text box on the top right, according to the fixed unit price which multiplies with the stay time to get the total price. Then only when the parking space and the stay time are selected, you can go to the payment button, otherwise it is invalid. After entering the payment screen, a coin acceptor will be used. Then the screen will show the number of coins to be put in and the number of coins already put in. After the coins have been put in, a payment success message will be displayed. Then you can choose to print a small ticket to print the place number and time on the thermal paper. Circuit I have design a circuit by myself in order to drive many components, and the overall circuit diagram is like this, the upper left corner is the communication socket and power supply socket, below there is a buzzer (not actually used in the circuit), there is a light-emitting diode on the right, and the lower right corner is a 30pin fpc for connecting the print head.
  7. Hi, I want to connect the pmod oled display to my raspberry pi, but I'm not really getting the hang of how I should wire it. If someone can explain where to plug in each pin and how to code it that would be great. Thank you.
  8. What is the good method transfering the eight bits via SPI to DPOT using a raspberry pi? spi.writebytes accepts int arrays only. many thnaks
  9. Hi, I have a very basic .NET 5 based C# console application that opens the Analog Discovery 2 using the DWF.cs wrapper class included in the WaveForms SDK v3.15.5 (64-bit) on Windows. I could install the .NET 5 runtime on my Raspberry Pi 4 B, and I could run other .NET apps on it without any issues. I created a small application that opens my AD2 and starts acquiring data from its CH1 input. It runs as expected on Windows 10, but when I run it on the 32-bit Raspberry Pi OS I got the following error: Unhandled exception. System.DllNotFoundException: Unable to load shared library 'dwf.dll' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libdwf.dll: cannot open shared object file: No such file or directory at dwf._FDwfGetVersion(StringBuilder szVersion) at dwf.FDwfGetVersion(String& szVersion) in /home/pi/Work/BioBalanceDetector/Measurements/WaveForms/Experiments/SleepLogging/csharp/SleepLogger/dwf.cs:line 212 at SleepLogger.Program.Main(String[] args) in /home/pi/Work/BioBalanceDetector/Measurements/WaveForms/Experiments/SleepLogging/csharp/SleepLogger/Program.cs:line 17 Is there a way to install the missing DWF DLLs or their Linux/Raspberry alternatives on my Raspberry Pi and make my app work? I have WaveForms 3.14.3 (32-bit) already installed on the Raspberry Pi.
  10. I currently have a Raspberry Pi 4B with Waveforms installed connected to a Digilent Analog Discovery 2. The device works as intended, and I have a VNC connection set up so that I can remotely use it. The Waveforms software itself has a weird feature where the keyboard seems to be mapped incorrectly. For example, the key '1' returns '9', '2' returns '0', etc... I have used a web browser and a terminal on the RPi and neither had the same feature. Any advice?
  11. As a newcomer to the very clever but quite sophisticated Raspberry Pi computers, can anyone provide a worked example of what files (and how) to load into the new Pi 4/8GB please? The wiki page images are a bit blurred and I'm not sufficiently up to speed to work out from first principles how to install the Adept2 and Waveforms packages. (45+ years of working in microprocessor code and hardware development have left me with a real appreciation of RTMF, but my age suggests I could do with a little help, please!)
  12. Hi there, I am in need of help communicating with my Pmod AD5 using the SPI on raspberry pi 3. I am pretty new to SPI and have troubleshooted and searched the web for solutions over the past week but have yet to solve this problem. Here are some of the steps that I have done: 1) managed to read values using the Arduino Library linked on the product page and with an Arduino UNO, by connecting VCC of Pmod AD5 to 5V (I am not sure what I cannot read anything when connected to 3.3V) 2) understood what SPI is about and what the Arduino Library is doing (or what I think was logical) - read through the whole AD7193 datasheet to understand the registers etc.. 3) extracted the outputs (Binary/hexa format) that the Arduino was sending to the Pmod AD5, understood them, and attempted to use them in raspberry pi with the spidev library but with no progress .. 4) tested by raspberry pi's SPI (they are enabled) using the same spidev library and successfully communicated and got values from a simpler ADC: mcp3008 using this 5) checked the wiring to ensure everything is intact and correctly connected For my application, I intend to read ADC values up at speeds up to 1kHz over 2 channels and hence have chosen this Pmod AD5. For testing wise, I have connected a potential divider across A1 and A2 on the AD5 and am able to read the voltage changes when using Arduino but not in raspberry pi 3. Here's my python code using the spidev on raspberry pi 3 (have connected to CE0): ####################### START OF CODE ################ import spidev import time spi = spidev.SpiDev() spi.open(0,0) spi.max_speed_hz = 50000 spi.mode=0b00 resp = spi.xfer2([0xFF, 0xFF, 0xFF, 0xFF, 0xFF]) print('Resetting...', resp) time.sleep(0.5) ##resp = spi.xfer2([0x08, 0x18, 0x00, 0x60]) ##print('Enable DAT_STA Bit', resp) ##time.sleep(0.5) resp = spi.xfer2([0x10, 0x00, 0x01, 0x10]) print('Set PGA Gain = 1, Buffer = 1', resp) time.sleep(0.5) ##resp = spi.xfer2([0x08, 0x18, 0x00, 0x64]) ##print('Setting filter rate select bits to 100', resp) ##time.sleep(0.5) ## ##resp = spi.xfer2([0x08, 0x98, 0x00, 0x64]) ##print('Initiate internal calibration, starting w zero-scale', resp) ##time.sleep(0.5) ## ##resp = spi.xfer2([0x08, 0xB8, 0x00, 0x64]) ##print('Full-scale calibration...', resp) ##time.sleep(0.5) while True: #choose channel resp = spi.xfer2([0x10, 0x00, 0x01, 0x00]) resp = spi.xfer2([0x58, 0x00, 0x00, 0x00]) time.sleep(0.1) print('data:', resp) ####################### END OF CODE ################ Here's what most of my output looks like when I run the code (kind of the same code regardless of whether I have or not have anything connected in A1/A2 - it is unreactive even when I connect my potential divider and change the potential): Resetting... [254, 170, 128, 193, 255] Set PGA Gain = 1, Buffer = 1 [0, 0, 0, 0] data: [0, 0, 0, 0] data: [0, 0, 0, 0] data: [0, 40, 128, 0] data: [0, 255, 255, 255] data: [255, 255, 255, 255] data: [255, 255, 255, 255] data: [255, 255, 255, 255] data: [255, 232, 191, 255] data: [255, 255, 255, 255] data: [255, 255, 255, 255] data: [255, 255, 255, 255] data: [255, 255, 255, 255] data: [255, 232, 191, 255] data: [255, 255, 255, 255] data: [255, 255, 255, 255] data: [255, 255, 255, 255] data: [255, 255, 255, 255] data: [255, 232, 191, 255] data: [255, 255, 255, 255] data: [255, 255, 255, 255] data: [255, 255, 255, 255] data: [255, 255, 255, 255] data: [255, 232, 191, 255] data: [255, 255, 255, 255] data: [255, 255, 255, 255] data: [255, 255, 255, 255] data: [255, 255, 255, 255] data: [255, 232, 191, 255] data: [255, 255, 255, 255] etc... etc... This was the code I used to successfully read from the simpler MCP3008 ADC: ####MCP3008 ## adcnum = 0 #### r = spi.xfer2([1, (8+adcnum)<<4,0]) ## r = spi.xfer2([1, 0x80, 0]) ## print(r) #### result = ((r[1]&3) << ? +r[2] #### print(result) ## time.sleep(0.1) For more clarity, this is the Arduino code that I was using and got working with UNO: /************************************************************************ * * Test of the Pmod * ************************************************************************* * Description: Pmod_AD5 * The result of the A / D conversion of the AIN1 channel is displayed on the serial monitor. * * * Material * 1. Arduino Uno * 2. Pmod AD5 (do not touch the jumper and * dowload library https://github.com/annem/AD7193) * ************************************************************************/ #include <SPI.h> // Call of libraries #include <AD7193.h> AD7193 AD7193; // Creation of the object AD7193 unsigned long valeur; float tension; void setup() { Serial.begin(9600); // initialization of serial communication Init_AD7193(); } void loop() { valeur = AD7193.ReadADCChannel(0); // conversion A/N on input 1 valeur = valeur >> 8; // Extraction of value tension = AD7193.DataToVoltage(valeur); // Recovery of tension Serial.println(""); Serial.print("Valeur="); Serial.print(valeur); Serial.print('\t'); // tabulation Serial.print("Tension="); Serial.print(tension); Serial.println("V"); } // Initialisation du module Pmod AD5 void Init_AD7193(void) { AD7193.begin(); // initialization of Pmod AD5 module AD7193.AppendStatusValuetoData(); // configuration of Pmod AD5 module AD7193.SetPGAGain(1); AD7193.SetAveraging(100); AD7193.Calibrate(); AD7193.ReadRegisterMap(); } Would highly appreciate if anyone can help to give me tips on how to proceed or whether I am doing or understanding anything wrongly. Thank you very much.
  • Create New...