Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

PyPortal: SWDIO and SWCLK as GPIO (GPO specifically to suppo
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

PyPortal: SWDIO and SWCLK as GPIO (GPO specifically to suppo

by dbj1906 on Thu Jul 02, 2020 8:04 pm

I really want to use SPI (software SPI) to add a second TFT or OLED to my PyPortal Titano. I know a 4 wire software SPI will work (omitting the MISO pin). Unfortunately, there are only two exposed pins (D3 and D4) on the PyPortal. I looked at the variant.cpp file, and it looks like the SWDIO and SWCLK can be used as GPIO (and those pins are also conveniently exposed on the back).

These lines that refer to the SWCLK and SWDIO pins are as follows (in variant.cpp):

Code: Select all | TOGGLE FULL SIZE
/* NEW PIN DEFS IN PROGRESS:

  { PORTA,  3, PIO_ANALOG    , PIN_ATTR_ANALOG                 , ADC_Channel1  , NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_3    }, // AREF - NOT USED
  { PORTA, 30, PIO_DIGITAL   , PIN_ATTR_PWM_E                  , No_ADC_Channel, TC6_CH0   , TC6_CH0     , EXTERNAL_INT_14   }, // SWCLK - not used?
  { PORTA, 31, PIO_DIGITAL   , PIN_ATTR_PWM_E                  , No_ADC_Channel, TC6_CH1   , TC6_CH1     , EXTERNAL_INT_15   }, // SWDIO - not used?
*/

Is it just a matter of uncommenting them? Do I also need to add anything to variant.h file? Or is this so silly and ill-advised that I should just look into alternatives?

dbj1906
 
Posts: 21
Joined: Sun Apr 09, 2017 10:30 am

Please be positive and constructive with your questions and comments.