Everything seems to be okay, as far as the oscilloscope shows: I can confirm data generates properly and the CPOL and CPHL are set to zero. The CS also sets to be active low, and it becomes high when there is no more bit to transfer. I was not able to confirm slew rate and jitters because I have an old 2-channel oscilloscope. However, I really think those are standards by the protocol itself, so I should not worry about them.
Please let me know if you can help me with this issue.
Question
Nimams
Hi,
I would like to use Pmod DPOT: Digital Potentiometer with Raspberry Pi3.
I have the following code:
#!/usr/bin/python
import spidev
import time
spi = spidev.SpiDev()
spi.open(0, 0)
spi.mode= 0b00
spi.max_speed_hz= 1000000
spi.bits_per_word= 8
#print spi.bits_per_word
#print spi.mode
spi.cshigh= False
#print spi.cshigh
#frame = bytearray(b'\xA5')
frame = bytearray([0xF5])
try:
while True:
resp = spi.xfer2(frame)
#print resp
time.sleep(10)
#end while
except KeyboardInterrupt:
spi.close()
The code is very simple. The python module spidev documentation is here:
http://tightdev.net/SpiDev_Doc.pdf
Everything seems to be okay, as far as the oscilloscope shows: I can confirm data generates properly and the CPOL and CPHL are set to zero. The CS also sets to be active low, and it becomes high when there is no more bit to transfer. I was not able to confirm slew rate and jitters because I have an old 2-channel oscilloscope. However, I really think those are standards by the protocol itself, so I should not worry about them.
Please let me know if you can help me with this issue.
Thank you
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.