Not able to turn a pin to be zero - Raspberry Pi Forums


hello,

have scheme raspberry communicating adc via spi. however, gpio9 (miso) becomes high
used wiringpi make 0 again

code: select all

import wiringpi wiringpi.wiringpisetupgpio() wiringpi.pinmode(9,1) wiringpi.digitalwrite(9,0) wiringpi.pinmode(9,0) wiringpi.digitalread(9) 
code above gives me 1.
tried that:

code: select all

echo "9" > /sys/class/gpio/export echo "out" > /sys/class/gpio/gpio9/direction echo "0" > /sys/class/gpio/gpio9/value echo "in" > /sys/class/gpio/gpio9/direction cat /sys/class/gpio/gpio9/value 
gives me 1.
be?
smth wrong wiring or software using these pins?

thank in advance

while using gpio pin spi device, spi peripheral has control on state of pin.

why think need change state of gpio pin logic zero? pin talking miso pin (master in slave out) meaning pin input raspberry pi. if pin connected adc, adc maybe holding line @ logic 1 (3.3v).

whether pin held @ logic 1 or logic 0 when no spi communication occurring depends on mode of spi device.


raspberrypi



Comments

Popular posts from this blog

Error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode - Raspberry Pi Forums

class MPU6050 has no member named begin

missing filename after '-o'