filiplindau / AD5370

Control of AD5370 40 channel DAC
2 stars 1 forks source link

comments on how to make your code running #1

Open jensS90 opened 5 months ago

jensS90 commented 5 months ago

Hallo Filip,

ich would like to try your code for a Raspberry Pi 5 to control a DAC AD5370 similar as you did for RPi3. So far, I could control the board via its delived software on Windows 10 and by C++ code on Windows from Sandee (https://github.com/sandeepzgk/EVAL-AD5370).

I then moved to Raspberry to control the AD5370 via USB and installed spidev. I see the board under lsusb. Running your "AD5370_control" class it creates a ac = AD5370_control instance.

However, since I have not found any comments in your respository, I am not sure how to proceed. Do I need to install a driver for Linux or something else?

Could you give a recipe of the steps to communicate/set a voltage e.g. with the AD5370 board?

The screenshot shows the current issue. However, I am not sure if I can even address the board only via USB. There might be an issue before.

20240423_17h47m59s_grim

BTW: it also does not work without the line d=str(d). Best regards, Jens

filiplindau commented 5 months ago

Hi Jens,

The program is meant to control the eval board directly over SPI, not USB. You can use the header on the board to interface it with the RPi GPIO pins. You will have to look up were to connect and enable SPI on a RPi5.

The program is old and it seems struck.pack now returns a bytes object instead of str. I think it will work by simply removing the ord(d) like this: write_list = [x+a, d[1], d[0]]

I can't really test it as we are not currently using this board anymore.

/Filip