C program for interface with a PT100 thermocouple, via a MAX31586 amplifier board.
standard pi pico SPI pins are, GPIO16, GPIO17, GPIO18, GPIO19.
GPIO16 = MISO_SDO //Peripheral out, Controller in
GPIO17 = CSB //Chip Select BAR (Active Low)
GPIO18 = SCLK //System Clock
GPIO19 = MOSI_SDI //Controller out, Peripheral in
MAX31865 Hookup
GPIO16 --> SDO
GPIO17 --> CS
GPIO18 --> CLK
GPIO19 --> SDI
mkdir <project name> && cd "$_"
--This repo has a relevant CMakeList in the repo, but should you fork or make changes, the following steps is how to create from scratch--
copy the pico_sdk_import.cmake into you project directory
cp pico-sdk/external/pico_sdk_import.cmake <project repo here>
Create CMakeList.txt file and copy in the following boilerplate text,
touch CMakeLists.txt
cmake_minimum_required(VERSION 3.13)
include(pico_sdk_import.cmake)
project(<insert project name here> C CXX ASM)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
# Initiate the SDK
pico_sdk_init()
add_executable(<insert desired executable name here>
<insert C program name here>
)
pico_enable_stdio_usb(<insert desired executable name here> 1)
#create map/bin/hex/uf2 files etc.
pico_add_extra_outputs(<insert desired executable name here> 1)
# Pull in pico_stdlib, or other required libraries
target_link_libraries(<insert desired executable name here> pico_stdlib)
-- Execute from inside project directory --
mkdir build && cd "$_"
export PICO_SDK_PATH=<path to pico sdk directory>
cmake ..
make
Copy the .uf2 file to the pico.