• Home
    • View
    • Login
    This page
    • Normal
    • Export PDF
    • Page Information

    Loading...
  1. Dashboard
  2. Undefined Space
  3. Device I/O
  4. Setting up and Running SPI Sample (MPC3008)

Page History

Versions Compared

Old Version 2

changes.mady.by.user Jen Dority

Saved on Aug 04, 2014

compared with

New Version 3

changes.mady.by.user Jen Dority

Saved on Aug 04, 2014

  • Previous Change: Difference between versions 1 and 2
  • Next Change: Difference between versions 3 and 4
  • View Page History

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

First build the dio-spi.jar file:

 

cd samples/spi
ant

 

Then copy ../../build/jar/dio-spi.jar to the board.

(On the Pi/iMX6)
For this example you should have SPIDevice entry in your dio.properties file like this example for the raspberry pi:

 

12 = deviceType: spibus.SPIDevice, name:SPI_Slave, deviceNumber:0, address:0, csActive:1, wordLength:8, clockFrequency:500000, clockMode:1, bitOrdering:1

 

Note that these are the current values in the repo which reflect a recent update. Older dio.peprties versions will not work.

 

sudo $JAVA_HOME/bin/java -Djava.library.path=. -Djava.security.policy=./java.policy -classpath .:./dio.jar:dio-samples.jar:dio-spi.jar -Djdk.dio.registry=./dio.properties -Ddeviceaccess.uart.prefix=/dev/ttyAMA dio.spi.MCP3008Sample 12 4

 

Note that "12" is the device manager ID number of the SPIDevice in the example property line shown above. "4" selects the channel on the MPC3008. You should use the channel number connected to the analog circuit you're trying to read.

Overview
Content Tools
ThemeBuilder

Terms of Use
• License: GPLv2
• Privacy • Trademarks • Contact Us

Powered by a free Atlassian Confluence Open Source Project License granted to https://www.atlassian.com/software/views/opensource-community-additional-license-offer. Evaluate Confluence today.

  • Kolekti ThemeBuilder Powered by Atlassian Confluence 8.5.21
  • Kolekti ThemeBuilder printed.by.atlassian.confluence
  • Report a bug
  • Atlassian News
Atlassian
Kolekti ThemeBuilder EngineAtlassian Confluence
{"serverDuration": 340, "requestCorrelationId": "fd5f99804ce0183f"}