How to use the analog input?

Discussion in 'Application & Utilities' started by cyrilf, Dec 10, 2015.

  1. cyrilf

    cyrilf Active Member

    Joined:
    Feb 19, 2015
    Messages:
    168
    Likes Received:
    47
    Hello,

    I would like to read the analog input from the CPU under Linux and I wonder how should I do this. I can see 12 analog inputs on the UDOO pinout diagram but they seems to be connected to the SAM3x, am I right?
    Thank you.
     
  2. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
    You can't, since no pin, as you said, is connected to i.MX 6.
     
  3. cyrilf

    cyrilf Active Member

    Joined:
    Feb 19, 2015
    Messages:
    168
    Likes Received:
    47
    OK thanks for this clear answer :)

    Is there a way to program the Arduino using Arduino IDE on Linux x64? I don't have UDOObuntu on my UDOO but a custom Linux based on official https://github.com/UDOOboard/Kernel_Unico sources.
     
    Last edited: Dec 10, 2015
  4. cyrilf

    cyrilf Active Member

    Joined:
    Feb 19, 2015
    Messages:
    168
    Likes Received:
    47
    Last edited: Dec 10, 2015
  5. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
    You should follow this guide in order to use Arduino IDE ArmHF on UDOO running a custom Linux.
     
  6. cyrilf

    cyrilf Active Member

    Joined:
    Feb 19, 2015
    Messages:
    168
    Likes Received:
    47
    This is still an old 32-bits version of Arduino IDE. I'm trying to figure out how to make it work on my 64-bits computer.
    Hm there is even lib compiled for ARM in it :
    Is that an Arduino IDE compiled to be run directly on the UDOO?
     
    Last edited: Dec 10, 2015
  7. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
  8. cyrilf

    cyrilf Active Member

    Joined:
    Feb 19, 2015
    Messages:
    168
    Likes Received:
    47
    I downloaded Arduino IDE 1.5.4 for Linux x64 here: http://arduino.cc/download.php?f=/arduino-1.5.4-linux64.tgz
    I downloaded the Bossac file for Linux x64 here: http://udoo.org/download/files/Bossac/bossac_linux64.tar.gz
    I followed all the steps from the tutorial here: http://udoo.org/docs/Arduino/Program_UDOO_Arduino_Processor_From_External_PC
    I'm able to run Arduino IDE but the "Tools > Port" option stay disabled. The USB port is connected to CN6 USB and J16 and J18 are disabled.
    In ls /dev I can see the board as ttyUSB0.
    I selected Arduino Due (Programming Port) and here is what I get:
    I get the same output with Native USB Port.
     
  9. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
    If you plug J18 and reboot are you able to see the Linux bash? We have to exclude that the serial-to-usb converter is burned.
     
  10. cyrilf

    cyrilf Active Member

    Joined:
    Feb 19, 2015
    Messages:
    168
    Likes Received:
    47
    Yes, I can log in using picocom at the same USB port:
     
  11. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
    Actually I don't know how the Kernel UNICO works with bossac.
    Would it be a problem for you to shift to the new Kernel? You'd get big improvements in performance. It will be official in short time.
    Kernel 3.14.56: https://github.com/UDOOboard/linux_kernel
     
    cyrilf likes this.
  12. cyrilf

    cyrilf Active Member

    Joined:
    Feb 19, 2015
    Messages:
    168
    Likes Received:
    47
    No this isn't an issue. Does that kernel support bossac? I'd say, arduino programing?
     
    Last edited: Dec 17, 2015
  13. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
    Yes it does.
    https://github.com/UDOOboard/bossac
    It support Arduino programming internally. Externally it's coming ;) for now you have to rely on the Web Control Panel for this
     
  14. cyrilf

    cyrilf Active Member

    Joined:
    Feb 19, 2015
    Messages:
    168
    Likes Received:
    47
    OK thanks. I'll try it.
     
    Andrea Rovai likes this.
  15. cyrilf

    cyrilf Active Member

    Joined:
    Feb 19, 2015
    Messages:
    168
    Likes Received:
    47
    Which .dts file do you use? I've compiled with imx6q-udoo-lvds7.dts (I have the 7" touch screen) :
    Code:
    MAKE_JOBS=$(cat /proc/cpuinfo | grep processor | wc -l)
    TOOLCHAIN=arm-linux-gnueabihf-
    make ARCH=arm CROSS_COMPILE=$TOOLCHAIN udoo_quad_defconfig
    make -j$MAKE_JOBS ARCH=arm CROSS_COMPILE=$TOOLCHAIN uImage LOADADDR=0x10008000 modules
    make -j$MAKE_JOBS ARCH=arm CROSS_COMPILE=$TOOLCHAIN imx6q-udoo-lvds7.dtb
    I get in U-Boot after loading:
     
    Last edited: Dec 21, 2015
  16. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
    Dear cyrilf,
    in the uboot you have to change fdt_file variable because in the uboot it directs to "imx6q-udoo.dtb"
     
  17. cyrilf

    cyrilf Active Member

    Joined:
    Feb 19, 2015
    Messages:
    168
    Likes Received:
    47
  18. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
    Dear cyrilf,
    regarding the Wi-Fi probably it's an error due to defconfig missing.
    Regarding the touch you should search for i2c3
     
  19. cyrilf

    cyrilf Active Member

    Joined:
    Feb 19, 2015
    Messages:
    168
    Likes Received:
    47
    As you can see in my imx6qdl-udoo.dts file, I2C3 is enabled.
    Which defconfig file do you use to support UDOO Quad hardware? I've used udoo_quad_defconfig.
     
  20. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
    On this concern, another thing you could check for the Wi-Fi is if you installed ralink-firmware package
    Can't remember if for LVDS you need some package, but I don't believe. Please post the output of dmesg on a pastbin
     

Share This Page