bigtreetech / BIGTREETECH-SKR-PRO-V1.1

Aiming at some problems existing in 3D printed motherboards in the market. Bigtree Technology Co., Ltd. launched a high performance 3D printer master board with STM32F407ZGT6 as the core controller, BIGTREETECH-SKR-PRO-V1.1.
274 stars 222 forks source link

SKR Pro + TMC5160 + PT100 using MAX31865+ BTT TFT35 v2 = no attached printer #163

Open code505 opened 4 years ago

code505 commented 4 years ago

I'm having issue working this configuration `#define SERIAL_PORT -1

define SERIAL_PORT_2 1`

I'm using this guide to connect MAX31865 in software SPI configuration: https://drive.google.com/file/d/1zOky07F_RDO-XxZx6C3xULqhuxYMOi/view?usp=sharing

once I change TEMP_SENSOR_0 to -5, I got the no attached printer, otherwise TFT is working

any thoughts

oldman4U commented 4 years ago

Please send pictures showing the connection between tft and mainboard. Check the baudrate setting of mainboard and tft.

code505 commented 4 years ago

that is the picture, the reset wire is the last on the left,

IMG_8996

the baudrate is 115200 on both the board and the TFT

what I want to emphasise on, is that when I put, TEMP_SENSOR_0 1 >>>> TFT is working with no issue if TEMP_SENSOR_0 -5 >>>> TFT show no printer attached

oldman4U commented 4 years ago

Maybe then it would be good to start a ticket in the general TFT Firmware repository. Seems TFT related and not SKR.

code505 notifications@github.com schrieb am Di. 25. Aug. 2020 um 19:02:

that is the picture, the reset wire is the last on the left,

[image: IMG_8996] https://user-images.githubusercontent.com/58148264/91205101-b413a980-e70d-11ea-8c11-51ee3d80820f.jpg

the baudrate is 115200 on both the board and the TFT

what I want to emphasise on, is that when I put,

TEMP_SENSOR_0 1 >>>> TFT is working with no issue

if

TEMP_SENSOR_0 -5 >>>> TFT show no printer attached

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bigtreetech/BIGTREETECH-SKR-PRO-V1.1/issues/163#issuecomment-680150769, or unsubscribe https://github.com/notifications/unsubscribe-auth/AM6XKZCSL3TXA6VUYLJTWRLSCPVA5ANCNFSM4QJ6ZPRQ .

oldman4U commented 4 years ago

Saw you opened the ticket, great. Reading your answer again i am not sure if this is SKR or TFT any more, but there are more users watching, so it is always a good idea to start a ticket there. Hope someone can help.

May i ask you why you are using this temp sensor and not a common one?

code505 commented 4 years ago

thank you so much for your cooperation, I installed V6 hotend and I thought it is a good idea to upgrade to pt100 for more consistant heat management and for carbon fiber printing, I really doupt that it's a TFT issue, because the screen work very well with TEMP_SENSOR_0 set to 1

oldman4U commented 4 years ago

You are welcome.

I believe there are many parameters in a 3D printer which vary too much in a very short time to give you accurate results which makes such a precise measurement unnecessary.

PETG based carbon filament is my favorite material. Best results with a .6 Nozzle, approximately 240 degrees and VERY VERY slow print speed. Usually 60-80mm. Carbon 10mm. But the results are worth. 😁

code505 notifications@github.com schrieb am Di. 25. Aug. 2020 um 21:50:

thank you so much for your cooperation, I installed V6 hotend and I thought it is a good idea to upgrade to pt100 for more consistant heat management and for carbon fiber printing

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bigtreetech/BIGTREETECH-SKR-PRO-V1.1/issues/163#issuecomment-680235106, or unsubscribe https://github.com/notifications/unsubscribe-auth/AM6XKZA5VXDZS2COWFYV7W3SCQIWTANCNFSM4QJ6ZPRQ .

oldman4U commented 4 years ago

Forgot. NO Fan!!! Very important.

code505 notifications@github.com schrieb am Di. 25. Aug. 2020 um 21:50:

thank you so much for your cooperation, I installed V6 hotend and I thought it is a good idea to upgrade to pt100 for more consistant heat management and for carbon fiber printing

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bigtreetech/BIGTREETECH-SKR-PRO-V1.1/issues/163#issuecomment-680235106, or unsubscribe https://github.com/notifications/unsubscribe-auth/AM6XKZA5VXDZS2COWFYV7W3SCQIWTANCNFSM4QJ6ZPRQ .

AnHardt commented 4 years ago

Back to the problem.

When there is any configuration for the serials where communication is possible - keep that. When the communication fails when TEMP_SENSOR_0 -5 but not with TEMP_SENSOR_0 1 something with the MAX31865-system is wrong. The protection systems detect a MIN_TEMP_ERROR, a MAX_TEMP_ERROR or maybe a communication error and sends Marlin into KILL_STATE - stopping all communication.

Checklist: Is the resistance of the PT100 at about 100 - 200 Ohm at room temperature? Does it rise when warmed? How many wires has the PT100/1000 sensor? Is the MAX31865-module prepared for that number of wires? If the sensor has 3 wires use only two different colour ones and prepare the module according to that. Marlin does not support 3_WIRE_MODE! Is the sensor connected to the module? To witch of the boars SPI-busses is the module connected to? Is Marlin configured to use the same buss/pins? Likely you have to look into the pins-file. Are the buss-wires not to long, not broken, connected to the right pins? Don't cross MISO and MOSI like you'd do with serials RX and TX. Check the last tree points also for SS. Don't reuse the T0 to T3 inputs for SS. The low pass filters on them may delay the signal too much.

Finally correct the 400 to a 430 in temperature.cpp at about line 1378 (there is only one occurrence)

            #if ENABLED(MAX6675_IS_MAX31865)
              max31865.temperature(100, 400)  // 100 ohms = PT100 resistance. 400 ohms = calibration resistor
            #else

If all that does not help try to check the hardware with different software like https://github.com/adafruit/Adafruit_MAX31865/blob/master/examples/max31865/max31865.ino

Don't tell us what guide you tried to follow. Tell/show us what you did. Those able to help you, already know how to do it and will not read/check a several page long, over redundant, guide being written for idiots.

AnHardt commented 4 years ago

As far i can see the hardware SPI variants in the above guide can't work. The software uses the 'default SPI bus' (SPI = SPI1) where the onboard SD-Card is connected to. The Adafruit library in the currently by Marlin used version is not able to use an other one. The current version of the library can be connected to any SPI buss but uses Adafruit BussIO what is currently not supported by Marlin. The wires shall be connected to the TMC-SPI bus (SPI3). That compiles but can't work.

Up to now i couldn't find a deal beaker for the Software SPI variantes. (Even if i did not try it physically.)

Edit: Sorry. Even the newest Adafruit_MAX31865 library (1.2.2) is not able to use an other than the default SPI hardware. They missed to expand the constructor.

GadgetAngel commented 4 years ago

#

As far i can see the hardware SPI variants in the above guide can't work. The software uses the 'default SPI bus' (SPI = SPI1) where the onboard SD-Card is connected to. The Adafruit library in the currently by Marlin used version is not able to use an other one. The current version of the library can be connected to any SPI buss but uses Adafruit BussIO what is currently not supported by Marlin. The wires shall be connected to the TMC-SPI bus (SPI3). That compiles but can't work.

Up to now i couldn't find a deal beaker for the Software SPI variantes. (Even if i did not try it physically.)

Edit: Sorry. Even the newest Adafruit_MAX31865 library (1.2.2) is not able to use an other than the default SPI hardware. They missed to expand the constructor.

Please educate me, so I can correct the guide. (To restate what you have written and to ensure I understand): You state that Marlin 2.0.6 can not work on SPI3. Marlin 2.0.6 will only use SPI1 for hardware SPI for ANY MCU. Is this correct?

As far as I am aware, the Hardware SPI is a master slave communication protocol. The SKR PRO V1.1 has three SPI buses on the MCU. SPI1 is the SD card reader; SPI2 is EXP2 and SPI3 is the Stepper Motor Driver Sockets.

Are you also saying that Marlin 2.0.6, does not allow the user to use Hardware SPI because at this time Marlin does not support Adafruit BUSIO? So the ONLY WAY to even use Adafruit’s MAX31865 is by using Software SPI?

AnHardt commented 4 years ago

The BTT SKR PROs have 3 SPI-buses. Marlin, in general, is able to use all of them. It's Adafruit_MAX31865 library what does not allow to select an other than the default SPI-buss (here SPI = SPI1). Hardware SPI for the MAX31865 is currently only possible if connected to the onboard-SD-SPI-buss - what results in a mess because there are no connectors.

Even in the newest version of the MAX31865 lib we have no way to specify the "buss".

  Adafruit_MAX31865(int8_t spi_cs, int8_t spi_mosi, int8_t spi_miso, int8_t spi_clk);
  Adafruit_MAX31865(int8_t spi_cs);

While the underling BussIO now can handle it:

  Adafruit_SPIDevice(int8_t cspin, uint32_t freq = 1000000,
                     BitOrder dataOrder = SPI_BITORDER_MSBFIRST,
                     uint8_t dataMode = SPI_MODE0, SPIClass *theSPI = &SPI);

  Adafruit_SPIDevice(int8_t cspin, int8_t sck, int8_t miso, int8_t mosi,
                     uint32_t freq = 1000000,
                     BitOrder dataOrder = SPI_BITORDER_MSBFIRST,
                     uint8_t dataMode = SPI_MODE0);

In general alone from the SS-pin it's impossible to detect the right buss.


Edit: Sorry at the BTT SKR PRO SPI is SPI2 - the SD-card slot on the display-board. https://github.com/bigtreetech/BIGTREETECH-SKR-PRO-V1.1/issues/163#issuecomment-694835132. For almost all other boars SPI is SPI1.

GadgetAngel commented 4 years ago

The BTT SKR PROs have 3 SPI-buses. Marlin, in general, is able to use all of them. It's Adafruit_MAX31865 library what does not allow to select an other than the default SPI-buss (here SPI = SPI1). Hardware SPI for the MAX31865 is currently only possible if connected to the onboard-SD-SPI-buss - what results in a mess because there are no connectors.

Even in the newest version of the MAX31865 lib we have no way to specify the "buss".

  Adafruit_MAX31865(int8_t spi_cs, int8_t spi_mosi, int8_t spi_miso, int8_t spi_clk);
  Adafruit_MAX31865(int8_t spi_cs);

While the underling BussIO now can handle it:

  Adafruit_SPIDevice(int8_t cspin, uint32_t freq = 1000000,
                     BitOrder dataOrder = SPI_BITORDER_MSBFIRST,
                     uint8_t dataMode = SPI_MODE0, SPIClass *theSPI = &SPI);

  Adafruit_SPIDevice(int8_t cspin, int8_t sck, int8_t miso, int8_t mosi,
                     uint32_t freq = 1000000,
                     BitOrder dataOrder = SPI_BITORDER_MSBFIRST,
                     uint8_t dataMode = SPI_MODE0);
  • last parameter of the first constructor.

In general alone from the SS-pin it's impossible to detect the right buss.

Is it not possible to write a software wrapper that exposes the pointer to the SPI BUS from the underlying BUSIO Function call? Is that not what a Constructor does in C++? Marlin is written in which programming language?

Which MAX31865 amplifier board on the market today can a user of Marlin use to access the correct SPI bus? Is there even one available?

GadgetAngel commented 4 years ago

I'm having issue working this configuration #define SERIAL_PORT -1 #define SERIAL_PORT_2 1

I'm using this guide to connect MAX31865 in software SPI configuration: https://drive.google.com/file/d/1zOky07F_RDO-XxZx6C3xULqhuxYMOi/view?usp=sharing

once I change TEMP_SENSOR_0 to -5, I got the no attached printer, otherwise TFT is working

any thoughts

Please place your Marlin folder (Zip the folder up) onto google drive and supply us with the shared link to that File.

It makes no sense that Software SPI is not working for you.

I will update the Guide to reflect the information about the current state of the Adafruit MAX31865 library

code505 commented 4 years ago

Here is the compressed folder, I really appreciate your cooperation guys.

https://drive.google.com/file/d/1K1XbNh0lFrJSDPzNua3jOYGHsJ_Dz9JK/view?usp=sharing

GadgetAngel commented 4 years ago

@code505 I downloaded the latest Marlin version 2.0.6.1 and made the changes that I have on my printer. Do you have a filament runout sensor attached on your printer? Are you using the filament runout port on the TFT screen?

If you have a filament runout sensor attached please comment out the Marlin sections related to that equipment. Leave them commented out until we get the MAX31865 in Software SPI mode to work.

Are you running V2.0.26 firmware on your BTT TFT35 V2.0 screen?

Here are the differences (that I think are relevant) I found between my setup and yours:

Differences in Platformio.ini file (your file is on the LEFT, my setup is on the RIGHT)--- I think this is where your problem is:

Marlin Differences to my setup_Platformio ini file

*** In my opinion: In Platformio.ini file: Change your default_evns to be BIGTREE_SKR_PRO and change include_dir to be Marlin

Difference in Configuration.h file (you have two screens enabled in Marlin):

You have Your Stock CR10 Displayed enabled yet the above picture shows no connections to EXP1 or EXP2 connectors:

Marlin Differences to my setup_CR10_STOCKDISPLAY_setting

You have the REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER enabled in Marlin along with your CR10 stock display:

Marlin Differences to my setup_also using REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER for display

* In my opinion: In Configuration.h file, you need to just disable both the REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER and the CR10_STOCKDISPLAY AND** ensure the Marlin line #define SDSUPPORT is uncommented.

Here is a video to watch to connect the BTT TFT35 V2.0 to the SKR PRO V1.1 board: https://youtu.be/9i3Ee6UtC-Q

In the above video He does not mention enabling any LCD screen in the Marlin firmware download. All he enables in Marlin Firmware are the following: Stepper Drivers used and enable are A4988 drivers; SERIAL_PORT is -1; SERIAL_PORT_2 is 1;. MOTHERBOARD is BOARD_BTT_SKR_PRO_V1_1 ; In Platformio.ini file: default_envs = BIGTREE_SKR_PRO. He sets his baudrate on the TFT35 V2.0 screen to 250000

GadgetAngel commented 4 years ago

@AnHardt Could I use this device and hack into the SPI Lines for the SKR PRO V1.1 and GTR V1.0 boards? Maybe that would work?

https://www.amazon.com/gp/product/B088WB5L8R/ref=ppx_yo_dt_b_asin_title_o01_s00?ie=UTF8&psc=1

TF Cloud device on Amazon com

AnHardt commented 4 years ago

Yes - one could. But it also has no pins to connect the SPI-bus to. So it's has no advantage over soldering wires/pins directly to the mainboard at the SD-Card-slot or the processor. (Maybe the pins at the ESP are a bit larger? Ahhh - and if ruined this is a bit cheaper.)

Something like this would be even cheaper. image

GadgetAngel commented 4 years ago

@AnHardt, Thanks for setting me straight on the Adafruit library issue! I am now fixing the guide so that I will not be giving out bad information. Just to be clear on another point, the reason my guides provide redundant information is to make it perfectly clear to the user that they have options.

Some people cannot extrapolate one solution into another solution.

My goal is to open up this hobby of 3D printing to more users. The more people that get involved with 3D printing the better the firmware will get and the MCU boards will get upgraded.

I do not intend for my manuals and guides to be idiot proof. But I do want to make it easier for people to hook up the devices. If they have a sort of cook book to follow, they are given a starting point and then learn from there. Sometimes that is all that is needed to get people to try out a new item.

I never intended my guides and manuals to be insulting. In fact, if anyone ever finds wrong information in my guide or manuals PLEASE let me know. I need to learn and then I can fix the guide. Just like you did with the PT100 Guide. I really appreciate the input you gave. Thanks again.

code505 commented 4 years ago

@GadgetAngel Hi, I also downloaded Marlin 2.0.6.1, and edited all the configuration including Platformio.ini file, I have filament run out sensor and I commented out it's setting installed V2.0.26 firmware on TFT35 I had the cr10s display and I thought I would give it a try without the TFT, but that also didn't work, that why I set the setting for the original cr10s display, but I revert every thing back now but until now, no luck one thing to mention, when I set #define SERIAL_PORT 1 and #define SERIAL_PORT_2 -1

the TFT give these messages: IMG_9018 IMG_9019

code505 commented 4 years ago

I have PT100 amplifier board (INA826 amp) , and I will connect it using table 21

to which pin should I use for 3.3v supply, ground and signal.

thank you

GadgetAngel commented 4 years ago

@code505 The easiest way is to use any of the ADC lines on extension-1 header, get 3.3VDC and GND from power expansion header.

Extension-1 header: IO Extension -1 header for SKR PRO V1 1

Color PIN diagram of SKR PRO V1.1 Board: SKR_PRO_V1 1_Colored_PIN_Diagram_300ppi

code505 commented 4 years ago

can I use 3.3v and GND from E1 endstop socket?, I have only one extruder

AnHardt commented 4 years ago

On this board VREF+ is not different from VCC_3.3V and VDDA is not accessible - so yes for the 3.3V. On this board we have more or less separate systems for GND and GNDA - so piking GNDA from a unused T input could make more sense to avoid some noise (but for functionality that should not make a difference - in the end they are connected via 0 Ohm R31).

image image

SKR PRO V1.2 has the same analoge circuits. GTR V1.0 got a better filtered VREF+ with a inductivity (also not accessible) and a maybe a tiny bit worse VDDA (but i can't really read that sketch) image

The BTT002 has a nicely filtered coupled VREF+ and VDDA image but not accessible. The T inputs have normal GND and not a separate GNDA.

On all 3 boards the 4K7 pullup resistors go to the normal 3.3V supply, not to one of the likely better analoge voltages.

Up to now i could not find any board from any manufacturer with really,for our purposes, ideal analog circuits for the ADCs. To expensive! Surprising to me is only the spread in variations from one manufacturer. Likely the boards have completely different designers.

GadgetAngel commented 4 years ago

can I use 3.3v and GND from E1 endstop socket?, I have only one extruder

yes

GadgetAngel commented 4 years ago

@AnHardt You wrote this:

Finally correct the 400 to a 430 in temperature.cpp at about line 1378 (there is only one occurrence)

        #if ENABLED(MAX6675_IS_MAX31865)
          max31865.temperature(100, 400)  // 100 ohms = PT100 resistance. 400 ohms = calibration resistor
        #else

400 Ohm is the calibration resistor. So for the Adafruit MAX31865 for PT100 you must change the calibration resistor to 430 in temperature.cpp. If you bought Adafruit MAX31865 for PT1000 you must use max31865.temperature(1000, 4300) in temperature.cpp. Is this correct?

AnHardt commented 4 years ago

Yes!

Do you really have to be that loud - always? (big fonts) My eyes are bleeding. :-)

At least for now. One days this will be properly configurable from the configs.

GadgetAngel commented 4 years ago

Yes - one could. But it also has no pins to connect the SPI-bus to. So it's has no advantage over soldering wires/pins directly to the mainboard at the SD-Card-slot or the processor. (Maybe the pins at the ESP are a bit larger? Ahhh - and if ruined this is a bit cheaper.)

Something like this would be even cheaper. image

@AnHardt Can you find any document showing the 15P cable and which PINS correspond to MOSI, MISO, SCK ? I have looked and I can not find any document showing which PINS on the extension cable correspond to the SPI lines

AnHardt commented 4 years ago

One side of the cable is a sd-card with some wires. The other a sd-card-socket with some wires. To make that work the wiring has to be straight, one by one, no crossings. The cable can also be used to extend SDIO connected sockets - not only SPI.

https://www.google.com/search?sxsrf=ALeKk02d7DxB8_5DES9ppG2VqZWjRveTVw:1599686685325&source=univ&tbm=isch&q=sd+card+spi+interface&sa=X&ved=2ahUKEwjmwoWlgd3rAhXGlqQKHQs-AGAQsAR6BAgMEAE&biw=1280&bih=577

Soldering to the flat-cable is difficult. Better crack the housing of the sd-socket and solder to the contacts.

GadgetAngel commented 3 years ago

One side of the cable is a sd-card with some wires. The other a sd-card-socket with some wires. To make that work the wiring has to be straight, one by one, no crossings. The cable can also be used to extend SDIO connected sockets - not only SPI.

https://www.google.com/search?sxsrf=ALeKk02d7DxB8_5DES9ppG2VqZWjRveTVw:1599686685325&source=univ&tbm=isch&q=sd+card+spi+interface&sa=X&ved=2ahUKEwjmwoWlgd3rAhXGlqQKHQs-AGAQsAR6BAgMEAE&biw=1280&bih=577

Soldering to the flat-cable is difficult. Better crack the housing of the sd-socket and solder to the contacts.

This issue is the SD card socket has 15 pins on the back when I crack it open. The sd card on the other end has 8 pins. I agree they should be straight connect but why have 15 pins to 8? If every other pin was Ground then I would expect 16 pins to 8. I looked up the part number on the SD card socket: AoSheng100921TF . It is a patented product from China. I can not find how they go from 15 pins to 8 pins. Do you have any idea what they did?

EDIT: I will use an ohm meter and document which 8 lines correspond to the SD card lines

AnHardt commented 3 years ago

8 pins have 7 gaps. 8+7 = 15. Yes, likely there are GND in between - even if having 3 GND lines together does not make sense - maybe additional GNDs are at the outer lanes. Measuring helps to know exactly.

code505 commented 3 years ago

@GadgetAngel Hi there,

I've used your guide to connect pt100 with amplifier board:

Screen Shot 2020-09-12 at 3 15 50 PM

I changed TEMP_SENSOR_0 to 21 and TEMP_0_PIN to PF8

now hotend temp is reading 1, not changing when I change TEMP_SENSOR_0 to 20 it works but temperature is higher by 3-4 degrees, and it is not stable, some time shooting 10-15 degrees up/down and come back again, this happen within second

using MAX31865, still no luck, :(

GadgetAngel commented 3 years ago

@GadgetAngel Hi there,

I've used your guide to connect pt100 with amplifier board:

Screen Shot 2020-09-12 at 3 15 50 PM

I changed TEMP_SENSOR_0 to 21 and TEMP_0_PIN to PF8

now hotend temp is reading 1, not changing when I change TEMP_SENSOR_0 to 20 it works but temperature is higher by 3-4 degrees, and it is not stable, some time shooting 10-15 degrees up/down and come back again, this happen within second

using MAX31865, still no luck, :(

Which Amplifier board are you using? the E3D PT100 Amplifier board or the MAX31865 board? If you are using the E3D PT100 Amplifier board and connected up as shown in the diagram, then TEMP_SENSOR_0 set to 20 will give you the wrong readings because that conversion table assumes the excitation voltage is set for 5V. You are using a 3.3VDC supply voltage. Try creating your own translation table. Keep your Technique #2&Method#1 wiring but try Technique #8 to generate your own translation table (create a custom thermistor table).

Double check your wiring to and from the PT100 sensor and the PT100 amplifier board are good.

Check your PT100 sensor: to see if it changes resistance with temperature. Use your multimeter and measure the resistance of the PT100 sensor at room temperature. Now place the PT100 Sensor next to your soldering iron so it can read temperature above room temperature. See if the PT100 sensor resistance changes.

It sounds like you have more than one problem you are trying to overcome. It sounds like you are getting data back to the MCU, now you just need to figure out why it is stuck at 1.

You can make Marlin show the ADC values it is getting from your Amplifier board by turn on the Marlin variable "SHOW_TEMP_ADC_VALUES". Please watch this video to understand how to create your own thermistor table (translation table) from scratch: https://www.youtube.com/watch?v=brl1weuD8bs&feature=youtu.be. The YouTube video is called "Marlin Thermistor Calibration" but it walks you through understanding how Marlin uses the thermistor table.

code505 commented 3 years ago

after doing a search, I think I'm not alone, https://github.com/MarlinFirmware/Marlin/pull/19246 & https://github.com/MarlinFirmware/Marlin/issues/16744

by the way, I used your guide also to connect smart filament sensor, is it okay to use 5v supply to provide power to the sensor, I think it can be operated ok from 3.3v from the limit switch E0

Screen Shot 2020-09-12 at 11 51 06 PM
GadgetAngel commented 3 years ago

after doing a search, I think I'm not alone, MarlinFirmware/Marlin#19246 & MarlinFirmware/Marlin#16744

by the way, I used your guide also to connect smart filament sensor, is it okay to use 5v supply to provide power to the sensor, I think it can be operated ok from 3.3v from the limit switch E0

Screen Shot 2020-09-12 at 11 51 06 PM

The BIGTREETECH SFS requires 5V supply but try the 3.3VDC to see if it works, I have not tried it with 3.3VDC. If it works, it works

Thanks for letting me know about the Thermistor table change. I will update the manual to recommend using thermistor table 20 for PT100 sensor and PT100 amplifier board

AnHardt commented 3 years ago

Please update to the complete facts. Use 20 if module supply is the same for module and ADC-reference. For the SKR PRO, if the module allows, 3.3V / 3.3V. For a 5V processor board, 5V / 5V. Use 21 if the module gets 5V but the processor 3.3V. Don't use this above ~500°C.

It would make sense to wait until https://github.com/MarlinFirmware/Marlin/pull/19246 or a replacement/followup is merged. Then slightly rephrase, to avoid complete redundancy. A manual should provide a second chance to understand what is going on. For example avoid "excitation".

GadgetAngel commented 3 years ago

Please update to the complete facts. Use 20 if module supply is the same for module and ADC-reference. For the SKR PRO, if the module allows, 3.3V / 3.3V. For a 5V processor board, 5V / 5V. Use 21 if the module gets 5V but the processor 3.3V. Don't use this above ~500°C.

It would make sense to wait until MarlinFirmware/Marlin#19246 or a replacement/followup is merged. Then slightly rephrase, to avoid complete redundancy. A manual should provide a second chance to understand what is going on. For example avoid "excitation".

I agree, I will state the following:

Use table 20: When the power supply for the PT100 Amplifier board is equal to the ADC reference voltage for the MCU.

For SKR PRO V1.1/V1.2, SKR V1.3/V1.4/V1.4 Turbo, GTR V1.0, M5 V1.0 all use 3.3 VDC as the ADC reference voltage for the MCU.

Therefore use table 20 when the PT100 Amplifier board is powered by 3.3VDC

Use table 21: When the power supply for the PT100 Amplifier board is different to the ADC reference voltage for the MCU.

The E3D PT100 Amplifier board wants 5V as its power supply. But the SKR PRO V1.1 uses 3.3V as the ADC reference voltage for the MCU. My current manual recommends using 3.3VDC for powering the E3D PT100 Amplifier board. But now that you all have made me aware of this issue with the translation table I would recommend using 5V for powering the E3D PT100 Amplifier board. In this case, I would also recommend using a 3.6V Zener Diode (reverse biased hookup) to protect the MCU from 5V input. If the PT100 sensor gets damaged or becomes disconnected from the PT100 amplifier board while the PT100 amplifier board is powered on, a 5V output signal will occur and fry the MCU board. This type of problem may or maynot happen but I would prefer to protect the MCU board. Therefore, I will update my wiring diagrams so that they show the wiring for the Zener Diode.

I will make the change in the current manual I am working on (GTR V1.0). After the GTR manual is done I will go back and update the following manuals: SKR PRO V1.1/V1.2, and SKR V1.3/V1.4/V1.4 Turbo. It will take me another 1.5 weeks to finish the GTR V1.0 manual.

Again, Thank you both for making me aware of this issue.

code505 commented 3 years ago

Using MAX31865, Is there any changes have to be done in temperature.cpp?? other than the pin assignment in pins_BTT_SKR_PRO_common.h

ifndef MAX31865_CS_PIN

define MAX31865_CS_PIN TEMP_0_PIN

define MAX6675_SS_PIN MAX31865_CS_PIN

define MAX31865_MOSI_PIN PD2

define MAX31865_MISO_PIN PD5

define MAX31865_SCK_PIN PE0

endif

I found this https://reprap.org/forum/read.php?415,809669 is this applicable for the current Marlin release?

Do I have to install MAX31865 library?

AnHardt commented 3 years ago

No. Meanwhile MAX31865 is integrated into Marlin. That message is from a wile before that. So likely the appended temperature.cpp is to old to not cause problems.

code505 commented 3 years ago

I'm still trying to make it work with MAX31865, when compiling it compile successfully, but I got this:

Compiling .pio/build/BIGTREE_SKR_PRO/src/src/sd/SdFile.cpp.o Compiling .pio/build/BIGTREE_SKRPRO/src/src/sd/SdVolume.cpp.o *In file included from Marlin/src/module/temperature.cpp:48: .pio/libdeps/BIGTREE_SKR_PRO/Adafruit MAX31865 library/Adafruit_MAX31865.h:84:32: warning: passing NULL to non-pointer argument 1 of 'Adafruit_SPIDevice::Adafruit_SPIDevice(int8_t, uint32_t, BitOrder, uint8_t, SPIClass)' [-Wconversion-null] 84 | Adafruit_SPIDevice spi_dev = NULL; | ^~~~ In file included from .pio/libdeps/BIGTREE_SKR_PRO/Adafruit MAX31865 library/Adafruit_MAX31865.h:55, from Marlin/src/module/temperature.cpp:48: .pio/libdeps/BIGTREE_SKR_PRO/Adafruit BusIO/Adafruit_SPIDevice.h:60:29: note: declared here 60 | Adafruit_SPIDevice(int8_t cspin, uint32t freq = 1000000, | ~^~~**

AnHardt commented 3 years ago

That's a problem in Adafruit MAX31865 library.

Use a recent Marlin and compile with PlatformIO. The newer versions of Adafruit MAX31865 library are purposely excluded (MAX6675_IS_MAX31865 = Adafruit MAX31865 library@~1.1.0). Alternatively downgrade the library via Arduinos library manager to 1.1.0.

But it's just a warning - not preventing compiling and just wasting a bit of memory because two of the Adafruit_SPIDevice objects will exist then. The trick would be to initialize the object when the MAX object is created in a initialisier list. Adafruit is not very reactive about PRs. It's not much fun to contribute to their projects.

GadgetAngel commented 3 years ago

I'm still trying to make it work with MAX31865, when compiling it compile successfully, but I got this:

Compiling .pio/build/BIGTREE_SKR_PRO/src/src/sd/SdFile.cpp.o Compiling .pio/build/BIGTREE_SKR_PRO/src/src/sd/SdVolume.cpp.o ___In file included from Marlin/src/module/temperature.cpp:48: .pio/libdeps/BIGTREE_SKR_PRO/Adafruit MAX31865 library/Adafruit_MAX31865.h:84:32: warning: passing NULL to non-pointer argument 1 of 'Adafruit_SPIDevice::Adafruit_SPIDevice(int8_t, uint32_t, BitOrder, uint8t, SPIClass)' [-Wconversion-null] 84 | Adafruit_SPIDevice spi_dev = NULL; | ^~~~ In file included from .pio/libdeps/BIGTREE_SKR_PRO/Adafruit MAX31865 library/Adafruit_MAX31865.h:55, from Marlin/src/module/temperature.cpp:48: .pio/libdeps/BIGTREE_SKR_PRO/Adafruit BusIO/Adafruit_SPIDevice.h:60:29: note: declared here 60 | Adafruit_SPIDevice(int8_t cspin, uint32t freq = 1000000, | ~^~~*_

@code505 The only changes I am aware of at this time to temperature.cpp in the latest release of Marlin 2.0.6.1 are as follows:

Changes to max31865.temperature.cpp in Marlin for MAX31865 board from PRO V1.1_ Version 6.1.pdf or

Changes to temperature cpp for max31865 board on PRO V1 1_version 6 1_page_1

Changes to temperature cpp for max31865 board on PRO V1 1_version 6 1_page_2

Please place your current Marlin folder (Zip the folder up) onto google drive and supply us with the shared link to that File. I would like to look at the info messages you are getting from Marlin myself. Maybe I can see what is going on in the code.

code505 commented 3 years ago

Thank you so much guys for your input, this is the file:

https://www.dropbox.com/s/rc9imppk85hk6wd/Marlin.zip?dl=0

this is the board I'm using: https://www.aliexpress.com/item/32952386281.html?spm=a2g0s.9042311.0.0.27424c4d7vWIqI

the sensor is working with amplifier board but not accurate and have lots of fluctuation, I've two MAX31865 and both doesn't work so the must Likely cause is setting

GadgetAngel commented 3 years ago

Thank you so much guys for your input, this is the file:

https://www.dropbox.com/s/rc9imppk85hk6wd/Marlin.zip?dl=0

this is the board I'm using: https://www.aliexpress.com/item/32952386281.html?spm=a2g0s.9042311.0.0.27424c4d7vWIqI

the sensor is working with amplifier board but not accurate and have lots of fluctuation, I've two MAX31865 and both doesn't work so the must Likely cause is setting

I tried to open your Marlin folder under VScode but I could not. You need to zip your whole Marlin folder with the platformio.ini file included in the zip folder. I get the following message when I try to open your project under VScode:

Error message

Without the platformio.ini file I have no idea which libraries your code is installing for your firmware project.

GadgetAngel commented 3 years ago

https://www.aliexpress.com/item/32952386281.html?spm=a2g0s.9042311.0.0.27424c4d7vWIqI

The device you bought is NOT an Adafruit MAX31865 board.

MAX31865 board is not made by Adfruit

I have no idea if this clone board uses the correct SPI timing needed to get it to work with the Adafruit MAX31865 library. Please buy yourself the Adafruit MAX3165 board. You can find it here:

https://www.digikey.com/products/en?mpart=3328&v=1528

Digikey Adafruit MAX31865 board

I know it cost $10 more than the clone. But, the Adafruit MAX31865 board is the ONLY board that has been tested with the Adafruit MAX31865 library and Marlin

After looking at the Adafruit github page I found these suggestions (from URL: https://github.com/adafruit/Adafruit_MAX31865/issues/new) :

To improve the speed of resolution please review the following guidelines and
common troubleshooting steps below before creating the issue:

- **Do not use GitHub issues for troubleshooting projects and issues.**  Instead use
  the forums at http://forums.adafruit.com to ask questions and troubleshoot why
  something isn't working as expected.  In many cases the problem is a common issue
  that you will more quickly receive help from the forum community.  GitHub issues
  are meant for known defects in the code.  If you don't know if there is a defect
  in the code then start with troubleshooting on the forum first.

  - **Be sure you are supplying adequate power to the board.**  Check the specs of
    your board and plug in an external power supply.  In many cases just
    plugging a board into your computer is not enough to power it and other
    peripherals.

  - **Double check all soldering joints and connections.**  Flakey connections
    cause many mysterious problems.  See the [guide to excellent soldering](https://learn.adafruit.com/adafruit-guide-excellent-soldering/tools) for examples of good solder joints.

  - **Ensure you are using an official Arduino or Adafruit board.** We can't
    guarantee a clone board will have the same functionality and work as expected
    with this code and don't support them.

I will repeat the last item: "Ensure you are using an official Arduino or Adafruit board. We can't guarantee a clone board will have the same functionality and work as expected with this code and don't support them"!!

Your MAX31865 board has it's brand listed as a "RELAND SUN", which is NOT an official Arduino or Adafruit board.

AnHardt commented 3 years ago

Nonsens! https://www.electronics-notes.com/articles/electronic_components/resistors/smt-smd-resistor-codes-markings.php chapter 3. A SMD resistor marked "431" has 430 Ohm

GadgetAngel commented 3 years ago

Nonsens! https://www.electronics-notes.com/articles/electronic_components/resistors/smt-smd-resistor-codes-markings.php chapter 3. A SMD resistor marked "431" has 430 Ohm

Thanks for the input

GadgetAngel commented 3 years ago

@AnHardt I am confused about something. In Marlin, by default the LCD SD (EXP2) is enabled. Does that mean that the SPI Bus for LCD SD (EXP2) is now the default Hardware SPI BUS in Marlin?

To state it another way: Which ever SPI bus that LCD SD (EXP2) is on, Marlin will use that SPI Bus as the default Hardware SPI bus?

So for SKR PRO board, the LCD SD (EXP2) is on SPI BUS number 2. So does Marlin automatically defaults to use SPI BUS number 2 as the Hardware SPI bus? The reason I ask is due to comments I see in the PINS file for the MCU. For example the comment in the orange square box in pins_BTT_SKR_PRO_common.h is what I am confused about :

SKR PRO Board SPI1 on SD card issue

It states in the comments: Onboard SD card (TF card reader) must use software SPI because Marlin's default hardware SPI is tied to LCD's EXP2 port (LCD SD).

For SKR PRO board the EXP2 is on SPI bus number 2, while the TF card reader is on SPI bus number 1.

So Marlin's default hardware SPI bus is LCD EXP2 on each MCU board?

For SKR V1.3 board, SPI bus 0 is for LCD EXP2. While SKR PRO use SPI bus 2. So the default hardware SPI bus for SKR V1.3 is SPI bus 0 and the default hardware SPI bus for SKR PRO is SPI bus 2. Is am getting this right?

A while ago I thought I understood that the default hardware SPI bus would be used by the Adafruit MAX31865 board. Now does that mean the Adafruit MAX31865 library will default to the LCD EXP2 on each MCU or does it mean the Adafruit MAX31865 library will default to use the first SPI bus on the MCU board?

For example the first SPI bus on SKR PRO is SPI bus number 1 which is the TF card reader. But Marlin uses the LCD EXP,2 which is on SPI bus 2, as the default hardware SPI bus.

So does the Adafruit library use SPI bus 1 or SPI bus 2 on the SKR PRO board?

AnHardt commented 3 years ago

The SKR PRO has 4 SPI busses. One to the onboard SD-reader that is connected to pins able to be used as SPI1 - but currently used in software SPI because of a pullup at the MiSo-line (or MoSi - don't remember) . One is the SPI buss for the TMC and the SPI-connector - hardware SPI3. Two are on the EXP Connectors - one for the SD-slot on the displays board (hardware SPI2) and another software one for the display.

The default SPI is always a hardware SPI. Currently SPI for the SKR PRO indeed seems to be SPI2. :-(

It's changed, a bit hidden :-( , from the default SPI1 to SPI2 here: https://github.com/MarlinFirmware/Marlin/blob/bugfix-2.0.x/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/variant.h#L239/L245 https://github.com/MarlinFirmware/Marlin/blob/bugfix-2.0.x/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/variant.h#L69/L72

code505 commented 3 years ago

I'm sorry being late, here is the file: https://www.dropbox.com/s/oq3pcovnan059h5/Marlin-bugfix-2.0.x%204.zip?dl=0

have you tried authentic Adafruit board and worked with your settings? I have two of the clones and it's soldered perfectly, I don't know about the power is enough?? I will try to supply with external power

GadgetAngel commented 3 years ago

The SKR PRO has 4 SPI busses. One to the onboard SD-reader that is connected to pins able to be used as SPI1 - but currently used in software SPI because of a pullup at the MiSo-line (or MoSi - don't remember) . One is the SPI buss for the TMC and the SPI-connector - hardware SPI3. Two are on the EXP Connectors - one for the SD-slot on the displays board (hardware SPI2) and another software one for the display.

The default SPI is always a hardware SPI. Currently SPI for the SKR PRO indeed seems to be SPI2. :-(

It's changed, a bit hidden :-( , from the default SPI1 to SPI2 here: https://github.com/MarlinFirmware/Marlin/blob/bugfix-2.0.x/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/variant.h#L239/L245 https://github.com/MarlinFirmware/Marlin/blob/bugfix-2.0.x/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/variant.h#L69/L72

@AnHardt Thank you for the information. Sorry about the large letters. I just read your note on that. Please forgive me. I will stop yelling.

I believe the pullup is on the CLK line which makes the clock idle at HIGH. Therefore, forcing the hardware SPI to be mode 3. Apparently the issue is that Marlin uses Mode 0 for the default hardware spi bus and that is why they force it to be software SPI.

Say I have the following situation: I have a REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER enabled as an LCD and I try to hook up a MAX31865 board with Hardware SPI.

Since by default the pins_BTT_SKR_PRO_common.h file sets #defene SDCARD_CONNECTION LCD, the default hardware SPI bus number is 2 (as you pointed out in your last post, which for SKR PRO V1.1 is the EXP2 connector), meaning the MAX31865 board should be spliced into the EXP2 flat ribbon cable.

So here is my current question: After reading this post: https://github.com/MarlinFirmware/Marlin/issues/10640#issuecomment-394061808, it sounds like the the REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER does NOT release the SPI bus. So if anyone has the REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER enabled in the firmware this issue will cause the MAX31865 board in hardware SPI not to work as expected because the MAX31865 board will never get a chance to be the selected slave on the default hardware spi bus number 2. So are there any other LCD screens I also need to be aware of that behave in this manner?

@code505 I own three MAX31865 boards, I have not tried them out on the SKR PRO V1.1 board yet, that is why I am trying to help you figure out why its not working. While I think about your issue, I am also writing the manual for the GTR V1.0 board which is based on the SKR PRO V1.1 board. Since you pointed out my error with the Thermistor tables, I am now changing my techniques to use ONLY 5VDC power source for the PT100 amplifier board and the MAX31865 board . I am updating the wiring diagrams to include a zener diode to protect the input of the SKR PRO V1.1 board or GTR V1.0 board. Both boards are 3.3VDC logic levels.

@code505 I suspect that your issue is the clone board, so please buy a real Adafruit MAX31865 board. It's the next logical step in debugging the MAX31865 board problem. The software SPI should work. But, "Shoulda woulda coulda", Should does not mean it is working. Please continue on with the next step.