Search found 35 matches

by javaben
Sun May 13, 2018 5:53 pm
Forum: General Discussion
Topic: C++ SPI for Max 31855 Thermocouple Amp
Replies: 28
Views: 30075

Re: C++ SPI for Max 31855 Thermocouple Amp

I wrote my own code, which follows. It works for me. Thanks everyone for your assistance! BTW - this is being used as a 4 channel temperature monitor/sensor for smoking BBQ. It will later be used with a controller Output is after code section. JavaBen /* * MAX31855 Thermocouple Temperature Software ...
by javaben
Sat May 12, 2018 8:04 pm
Forum: General Discussion
Topic: C++ SPI for Max 31855 Thermocouple Amp
Replies: 28
Views: 30075

Re: C++ SPI for Max 31855 Thermocouple Amp

Chegewara, I re-cloned Kolban's cpp_util, and copied the SPI.h and SPI.cpp into my project. I ensured my pin configuration were correct for HSPI. Running it, didn't produce any data, except a constant 1. In SPI.cpp I un-comented the #define DEBUG 1 so it would print out. I don't get any errors from ...
by javaben
Sat May 12, 2018 1:46 pm
Forum: General Discussion
Topic: C++ SPI for Max 31855 Thermocouple Amp
Replies: 28
Views: 30075

Re: C++ SPI for Max 31855 Thermocouple Amp

These are my current settings: uint32_t thermocoupleData = 0; buscfg.mosi_io_num = HSPI_MOSI; buscfg.miso_io_num = HSPI_MISO; buscfg.sclk_io_num = HSPI_SCK; buscfg.quadwp_io_num = -1; buscfg.quadhd_io_num = -1; buscfg.max_transfer_sz = 4; //4 BYTES??? buscfg.flags = SPICOMMON_BUSFLAG_MASTER | SPICOM...
by javaben
Sat May 12, 2018 1:39 pm
Forum: General Discussion
Topic: C++ SPI for Max 31855 Thermocouple Amp
Replies: 28
Views: 30075

Re: C++ SPI for Max 31855 Thermocouple Amp

Chegewara, Thanks for taking time to reply with your post. I tried using this previously, but while it compiled, flashed, ran, and didn't report any errors, my data was always zero - all 32 bits. However, my knowledge level has increased "somewhat" so now maybe I'll be able to find a setting that wi...
by javaben
Sat May 12, 2018 4:28 am
Forum: General Discussion
Topic: C++ SPI for Max 31855 Thermocouple Amp
Replies: 28
Views: 30075

Re: C++ SPI for Max 31855 Thermocouple Amp

Here is some pseudo-code of what I'm trying to do: //use the ESP32 hardware SPI to obtain data from a MAX31855 thermocouple amplifier. 1. Initialize the ESP32, informing it of the HSPI standard pins to be used, clock rate, MISO, CS, CLK pins, setting MOSI -1. 2. Add the device and get a handle to it...
by javaben
Sat May 12, 2018 4:03 am
Forum: General Discussion
Topic: C++ SPI for Max 31855 Thermocouple Amp
Replies: 28
Views: 30075

Re: C++ SPI for Max 31855 Thermocouple Amp

Chegewara, I appreciate your response, but you are missing the point of my question. I'm familiar with how to work with the data, once I have obtained it. The difficulty is in obtaining it, while using C++ and explicitly the ESP32 API functions while performing ESP32 hardware SPI. So, providing code...
by javaben
Sat May 12, 2018 2:12 am
Forum: General Discussion
Topic: C++ SPI for Max 31855 Thermocouple Amp
Replies: 28
Views: 30075

Re: C++ SPI for Max 31855 Thermocouple Amp

HI Archibald! The clock should be running at 10KHz per devcfg.clock_speed_hz = 10000. It's my understanding the clock pulses are being sent to the the Max31855 continualisly, but only read by the Max3 as long as the CS is held low, until all 32 bits were transferred, then it stops sending data until...
by javaben
Fri May 11, 2018 10:44 pm
Forum: General Discussion
Topic: C++ SPI for Max 31855 Thermocouple Amp
Replies: 28
Views: 30075

Re: C++ SPI for Max 31855 Thermocouple Amp

This is what I currently have, but am unsure now how to proceed: #include <iostream> #include <driver/spi_master.h> #include <esp_err.h> #define HSPI_MISO 12 #define HSPI_MOSI -1 //pin 13 if used #define HSPI_SCK 14 #define HSPI_SS 15 extern "C" { void app_main(void); } class BruteForce { public: Br...
by javaben
Fri May 11, 2018 10:35 pm
Forum: General Discussion
Topic: C++ SPI for Max 31855 Thermocouple Amp
Replies: 28
Views: 30075

Re: C++ SPI for Max 31855 Thermocouple Amp

Hi Archibald! Thanks so much for your assistance! I was taking a break for a while, and will be heading out with my wife for the evening. I'll try your suggestions tomorrow. Regarding the size of 14; no, I was setting it to 4, as I understood I was specifying 'bytes' and the response from the MAX318...
by javaben
Fri May 11, 2018 8:56 pm
Forum: General Discussion
Topic: C++ SPI for Max 31855 Thermocouple Amp
Replies: 28
Views: 30075

Re: C++ SPI for Max 31855 Thermocouple Amp

Here's an example of something in the manual that is confusing me: The MAX31588 is only addressed via the chip select line (CS); no addressing is necessary, and no commands are necessary to be sent to the device (no MOSI). So MOSI is set to -1 in the spi_bus_config_t. I'm assuming I've got to cycle ...