• 0
Sign in to follow this  
Thomasx

MTDS & Mega ADK Problem!?

Question

Hi

I just got the MTDS, running it with my Mega ADK.

However, when I try the MyDispDemo sketches, the MTDS will just blink once and then be all black, backlight on.

I just keep getting "mydisp.begin() failed"

What could the issue be?

Thanks, Thomasx

Edited by Thomasx

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Ok. I'll answer myself and follow up with another question.

So I changed the CS pinning in the MtdsHal.H file. Hard-coded them to 8 and 10, ALT_CS and CS, respectively.

And what do you know, it started working :)

Now, you need to consider me a newbie at this (so don't ask how I figured that out ;) )

Now my question is:

Since hard coding like this in the library h-file isn't really a smart thing to do, quoting out all the "if defined"-stuff.

How do I go about fixing this issue in a proper way?

Thanx,

    Thomas

Share this post


Link to post
Share on other sites
  • 0

Hi @Thomasx,

What I would do (I don't have a Arduino Mega ADK so I can't confirm functionality) is I would add a new set of #if defined set for the ADK in that same MtdsHal.h. Since it appears that it is based of the AT MEGA 2560, I would probably add in the following lines after line 55 (the one just before the "#endif" after the "#define pinMtdsSelStd   SS   // standard SPI SS pin").

#elif defined(__AVR_ATmega2560__)
  #define pinMtdsSelStd		10

This provides a non-hard coded way to add in the functionality; what I suspect is occurring on your board is that it expects the chip select pin to be in a different location, though I am not certain where it thinks it is for the Mega ADK; probably on pin 53.

Let me know how this works.

Thanks,
JColvin

Share this post


Link to post
Share on other sites
  • 0

Ok, thanks. 

Clearly someplace else, anyway :)

There aren't any board specific defines in this h-file, as far as I can understand. It seems to me the assignment of the correct CS pin is made via PIN_DSPI0_SS which is set to board specific values someplace else. So I was thinking that's where the proper place would be to add the info for the Mega ADK board.

But I guess your way will work too. I'll give it a try.

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
Sign in to follow this