Wrtiting and SPI Program for Upboard
Hi, I am new to the Upboard environment. I have never used a device like this before; my experience is limited to Arduino. I can’t seem to find any examples online on how to use it.
My plan is to use the SPI pins on the board to send data to a DAC, and use additional pins to control Chip Select and LDAC, which is easy enough after looking through documentation.
But for directly using the SPI pins, I am using RPi.GPIO, and I’m not sure if it has direct support to perform an SPI transfer. If there is a better library for this, I would like to know. So, after all that, my question is: How do you write a program to use SPI on the Upboard in Python?
As a secondary question, Python presumably has ways to read in a .csv file from a USB through a library, yes?
We have a Wiki, you can find it here.
Here is a Quick start guide
- Depending on your ubuntu version, Follow the guide to install and add the UP Repository on your Ubuntu version. For this guide, lets assume Ubuntu 20.04 and UP Squared device
- On Ubuntu 20.04 you can follow this guide here
- Follow the guide to install upboard-extras package and enable HAT functionality from userspace
- Add Groups and User to groups guide here
- Next, you can go on the UP Squared pinout page to identify the 40 Pin HAT and in your case the SPI pins
- Follow the guide to identify SPI device nodes for UP Squared
- Install ACPI overrides to enable SPI in user space and download the Zip file
- After that you should be able to see the spi devices
You will not be able to use the Rpi.GPIO on the Up devices, I will suggest libraries like spidev and libmraa
You can find some more info about libmraa on the wiki
We have provided a SPI tutorial that gets reading from an LDR connected to an ADC chip (MCP3004) connected to an UP Xtreme device using spidev library in python3. You can have a look at it.
- 301 All Categories
- 104 Announcements & News
- 51 Product News - New Product/Product Change Notice/ End-of-life
- 184 Welcome Developers!
- 52 Unboxing & Project Sharing
- 24 Tech Updates
- 546 UP Products
- 1 UP Xtreme i12
- UP Squared Pro 7000
- 1 UP Element i12 Edge
- 10 UP Squared V2
- 25 UP 4000
- 23 UP Xtreme i11
- 34 UP Squared 6000
- 44 UP Squared Pro
- 140 UP Xtreme
- 818 UP Squared
- 1.4K UP Board
- 89 UP Core Plus
- 221 UP Core
- 3 UP Xtreme Lite
- 43 UP AI Edge
- 215 Starter Kits & Peripheral