MAX6675 with PIC32MX795F512L

As I mentioned earlier I’m using the USB Starter Kit II, the PIC32 Expansion Board, the SSD1926 PicTail Plus board, and a Truly 3.2″ 320×240 LCD display board to develop the roaster system. This has resulted in some “fun” trying to figure out which pins are really going where on the board and the PicTail cards that you can build your own circuits on. Occasionally some of the pins are not exactly labeled the right way or else there are a few pins that are wired together on the circuit boards making you unable to use one of the pins that are wired together or in some cases both cannot be used etc.

I’ve been working through various demos and trying to understand some of the libraries and still trying to identify all of the pins on the expansion board that are already attached to the LCD / graphics chip. So far I have not found any that involved the SPI1 Pins, which I’m sure is incorrect now.

I’ve now managed to get real time readings to occur while using SPI2 instead of SPI1. Originally I was using pins B2 (SS1), C4 (SDI1) , and D10 (SCK1). to communicate with the MAX6675 thermocouple. When the system launched it would begin to read temperatures from those pins properly but only while in animate debug mode. As soon as I would let it run in full speed to get to a break point later it would be partially or completely erroneous in the received readings. I’ve now switched it to the SPI2 pins and using G9 (SCK1), and G7 (SDI1). (The MAX6675 does not use the SDO pins since it only transmits readings and does not receive using SPI data)

I’m now opening the SPI port to communicate with the MAX6675 using 16bit word mode:
OpenSPI2(SPI_MODE16_ON | SPI_SMP_ON | SPI_CKE_ON | MASTER_ENABLE_ON | CLK_POL_ACTIVE_HIGH | SEC_PRESCAL_8_1 | PRI_PRESCAL_16_1, SPI_ENABLE);

[After I clean up all the “Dead code” that I’ve been testing various things with I’ll insert some additional SPI stuff HERE]

Which appears to work properly talking to the MAX6675. Further I’ve gotten the text to display on the screen of the current temperature where it runs a rolling average of the last 3 readings updating the screen after each additional reading. At the moment it flips on one of the starter kit’s LEDs based on the temperature when it needs to heat and turns it off when it’s reached a preset temperature.

I need to work more on getting the LCD display to show the activity that is going on in terms of heating/cooling and run a timer to begin estimating what stage the roast would be in based on temperatures and time-wise. Additionally I’ll need to figure out how to graph the temperature across the bottom of the screen too. I’m thinking screen real estate is somewhat limited so I may want to upgrade the LCD to the wider board to move some of the data to the side leaving a larger graph area to represent the roast curves.

Tagged , , , , , , , . Bookmark the permalink.

Leave a Reply