Reduce SPI speed?

Moderators: grovkillen, Stuntteam, TD-er

Message
Author
User avatar
ThomasB
Normal user
Posts: 1274
Joined: 17 Jun 2018, 20:41
Location: USA

Re: Reduce SPI speed?

#51 Post by ThomasB » 15 Jan 2025, 22:25

Such a beautiful sight to behold:

All three BMP390 sensors are working!
All three BMP390 sensors are working!
ESPEasy_Screenshot1.jpg (132.65 KiB) Viewed 1390 times

TD-er's SCSI comment was spot on. The magic fix was a 330 Ω pulldown resistor termination on SCK, at the end of the daisy-chained ribbon cable, and no other changes. BTW, I found that the highest ohms value that worked was 470 Ω, so settled on 330 Ω.

Don't worry, SCK is a fully driven signal (not open collector) and does not rely on a pullup resistor for logic high. So the added pulldown does not change the logic levels. Still 0/3.3 VDC.

I will be torture testing the entire system with a heat gun and cold spray (to simulate the temperatures in the attic). That will help determine if this is a reliable fix.

But all that finish work is on hold for now. There are wild celebrations going on. Dancing in the streets. Women throwing beads. Children laughing. Because it's working!

- Thomas

TD-er
Core team member
Posts: 9596
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Reduce SPI speed?

#52 Post by TD-er » 15 Jan 2025, 23:34

Does this mean the release of the DSO coin will also be put on hold?

Anyway glad you fixed it :)

User avatar
ThomasB
Normal user
Posts: 1274
Joined: 17 Jun 2018, 20:41
Location: USA

Re: Reduce SPI speed?

#53 Post by ThomasB » 16 Jan 2025, 03:20

Invites to buy DSO Coin will be in everyone's inbox soon. Logan Paul will be promoting it.

I tortured the HVAC Monitoring system with a heat gun and freeze spray. It will mount in my attic where temperatures range from 5C to 50C. I tested with slightly more extreme temperatures and experienced zero issues.

The only problem I saw was that the web log was being filled with unknown commands and miles of gibberish. I disabled the Serial Port Console (Tool->Advanced) and the issue went away. I'm not using the USB port.

So it looks like it is time to write some ESPEasy rules and install the BMP390 Sensors. But installation has to wait until the HVAC system's two year warranty expires, which is a few weeks away.

BTW, I'm still focused on getting a new o-scope. Currently watching Amazon to see if the Rigol DHO804 price drops again.

Finally, a big Thank You to TD-er and ATH for their assistance. It's nice to bounce ideas around. And extra nice when the head banging stops and the problem is solved.

- Thomas

TD-er
Core team member
Posts: 9596
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Reduce SPI speed?

#54 Post by TD-er » 16 Jan 2025, 08:16

Yep, it is always better to do bit-banging than head-banging :)

By the way, what SPI speed are you now using?

Do I still need to make it configurable?

TD-er
Core team member
Posts: 9596
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Reduce SPI speed?

#55 Post by TD-er » 16 Jan 2025, 09:14

I'm still a bit surprised you only needed to terminate the clock.
Are the other lines pulled up by the devices?

User avatar
ThomasB
Normal user
Posts: 1274
Joined: 17 Jun 2018, 20:41
Location: USA

Re: Reduce SPI speed?

#56 Post by ThomasB » 16 Jan 2025, 18:09

1. I'm using the default 1MHz clock. But needed 10KHz to help troubleshoot.

2. Although not essential, a configurable SPI clock speed would be nice. But I believe that would require modifying the Adafruit SPI library.

3. The BMP390 boards have 10K ohm pullup resistors on the SPI signals. I did not change them.

BTW, some helpful things that were needed during troubleshooting were three temporary mods to the BMP390 code (via Adafruit lib & P172). Besides reducing the clock speed, I duplicated the BMP390's operating mode init function to the Plugin's read (an init was performed before each read). And the check for successful SPI communication was disable (force success=true). Those tricks saved the day.

I'm now successfully running on unmodified code. It's the recent Dec 2024 ESPEasy build, ESP_Easy_mega_20241221_climate_ESP32_4M316k.

- Thomas

User avatar
ThomasB
Normal user
Posts: 1274
Joined: 17 Jun 2018, 20:41
Location: USA

Re: Reduce SPI speed?

#57 Post by ThomasB » 01 Feb 2025, 18:14

I installed the HVAC Performance Monitoring system yesterday. The three SPI based sensor probes (connected by the long ribbon cable) are now inside the HVAC duct plenums and heat exchanger. Everything works!

In a few days I'll post a project summary in my original discussion from last June 2024. This one:
viewtopic.php?t=10219

TL;DR Guy prototypes a new ESPEasy project. Experiences serious SPI communication issues because of his stupidly long cables. He pulls out his hair. Seeks help. Solves problem and lives to tell about it.

- Thomas

TD-er
Core team member
Posts: 9596
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Reduce SPI speed?

#58 Post by TD-er » 01 Feb 2025, 21:44

And that's why senior developers typically experience baldness.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 0 guests