Skip to content

Teensy 3.6 SPI for TFT+touch - change SPI clock pin? #433

Answered by Pconti31
u1550l asked this question in Q&A
Discussion options

You must be logged in to vote

@u1550l I would try and edit your config file, say its teensy-adagfx-ili9341_t3-xpt2046.h
and change

//  #define ADAGFX_PIN_CLK      13
  #define ADAGFX_PIN_CLK      14

and somewhere in your app before you try to use the led

pinMode(13,OUTPUT);

If that fails you may also need to hack GUIslice_drv_adagfx.cpp gslc_DrvInit() function to use:

  SPI.begin();
  SPI.setBitOrder(MSBFIRST); 
  SPI.setDataMode(SPI_MODE1);
  
// It is VERY IMPORTANT that the pins be reassigned AFTER ALL
// SPI initialization INCLUDING datamode or bitorder etc.

  // First reassign pin 13 to Alt1 so that it is not SCK but the LED still works
  CORE_PIN13_CONFIG = PORT_PCR_MUX(1);
  // and then reassign pin 14 to SC…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@u1550l
Comment options

Answer selected by u1550l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants