-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Set HSPI ports by default when HSPI is selected #874
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
When user selected HSPI with SPIClass name(HSPI) ESP was, by default, still using VSPI ports (the ones defined in pins_arduino.h). With this change when user selects HSPI then HSPI default ports will be used. If user won't specify HSPI then VSPI default ports will be used. If user will specify SCLK, MOSI, MISO and SS with SPI.begin() then user defined ports will be used no matter if VSPI or HSPI is selected. With this change fe. SD library can use default HSPI ports. It was possible to pass HSPI SPI instance to SD lib, however even then it was using VSPI ports which were (probably) GPIO matrixed to HSPI.
Cool! Keep in mind that the default SPI port might change in near future ;) PSRAM is using VSPI |
Hello, I'm sort of a newbie at this, so please bear with what may be an obvious question to someone that eats and sleeps code. I have an application where I'm at wit's end sharing VSPI with an RA8875 Display. There is a documented Silicon bug where this chip does NOT tri-state MISO. I have tried every which way to isolate the hardware but even just putting a 74LVC125 with OE grounded makes it not work. So my answer is to use both HSPI and VSPI. Would the correct way to go about this be to create TWO separate Classes, one called HSPIClass and one called VSPIClass? From what I could tell the Library creates an object using either port, but not both. Thank you in advance for your help. |
@rmetzner49 have you tried connecting the OE to the RA8875's CS pin? if the RA8875 does not tristate MISO then adding a tri-state buffer(74LVC125) between the RA8875's SO and the MISO input of the ESP32 should work? Chuck. |
You would think so, but even with just that one Buffer delay, the display stops working. I initially did connect it to the CS pin but that broke it, so my thought was just connecting it to GND should work provided it's the only device on the bus. It should just look like a buffer, but no dice. I suppose I could try running every pin through a buffer just to see if that changes but I'm not sure that's the correct road. There is a LOT of activity on the SPI bus running the display because I also used the Touch feature. The other device I want to run is a TDC1000 Ultrasonic Active Front End. Without having run THAT, I don't know what overhead it has beyond just initializing. My plan was to use the PulseIn function to measure the actual start/stop events on REAL pins. Do you think making two classes will allow both ports to work? |
A quick and dirty solution might be a diode on that line, in the
appropriate polarity?
David
…On Sun, Jan 14, 2018 at 9:34 AM, chuck todd ***@***.***> wrote:
@rmetzner49 <https://github.com/rmetzner49> have you tried connecting the
OE to the RA8875's CS pin? if the RA8875 does not tristate MISO then adding
a tri-state buffer(74LVC125) between the RA8875's SO and the MISO input of
the ESP32 should work?
Chuck.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#874 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAg4SuWcSfAKkcZjGWSbFI5q4Ug3L7YXks5tKjq6gaJpZM4QqRr2>
.
|
@rmetzner49 that buffer is spec'd to only delay the signal 4.3ns at 3.3V. from OE to output is 2.4ns. What is your bus speed? 160mhz? I'm being factious. :) if you are using 4MHz or 8MHz I cannot see how the delay from a single buffer would affect your communication. More likely you have a SPI MODE mismatch. Looking at the RA8875 datasheet from AdaFruit, the Device is using MODE3. Chuck. |
Good question. I had tried to up the speed months ago without much luck. I came across the following in RA8875.cpp which tells me Adafruit is mucking with the settings. It was initially at 2Mhz but I bumped it to 4. REM are my initials and comments. I'll try to peek at which MODE is being sent, though I never tweaked that. I remember trying 4, 8, 10, & 12 and 4 is about the fastest reliable setting. I'm using Adafruit's RA8875 drivers. // REM CHANGED FROM 2000000 RA8875 start |
@rmetzner49 look through their code for hopefully you will find Chuck. |
WELL THEN! they are calling it with the wrong MODE. |
Though if I read the RA8875 Data Sheet correctly, it says "read mode <SysClock/6" which matches my empirical tests; that it dies at any setting > 4MHz because 20M/6 = 3.333. |
dpharris: I doubt a simple diode; even a Schottky is the answer, since this thing seems really fussy on timing. |
I'll do that right after I replace the LVC125 which seems to have gone to lunch. Gotta haul out the microscope. ;-) The other thing I was thinking is I could maybe pass both the SCLK and MOSI through a buffer and see if that fixes it. Thank you for at least making me examine the issue. I still may try to make TWO classes and see what happens. It's going to be a bunch of work though. I wish I could run it past 3.33 MHz because it's dorky to switch between one screen and another. Takes about 3-4 seconds. Both the TDC1000 and the Display CAN work on the same bus only because there isn't any traffic on the TDC1000 once getting it initialized. Thanks, Bob M. |
Now I'm really confused. I haven't tried MODE3 yet but I seem to be getting MISO activity while CS is high, which I don't think is supposed to happen. I have a brand new OWON scope and I think one of the features I stumbled on in the menus is it has a BUS menu for I2C and SPI. Time to get the manual out and understand that feature. Thanks, and stay tuned. I did BTW get the LVC125 replaced and I can now ground OE and still have the display work. As soon as I determine what's going on with CS, I'll know more. Bob M. |
@rmetzner49 Chuck. |
I'm doing what EVER the Adafruit Library does. I haven't messed with anything else, and I would expect therefore the display should work, and it does sans the problem with the RA8875 we discussed above. Unless I'm confused and SPI works differently than say, any other addressed device, there shouldn't be MISO (or MOSI) activity in the absence of CS being LOW. Else how would a device know it's being selected for communication? Once I understand how to properly set up my new 'scope using its SPI trigger feature, I might see sensible activity. Right now though I can see why when I connect the LVC125's OE pin to CS it quits working. In my head, there shouldn't be activity on MISO unless CS is LOW. Yet there is. -- Bob M. |
Will hit this again tomorrow with a clear head. Thanks for all your help. |
@rmetzner49 Yep, the MISO line should be tri-stated when it is inactive. Good luck.! |
Well this has been interesting: Whilst poking around all of my "hal" files to understand what's going on, I had included esp32-hal-adc files even though I decided against using the onboard A/D. I had already thrown in an I2C, AD7994 to take care of my battery monitoring functions and I was also going to use it for Ultrasonic Flow Detection also. So I ripped those files out that deal with the onboard ADC and low and behold, MOSI now works when tri-stated through CS on the SPI bus. The picture attached shows this. The top trace is MOS, the botom is CS and you can see about 1V when CS is inactive. Please excuse the shabby triggering, but the display now works. |
@rmetzner49 Sounds like you found something, but alas, I can't see your 'attached' picture 😦. It was MISO right? not MOSI? Did you change the SPI Mode? Chuck. |
Worked that time. You can see the tiny little floating state on the top MISO trace (top) |
I love my new Christmas Present to myself. (Scope). Seems every bit as capable as my Tek-2465 and it was $438 including shipping! Next chapter is getting the TDI1000 to talk SPI |
@rmetzner49 your are dating your self. I have a Tek-2236, couldn't afford the 2465 in 1984! , I'm looking at a Rigol MSO1074z for $699. I can't believe I spent $2,400 on a scope in 1984 and now, I am questioning if I want to spend $699.00. I just ran a inflation calculator. $2,400 in 1984 is equivalent to $5,806 in today's dollars! What a ripoff! |
@rmetzner49 That display look great! I'm a little younger than you but, hardly enough that matters. Do you think you will trace down the interaction with the 'hal-adc'? Chuck. |
TBH, I don't know that was the only factor. I did also grab both new "hal-spi" files from this article. I also remember Espressif changed a bunch of HAL code between 10/14/17 and 1/1/18 because about the time I added esp32-hal-i2c to the project, it no longer compiled until I updated esp32-hal. This is why I ended up on this thread trying to run both SPI ports. I originally had a 32U4 with its timers setting up the Ultrasonic and I had it about half working, but every wire I moved gave different results. My plan was to use i2c to talk between processors. So although I might have eventually gotten it to work, using the TDC1000 seemed like the way to go. Of course it's going to be a chore to port the setup of that device to this project, but I have a good starting example from Lindholm using it with a TDC7200 stopwatch chip. Now that I can have it on VSPI, I can at least see light at the end of the tunnel. |
@rmetzner49 You might run into some issues with the I2C code. The I2C HAL currently in the main branch espressif/arduino-esp32 are very unreliable, they use a polling interface with the I2C hardware and are very timing sensitive. I rewrote the I2C 'HALs' in my fork stickbreaker/ardunio-esp32. My version uses an ISR model instead, It has proven to be robust. The maintainer for the main branch @me-no-dev was working on incorporating my fork into main branch. But, I have seen no activity for ~30days. I'm working on SlaveMode now. I am confusing myself with spinlock's and Mutex's between the ISR and foreground apps. Currently I'm almost up to the point to stimulate the hardware and see how it twitches. Hopefully my prognostication will match reality. Chuck. |
Not to worry, the only thing the i2C will be doing is the AD7994 and the DS3232 RTC and I've already had both working. On the other hand, my need for a good A/D will be gone, so I may revive the ESP32's on board. In theory, I could also use the ESP32's RTC but I didn't see much info on how it runs on battery or any examples of an RTC using the internal. I successfully used i2c talking to the 32U4 using Nick Gannon's messaging method as explained on his site. Most of my pre-retirement work was Hardware, signal conditioning and motor control. We had a whole group that wrote the main apps in Windows VB, so I'm really green at coding "C". On the flip side, no one in the VB group knew anything about embedded coding so I eventually ended up writing some drivers. |
@rmetzner49 sounds good, EXCEPT the ESP32 RTC stands for Real Time CoProcessor. It is lowpower lowspeed cpu. It could be programmed to act as a Real Time Clock, but you will have to add a 32KHz accurate clock, and code. Chuck. |
Yeah, that’s not very attractive. For what little it costs, the DS3232 is the better choice, though even with that, I had to “roll my own” since no one had. I think I used the DS1307 as an example and just massaged the appropriate registers.
Out of curiosity, which Dev System do you use? (More than likely not Arduino). Which ESP32 Board? I started with Sparkfun’s “Thing” and moved on to the less expensive “VROOM” boards. I flip between Arduino and Visual Studio ported to Arduino. Obviously the caveat being if someone changes a Core or Library, I’m at their mercy. Then you also have to watch whose stuff you grab, because some of it just flat doesn’t work. @me-no-dev seems reliable as is Stoffregen but he is not “open” with his source or Hex files. You can really see where some people’s head is at when you see how differently they approach TIME stuff like BinToBCD and BCDtoBin on clock libraries.
Bob Metzner
From: chuck todd [mailto:notifications@github.com]
Sent: Monday, January 15, 2018 5:44 PM
To: espressif/arduino-esp32
Cc: rmetzner49; Mention
Subject: Re: [espressif/arduino-esp32] Set HSPI ports by default when HSPI is selected (#874)
@rmetzner49 <https://github.com/rmetzner49> sounds good, EXCEPT the ESP32 RTC stands for Real Time CoProcessor. It is lowpower lowspeed cpu. It could be programmed to act as a Real Time Clock, but you will have to add a 32KHz accurate clock, and code.
Chuck.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#874 (comment)> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AMpGLzlxT8ynixixgAObyFvIq4el8eK8ks5tK9S6gaJpZM4QqRr2> . <https://github.com/notifications/beacon/AMpGL-RTfHq9qd8_BCFZoS3tL8g9BLK3ks5tK9S6gaJpZM4QqRr2.gif>
|
@rmetzner49 I just use the Arduino environment 1.8.5 with NotePad++ as an external editor. So I just edit my code in NotePad++, save it and touch Arduino checkmark or Right Arrow to compile and download. Currently I'm using a couple of clone WeMos Bluetooth + battery boards. I have a messy I2C bus (18" of 0.050" ribbon connecting 6 24LCxx EEproms, a DS1307, 2 MCP23008 (one as a 4x4 keypad driver, one driving a 20x4 LCD using a modified LiquidCrystal library), And of course a UNO. I'm using the UNO as an I2C Master to poke the ESP32 as a slave. A couple of DS18b20 as temp sensors.(I had to modify the OneWire.h library to make it work on the ESP32); A Micro SD card directly connected as the SD.h readme.md shows. (but it is unstable right now). Nothing Special. After I get I2C stable I'm planning on embedding ESP-VRoom-32 modules on some custom boards. Chuck. |
Chuck;
I’m also using the VROOM module on my final board. Using PCB123 from Sunstone because it’s FREE. I’ve road tested other Board Layout Software but decided that NONE of them have a decent autorouter, so I do all my routing by hand.
Of course as you know the kicker with ANY such package is you have to get really good at making your own library parts. Even though they tie into DigiKey, anything newer than about 2 years you have to make yourself. You’re probably using Eagle. I’ve made a VROOM32 block for PCB123 if that’s what you use.
Bob
From: chuck todd [mailto:notifications@github.com]
Sent: Monday, January 15, 2018 8:01 PM
To: espressif/arduino-esp32
Cc: rmetzner49; Mention
Subject: Re: [espressif/arduino-esp32] Set HSPI ports by default when HSPI is selected (#874)
@rmetzner49 <https://github.com/rmetzner49> I just use the Arduino environment 1.8.5 with NotePad++ as an external editor. So I just edit my code in NotePad++, save it and touch Arduino checkmark or Right Arrow to compile and download. Currently I'm using a couple of clone WeMos Bluetooth + battery boards.
I have a messy I2C bus (18" of 0.050" ribbon connecting 6 24LCxx EEproms, a DS1307, 2 MCP23008 (one as a 4x4 keypad driver, one driving a 20x4 LCD using a modified LiquidCrystal library), And of course a UNO. I'm using the UNO as an I2C Master to poke the ESP32 as a slave.
A couple of DS18b20 as temp sensors.(I had to modify the OneWire.h library to make it work on the ESP32);
A Micro SD card directly connected as the SD.h readme.md shows. (but it is unstable right now).
Nothing Special. After I get I2C stable I'm planning on embedding ESP-VRoom-32 modules on some custom boards.
Chuck.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#874 (comment)> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AMpGL5P_FxZwkrPew0fcGpV5Ozvc2Dl-ks5tK_TBgaJpZM4QqRr2> . <https://github.com/notifications/beacon/AMpGL77CBdkRFdnYSxS4gqMCICf3aHXFks5tK_TBgaJpZM4QqRr2.gif>
|
I also wanted to mention the display is from buydisplay.com which sells on fleaBay. Adafruit’s RA8875 libraries worked out of the box with that. Although I’ve zapped quite a few modules because they didn’t put a buffer on the 8875’s lines and I think I didn’t fully understand the power sequencing issue when running things at 3.3V. I ripped the 3.3V regulator off the DEV board so I can run at 3.3V since then. So I went out and bought the Adafruit board, plugged the flat cable into THEIR display and BINGO. I’m going to leave it on there before I buy another display, since unbuffered, it’s not a robust game.
Bob M.
From: chuck todd [mailto:notifications@github.com]
Sent: Monday, January 15, 2018 8:01 PM
To: espressif/arduino-esp32
Cc: rmetzner49; Mention
Subject: Re: [espressif/arduino-esp32] Set HSPI ports by default when HSPI is selected (#874)
@rmetzner49 <https://github.com/rmetzner49> I just use the Arduino environment 1.8.5 with NotePad++ as an external editor. So I just edit my code in NotePad++, save it and touch Arduino checkmark or Right Arrow to compile and download. Currently I'm using a couple of clone WeMos Bluetooth + battery boards.
I have a messy I2C bus (18" of 0.050" ribbon connecting 6 24LCxx EEproms, a DS1307, 2 MCP23008 (one as a 4x4 keypad driver, one driving a 20x4 LCD using a modified LiquidCrystal library), And of course a UNO. I'm using the UNO as an I2C Master to poke the ESP32 as a slave.
A couple of DS18b20 as temp sensors.(I had to modify the OneWire.h library to make it work on the ESP32);
A Micro SD card directly connected as the SD.h readme.md shows. (but it is unstable right now).
Nothing Special. After I get I2C stable I'm planning on embedding ESP-VRoom-32 modules on some custom boards.
Chuck.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#874 (comment)> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AMpGL5P_FxZwkrPew0fcGpV5Ozvc2Dl-ks5tK_TBgaJpZM4QqRr2> . <https://github.com/notifications/beacon/AMpGL77CBdkRFdnYSxS4gqMCICf3aHXFks5tK_TBgaJpZM4QqRr2.gif>
|
@rmetzner49 Yea I use Eagle 7.4 Not gonna upgrade to monthly payments. When AutoCad bought them out they changed licensing styles. I have been looking at KiCAD.. I have used IteadStudios (china) to manufacture PCB, a 10cm x 10cm 2 layer Qty10 costs about $35 with shipping(3 to 4 weeks). |
Chuck et al. --
Did your (significant) upgrade to I2C result in multimaster capability --
ie, if a master-send loses arbitration does it fall back to slave-receive
mode?
Thanks for all your work,
David
On Jan 16, 2018 08:52, "chuck todd" <notifications@github.com> wrote:
@rmetzner49 <https://github.com/rmetzner49> Yea I use Eagle 7.4 Not gonna
upgrade to monthly payments. When AutoCad bought them out they changed
licensing styles. I have been looking at KiCAD.. I have used IteadStudios
(china) to manufacture PCB, a 10cm x 10cm 2 layer Qty10 costs about $35
with shipping(3 to 4 weeks).
Chuck.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#874 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAg4SuCgrnUwjmdnhmyO5ZSDJ8-ITYyMks5tLNPjgaJpZM4QqRr2>
.
|
@dpharris No, Currently it only support Master Mode communications. I am working on Slave functions. Multiprocessor, multi thread, interrupt servicing, callbacks, spinlocks, mutex's Have me running in circles with my hair on fire! I'm having design issues with deadlocking between the ISR and foreground tasks modifying buffers.
My problem is that I can see no way to test these edge condition because they are so timing critical. The ISR has to accessing the buffer control block while the other Core is reallocating the control block! I am tending towards a two level control structure, the Active structure is only modified when the ISR Is pinned down, or maybe the ISR manages the Staged to Active merging. The Slave Mode I2C on the Arduino co-exists with Master Mode I2C transparently. That is what I am trying to emulate. Chuck. |
Hey, how’s it going?
So I finally got my TDC1000 and TDC7200 objects working after “Arduinoizing” Lindholm’s code and figuring out in which CPP file to create the Instance in so it would compile. Obviously also my Hardware is way different; I ran out of I/O pins so I stuck a PCF8574 on there as well. I now have BOTH buses going on including the Display’s MISO bug you helped me with.
(This runs on SPI every ½ second):
TDC1000.regWrite(0x00, 0xAA);
TDC7200.regWrite(0x01, 0x55);
Serial.println("========================");
uint8_t temp1 = TDC1000.regRead8(0x00);
uint8_t temp2 = TDC7200.regRead8(0x01);
uint32_t temp3=TDC1000.readClockFrequencyIn();
Serial.print("ClockFrequencyIn: ");
Serial.println(temp3);
Serial.println("==========================");
Printout:
========================
TDC1000_/CS: 15 Register: 0 Read Data AA
TDC7200_/CS: 27 Register: 1 Read Back 55
ClockFrequencyIn: 0
I2C is working great: I check for every device during setup:
Waiting for I2C...
AD7994 A/D should be at 0x21
PCF8574 I/O should be at 0x38
DS3232 RTC should be at 0x68
Scanning I2C Bus for Devices ...
I2C device found at address 0x21 or 33 DEC !
I2C device found at address 0x38 or 56 DEC !
I2C device found at address 0x68 or 104 DEC !
Done
Take Care,
Bob Metzner
From: chuck todd [mailto:notifications@github.com]
Sent: Tuesday, January 16, 2018 1:27 PM
To: espressif/arduino-esp32
Cc: rmetzner49; Mention
Subject: Re: [espressif/arduino-esp32] Set HSPI ports by default when HSPI is selected (#874)
@dpharris <https://github.com/dpharris> No, Currently it only support Master Mode communications. I am working on Slave functions. Multiprocessor, multi thread, interrupt servicing, callbacks, spinlocks, mutex's Have me running in circles with my hair on fire!
I'm having design issues with deadlocking between the ISR and foreground tasks modifying buffers.
Here is my current dilemma:
* SLAVE ISR triggered on Core0, which will add characters to a buffer thru a pointer and offset + count perhaps dispatch the completed transaction via Callback()
* Core1 in routine to add Master transaction to work queue, this addition causing a reallocate() expansion of the buffer control array. This reallocate() ends up moving the buffer control block to a new position in memory.
* Can I assume xPortEnter_CriticalfromISR() will freeze the other Core?
* Can I assume xPortEnter_Critical() will freeze the already entered ISR on the Other Core?
My problem is that I can see no way to test these edge condition because they are so timing critical. The ISR has to accessing the buffer control block while the other Core is reallocating the control block! I am tending towards a two level control structure, the Active structure is only modified when the ISR Is pinned down, or maybe the ISR manages the Staged to Active merging. The Slave Mode I2C on the Arduino co-exists with Master Mode I2C transparently. That is what I am trying to emulate.
Chuck.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#874 (comment)> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AMpGL08TRkZ2dLPO5X_zBeLYgt4uaCsDks5tLOoDgaJpZM4QqRr2> . <https://github.com/notifications/beacon/AMpGL1ZpS_86sLYKVyXColefdyB4Sv-xks5tLOoDgaJpZM4QqRr2.gif>
|
Hi Chuck:
Way back when, you convinced me to use the same SPI bus as this RA8875 display for my MAX35101 Ultrasound Chip. We together came to the conclusion that using the 74LVC1G125 buffer and enabling with the display’s chip select should work. It looked like it did for a while but now that I’m hot on the MAX35101 I find when I have the display connected, I can’t read back registers written to the 35101.
Since the ESP32 can connect any pin to its matrix, I’m thinking of trying this during setup:
tft.touchEnable(HIGH); // start up Touch Controller
delay(200);
SPI.end(); // divorce VSPI from interfering display
delay(5);
SPI.begin( 18, 17, 19, 5); // restart VSPI for MAX35101
MAX35101.satup = HIGH; // print out registers flag during init
MAX35101.reset();
delay(5);
MAX35101.initialize(); // Set basic parameters in Ultrasound Chip
MAX35101.satup = LOW; // turn off register printing
SPI.end(); // STOP VSPI for MAX35101
delay(5);
SPI.begin( 18, 23, 19, 5); // restart VSPI for interfering display
I didn’t see a slicker way to put MOSI on to pin 17 than to “begin” and “end” the bus. Am I way off base?
Thanks.
Bob Metzner
From: chuck todd [mailto:notifications@github.com]
Sent: Tuesday, January 16, 2018 11:53 AM
To: espressif/arduino-esp32
Cc: rmetzner49; Mention
Subject: Re: [espressif/arduino-esp32] Set HSPI ports by default when HSPI is selected (#874)
@rmetzner49 <https://github.com/rmetzner49> Yea I use Eagle 7.4 Not gonna upgrade to monthly payments. When AutoCad bought them out they changed licensing styles. I have been looking at KiCAD.. I have used IteadStudios (china) to manufacture PCB, a 10cm x 10cm 2 layer Qty10 costs about $35 with shipping(3 to 4 weeks).
Chuck.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#874 (comment)> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AMpGL4UKhLERkpTYK_-C7KW3BsJ8kQXrks5tLNPtgaJpZM4QqRr2> . <https://github.com/notifications/beacon/AMpGL3sYrGAzW_rquWuMiCizxfWcllFOks5tLNPtgaJpZM4QqRr2.gif>
|
@rmetzner49 I haven't done much with SPI, your code looks valid, I just reread this thread. How did you get it to work? I think a '125 with a weak 10k .. 100k pullup on MISO should work. the pullup will keep a float pin oscillation from happening. Chuck. |
It worked so far as the RA8875 and the Display is concerned which is why I thought the problem was solved. I also thought I was successfully hitting the 35101, but apparently not consistently. When I dug into the SPI code, I see now that when I put the 35101 into a “tight” read register loop, the MISO line never really floats. It somehow stays low. What I can’t understand is HOW it does that when the /OE of the 125 is tied to the display’s /CS (low true).
But back to my question, do you think just stopping VSPI with the display’s MISO and restarting it with the pin mapped to a spare pin is viable? Seems like it would be. I was poking around inside esp32-hal-spi to see if there is a way to “detach” just the MISO pin, but I didn’t see it. No worries though the ESP32 is so fast I doubt the overhead of killing and reviving the VSPI object will be a detriment. All this grief because of the goofy RA8875!
Have a good weekend, and thanks.
Bob Metzner
From: chuck todd [mailto:notifications@github.com]
Sent: Saturday, September 22, 2018 8:08 PM
To: espressif/arduino-esp32
Cc: rmetzner49; Mention
Subject: Re: [espressif/arduino-esp32] Set HSPI ports by default when HSPI is selected (#874)
@rmetzner49 <https://github.com/rmetzner49> I haven't done much with SPI, your code looks valid, I just reread this thread.
Back at the beginning, the first issue I brought up was that MISO might not be tri-stating.
But, My recommendation of a '125 buffer caused failures.
How did you get it to work?
I think a '125 with a weak 10k .. 100k pullup on MISO should work. the pullup will keep a float pin oscillation from happening.
Chuck.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#874 (comment)> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AMpGL2WuqzTaQgFLNfldiqwAUAXkjnVbks5udtDDgaJpZM4QqRr2> . <https://github.com/notifications/beacon/AMpGLzR134UzQlOWMioE0yCEHodf4Q5nks5udtDDgaJpZM4QqRr2.gif>
|
@rmetzner49 Ya, Stopping and Starting should work, as long as your CS pins stay disabled during the switch. The devices won't know any difference. Chuck. |
Such a bitchy thing this RA8875 Display Chip. Reading some more of the Blogs caused me to try something else: I ended up putting the 74LVC124 on all THREE pertinent signals; MISO, MOSI and CLK. When I looked at the signals more closely and putting the MAX35101 in a tight “write_reg” followed by a “read_reg” 1mS later, something from the 8875 was hanging on to MISO during the “0” data state.
So from the ESP32 to the RA8875 connect the input of the LVC125 to the CPU and the output to the RA8875 on the CLK and MOSI lines.
Connect the input of the third section to MISO of the RA8875 and the output to the CPU and it started working as expected.
You were so helpful early on, I just thought I’d share with you in case you have others frustrated with sharing an SPI channel with the RA8875.
Best Regards,
Bob Metzner
From: chuck todd [mailto:notifications@github.com]
Sent: Saturday, September 22, 2018 8:08 PM
To: espressif/arduino-esp32
Cc: rmetzner49; Mention
Subject: Re: [espressif/arduino-esp32] Set HSPI ports by default when HSPI is selected (#874)
@rmetzner49 <https://github.com/rmetzner49> I haven't done much with SPI, your code looks valid, I just reread this thread.
Back at the beginning, the first issue I brought up was that MISO might not be tri-stating.
But, My recommendation of a '125 buffer caused failures.
How did you get it to work?
I think a '125 with a weak 10k .. 100k pullup on MISO should work. the pullup will keep a float pin oscillation from happening.
Chuck.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#874 (comment)> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AMpGL2WuqzTaQgFLNfldiqwAUAXkjnVbks5udtDDgaJpZM4QqRr2> . <https://github.com/notifications/beacon/AMpGLzR134UzQlOWMioE0yCEHodf4Q5nks5udtDDgaJpZM4QqRr2.gif>
|
@rmetzner49 Nice to see you got it to work. Isn't it nice 😬 when "interface standards" are adhered to? Chuck. |
When user selected HSPI with SPIClass name(HSPI) ESP was, by default,
still using VSPI ports (the ones defined in pins_arduino.h).
With this change when user selects HSPI then HSPI default ports will be
used.
If user won't specify HSPI then VSPI default ports will be used.
If user will specify SCLK, MOSI, MISO and SS with SPI.begin() then user
defined ports will be used no matter if VSPI or HSPI is selected.
With this change fe. SD library can use default HSPI ports. It was
possible to
pass HSPI SPI instance to SD lib, however even then it was using VSPI
ports which were (probably) GPIO matrixed to HSPI.