• 0
Tbreak

MTDS LCD How to use the Alt CS ?

Question

A previous thread noted use on the Arduino Mega seemed imposable because there is no obvious easy way to change the CS pin in the software libraries. My attempts to find what code needs changing and the attempts in the previous threads attempts, result in the display performing a short flash and then going black/dead. I do need to solve this as Digilents DMM card that I also need in my project uses the same CS as this LCD. This previous thread had an official response of 'oops perhaps it is not Arduino Mega compatible we had better take it out of the brochure web pages'. 

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

I can now answer my own question. It is not a 'nice' solution but it works and may help others. 

The following would seem to be the logical way to change to using the Alt CS on this LCD shield but this fails.

bool MTDS::begin() {

//    return begin(pinMtdsSelStd, frqMtdsSpiDefault);
    return begin(pinMtdsSelAlt, frqMtdsSpiDefault);  // My change for alternate pin selection

}

In MtdsHal.h  there is code to define the two IO pins used for CS,   pinMtdsSelStd and pinMtdsSelAlt,  for various types of hardware.  

Following all these #'define if elses,  just force the library to always use the Arduino Uno's IO pin 8 by redefining everything the  ' if elses' have setup. 

#define    pinMtdsSelAlt        8
#define    pinMtdsSelStd       8

Do not bother alter the MTDS::begin() code.

 

 

 

 

Share this post


Link to post
Share on other sites
  • 0

Hi @Tbreak,

Thank you for sharing for what you found. That is the appropriate solution to the problem you found; some libraries use a hardware CS pin that is more difficult to change.

Thanks,
JColvin

Share this post


Link to post
Share on other sites
  • 0

Sadly I've progressed to see this hardware is not reliable on the Arduino. Hit and miss if it decides to work, I suspect depending on what it was doing when last powered off. This is work and not a hobby so I cant waste more time on it. I've now ordered a display from a different company.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now