Intel® Makers
Intel® Edison, Intel® Joule™, Intel® Curie™, Intel® Galileo
Announcements
Welcome - This is a Peer-to-Peer Forum only. Intel has discontinued these products but you may find support from other customers on this Forum
9869 Discussions

Sparkfun ADC Block - Intel Edison MCU Tutorial

JOSE_G_Intel2
Employee
1,007 Views
Intel Edison Sparkfun ADC MCU Function

https://github.com/humberto-garza/SparkFunEdisonADC/blob/master/README.md Back To Main

IndexDescription

This function will read the values from the ADC and send them to the Atom through the /dev/ttymcu01 file Be careful to follow these steps and diagrams to setup your board correctly

ReferencesSetting Up

Follow this diagram to make the right connections:

Information

Follow These steps:

  • Once you have setup the Eclipse IDE to program your MCU and make sure it works, paste the code providedmcu_ADC.c in a new MCU project
  • Make sure to save the project before proceeding
  • Go to Project>Clean and clean all
  • Go to MCU>Build Project
  • Go to MCU>Download
  • Now all you have to do is run the Script provided setup_I2C_MCU.sh and it will just cat dev/ttymcu0 this file in order to see what is being sent from the MCU coming from the ADC
  • To run the script do as follows:

chmod +x setup_I2C_MCU.sh ./setup_I2C_MCU.sh

The Code
  • The Function ADC_read() returns the value read by the ADC according to the configuration set, it returns an int with the value read scalated
  • The value read is sent to the Atom using the file /dev/ttymcu0
Comments
  • Make sure that the MCU IDE is working with your board correctly before you try this code.
  • This sample code will work for this configuration, if you want to use different configurations for the ADC inputs, you can just change this command "i2cset -y 1 0x48 1 0xe312 w"
  • Specifically you need to change the 0xe312 part
  • If you need some help to change the command to the desired configuration, go to the https://github.com/humberto-garza/SparkFunEdisonADC/blob/master/Python/README.md Python Folder to get some help.
  • If you read the ADC while the MCU is communicating with it, you will get so...
0 Replies
Reply