SPI issues on CS line

Started by vnv, November 22, 2022, 06:00:18 pm

Previous topic - Next topic

vnv

Hello everyone,

there are issues on CS line for SPI which are very very strange.

So I have a small code running in python which sends out 0x40 command and does the read.
Problem is that CS bounces down/up couple of times before doing real clocking which puts device in some bad state because devices doesn't expect CS to bounce for no reason.

Here is the code:

#!/usr/bin/env python

import os
import sys

if not os.getegid() == 0:
    sys.exit('Script must be run as root')

from time import sleep
from pyA20Lime import spi

spi.open("/dev/spidev1.0", mode=0, delay=0, bits_per_word=8, speed=500000)

while True:

    spi.write([0x40])
    value = spi.read(2)
    print value

    sleep(0.4)

spi.close()


And here are the images what goes on,


https://pasteboard.co/GEp40MmZ14i6.png

https://pasteboard.co/A2EigGNS9XSk.png





Does anyone knows what could this be and why would CS pin bounce before actual clock cycles start to go out?


BR!