Code Monkey home page Code Monkey logo

ekg's Issues

Problem transmitting spi data..ioctl: Inappropriate ioctl for device

Dear sir,

first I would like to thank you for great work you have done.
I would like to kindly ask you for a help, we assembled a board utilizing ADAS1000. It communicates via SPI (CS=0) with Raspberry 3B.
We decided to use standard spidev way instead of bcm2835 therefore your code is very suitable for our purpose.
I modified your code changing chip select to 0: SpiOpenPort(0); (it is also necessary to mention that when I leave chip select to 1, the software says: Result = 1: initialization was successful, but we have it on cs=0)
I also lowered the bus speed to Raspberry supported 488000Hz: spi_speed = 488000;
BUT, the first write fails with output:
Problem transmitting spi data..ioctl: Inappropriate ioctl for device

I also checked spidev test result yielding:
spi mode: 0x0
bits per word: 8
max speed: 500000 Hz (500 KHz)

Actually, our board is originally supported by this software based on bcm2835:
https://github.com/martinr89/BiosignalPI
This software requires a bit more of initialization of other pins:
bcm2835_gpio_fsel(PIN18, BCM2835_GPIO_FSEL_OUTP);
bcm2835_gpio_write(PIN18, LOW);
delay(100);
bcm2835_gpio_write(PIN18, HIGH);
delay(100);
bcm2835_gpio_fsel(PIN16, BCM2835_GPIO_FSEL_INPT);
/*
bcm2835_spi_begin();
bcm2835_spi_setBitOrder(BCM2835_SPI_BIT_ORDER_MSBFIRST);
bcm2835_spi_setDataMode(BCM2835_SPI_MODE0);
bcm2835_spi_setClockDivider(BCM2835_SPI_CLOCK_DIVIDER_512);
bcm2835_spi_chipSelect(BCM2835_SPI_CS0);
bcm2835_spi_setChipSelectPolarity(BCM2835_SPI_CS0, LOW);
The original software seems to communicate with the board.
But I don't know how much it is necessary to set the remaining GPIO pins in order for your code to work properly.

Thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.