Teensy 3.6 Breakout Board SPI Design conflict Issue

Status
Not open for further replies.

SimonWakley

Active member
I have built a break out board for using the Teensy 3.6 on a variety of different projects. It has the IL19341 Display with Touch Screen, 2 RS232 serial Ports 1 RS422 serial port, a debug TTL serial port and a Network Board - the Wiznet 820 IO as well as connections for taking the other pins to daughter boards for future expansion projects.

I have the Screen working with some buttons I can press and the Network Adapter Receiver getting UDP packets. BUT I cannot get the Screen to work at the same time as the Network Adapter.

I fear there is some conflict between the SPI settings for each. Does anyone know of a fix for this or should I switch either the Display and Touch Screen to another SPI or the Wiznet and if I did so, how would that be achieved.

View attachment WakrinoLedSerialTftTouchNW.ino.ino

Thanks,

Simon

PS: Anyone know of a SIMPLE library for buttons etc for this display I feel I am re-inventing the wheel and someone has done a better job of it already...
 

Attachments

  • WakdrinoSchematic.PDF
    446.9 KB · Views: 128
Exactly which library is used can make a difference here. I ran into a similar issue with incompatible SPI settings and needing to call the display/ethernet begin functions between uses. Need to find my notes because went up several blind allays but think you may be able to dig down the the SPI init line each library uses.

If the libraries are BOTH setup to use them SPI transactions is the right way to handle different SPI settings on the same bus.
https://www.pjrc.com/teensy/td_libs_SPI.html
 
Hi GremlinWrangler,
Thanks for your informative reply amd sorry for the delay in responding. I looked through the code that was being used for these devices and pulled out what I thought would make a difference, but I am a little unsure of the use of C/D and D/C particularly with the TFT screen

I added these functions before using either device and I can use the Network if I do not use the TFT, but I cannot use the screen.

Any suggestions etc would be greatly appreciated. I will try and dig deeper into the code. I could also use a different SPI since there are several on the Teensy, but that would require a different set of changes?

#ifdef INIT_SCREEN
// Called before starting a new TouchScreen function
void Tft_Spi(void)
{
// setCS() is not intended for use from normal Arduino programs/sketches. - Per SPI.cpp :-(
SPI.setCS(TFT_CS);

// From Paul's ILI9341_t3.cpp
#define SPICLOCK 30000000
SPI.beginTransaction(SPISettings(SPICLOCK, MSBFIRST, SPI_MODE0));
}
#endif

#ifdef INIT_NETWORK
// Called before talking to Wiznet
void Wiznet_Spi(void)
{
SPI.setCS(WIZNET_CS);

// From Teensy Ethernet.cpp
#define SPI_ETHERNET_SETTINGS SPISettings(14000000, MSBFIRST, SPI_MODE0)
SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
}
#endif

Best

Simon
 
Did you check with an oscilloscope or logic analyzer if the respective CS pins are really pulled down accordingly to the device you want to send data to?
 
I have not checked the lines with a scope, they were working with each device individually, and I think the issue is in the switch over between the devices either in speed or in control lines. I have not put a scope on it and will try that if I can't solve with setting the comms modes. Thanks
 
Status
Not open for further replies.
Back
Top