![]() ![]() If you're using the hardware SPI you have the clock and data lines only once and have to share them among different devices. SPI does not require that, it just allows it. I thought SPI required a common clock and slave buses and only chip select was independant? Is there a simple example of a similar sensor library I could use as an example of transferring bits with the standard SPI callouts.Īhh I got you now. I have the data sheet and I know what bits are transferred in what order. Chip Select active is LOW just like hardware, etc. So how do I work around the SPI? And it looks like it should be compliant, just probably a matter of getting or re-writing the library to use the SPI library functions. The same issue happens if I remove all of the SD card coding and include SPI.h and simply add SPI.begin() to my sketch. The SD.h and SdFat.h libraries callout SPI.h which causes the MAX31855 to no longer read out. so how do I fix this on the software issue. I already have them connected to other pins (listed above). The MAX31855 library ( GitHub - rocketscream/MAX31855: MAX31855 Library for Arduino) doesn't use the hardware SPI, so you should use other pins than the SPI pins to connect the thermocouple breakouts to your Mega. But I need help reading the TC's while the SD card is initialized. ![]() I can read the TC's and I can also read and write to the SD card. everything is wired and working correctly. and I have a jumper coming from pin 10 on the SD shield to pin 8 on the board. But I cannot read the thermocouples WHILE the sdcard is initialized. I can read the thermocouples without the SD card code, and I can read and write to the SD card just fine. ![]() If you look at my code attached to the original post here is how I have the SPI pins wired up. Well I have worked around it and, yes you can use this shield on the Mega2560 with this libray: #1 because of the pin setting, and #2 the SdFat libraries up until a week ago were not compatible. There are 2 reasons this SD Shield is listed as not Mega compatible. I cut pins 10, 11, 12, and 13 off of the SD Shield and have run jumpers from the top header pins over to the SPI pins on the Mega (50, 51, 52, and 53). With the lines enabled and the SD card is initalized, this is what reads out: 2 9:56:12Īnyhelp I can get would be greatly appreciated! Thanks. Please see the attached code, with lines 49-57 commented out this is the serial output: 2 9:55:2 So I tried every speed option the SdFat.h library allows (SPI_DIV3_SPEED, SPI_HALF_SPEED, SPI_FULL_SPEED, etc) and nothing changed the serial output. I think this may be due to the fact that the either the thermocouple boards are not synced on the clocking signal that the SD card is on. Now I should note that I have this thing built and am making no changes to hardware or pins. I have been digging into this for a few days and have determined that if i even initialize the SD card, all my thermocouple's stop reading temperatures. I can do everything I need to just find individually, but when I try to log the temperature readings onto the SD card. I can also read and write to the SD card perfectly fine (using the SdFat library optimized for the Mega 2560). Individually I can read the TC's just fine (using the MAX31855 library from rocketscream). I am using an Arduino Mega 2560 with (4) MAX31855 Thermocouple breakoutboards from Adafruit, and an SD shield from ( ) Oh I am also using a DS1307 real time clock but that works over I2C and I am not having any issues with that at all. ![]()
0 Comments
Leave a Reply. |