Page 1 of 1

ESP32 LOLIN Confusion

Posted: Sun Mar 14, 2021 2:08 pm
by p.erasmus
Hi Team,
I am starting to work with ESP32 and I have a LED blinking on GPIO17 however I want to interface to the SPI of the device and just there my confusion started ,I try show below what my confusion is

ON the LOLIN32 board the top numbering seems to be GPIOx ( 2 ,4,17 etc) this I used Pin 17 and it works fine
P4.jpg
P4.jpg (63.88 KiB) Viewed 2523 times
P2.jpg
P2.jpg (47.48 KiB) Viewed 2523 times
However when trying to set the SPI pins we have now PORTA and PORTB numbers ,example there is PIN PORTA0 and PORTB0 but on the Board there is only 1 pin marked 0 is this now PORTA or B

:oops: again the I am is lost What am I missing ,How do I interpret the PORT pins A and B to the GPIO pin numbering
I tried the datasheet that also give no PORTA & B descriptions only GPIO naming
P3.jpeg
P3.jpeg (58.44 KiB) Viewed 2523 times
P1.jpg
P1.jpg (48.03 KiB) Viewed 2523 times

Re: ESP32 LOLIN Confusion

Posted: Sun Mar 14, 2021 3:05 pm
by BenR
Hello

Sorry for the confusion flowcode and the esp core works in ports however mainly due to arduino there has been a push to use pin numbers as references.

PortA includes pins 0 to 31. So digital pin 18 is PortA 18.

PortB includes pins 32 onwards so digital pin 34 is PortB 2.

Hope this helps.

Re: ESP32 LOLIN Confusion

Posted: Sun Mar 14, 2021 4:01 pm
by p.erasmus
Hello Ben.

Thank you this make sense will do as such , :D

Have good time