Help me keep what hair I have left.
I am using the sample scrolling text sample from the MD_MAX72xx sample of scrolling text.
With the four module, common module, everything is great, but when I add the second module in series I can only get 5 units of 8 x 8 modules to work, the other three are blank. I have worked weeks on this and changed everything I can think of in the sample with no change. I am using a separate supply for the modules from the uno and using bypass caps and a power rail to the last module, no change. I am using the FC16 modules and I changed the software to correct for these.
If I had not spent over three weeks trying to fix this my self I would not be asking for your help.
I am hoping one of you have an easy answer to this problem so you can make me look dumb. !!
Thank you for your time.
Dave
What is your power supply? You need 5V (not 3V) and I would expect at least 500mA for that number of modules.
Are the matrices plugged in the right way? You can turn them 180 degrees to check without damaging anything.
Connections between the modules - are they soldered or just plugged in?
It is hard to tell what you have done wrong because you have not told us what you have done. A schematic and photograph are a good way, along with the code you are using.
Have you connected the ground of your external supply to the ground of the Arduino?
Have you tried swapping the modules over to see if the fault follows the module?
Have you got ceramic decoupling capacitors on the power and ground of each IC?
Here is an updated post to my first one answering some questions as to what I have done.
This should make my question much more clearer.
It is hard to tell what you have done wrong because you have not told us what you have done.
The modules are the ones available almost everywhere
A schematic and photograph are a good way, along with the code you are using.
A PDF of the code is attached.
Have you connected the ground of your external supply to the ground of the Arduino?
YES.
Have you tried swapping the modules over to see if the fault follows the module?
The modules were swapped with new and checked by themselves.
Have you got ceramic decoupling capacitors on the power and ground of each IC?
No, but good caps on the input and output of each 4 unit module.
Power and ground rails added to the dual module.
Posted by marco_c - Today at 03:57 amQuote
What is your power supply? You need 5V (not 3V) and I would expect at least 500mA for that number of modules.
There is a dedicated supply for the 8X8 modules regulated at 5vdc @3amps. Grounds common.
Are the matrices plugged in the right way? You can turn them 180 degrees to check without damaging anything.
The modules have been checked and OKAY with four digits.
Connections between the modules - are they soldered or just plugged in?
They come new plugged in to sockets. And check good.
The two modules are soldered with jumpers together.
DaveWreski:
A PDF of the code is attached.
No, it does not appear to be.
Please do not post .pdf files.
Please read the instructions for posting.
Have you got ceramic decoupling capacitors on the power and ground of each IC?
No, but good caps on the input and output of each 4 unit module.
Power and ground rails added to the dual module.
Not good enough I am afraid. You need a ceramic capacitor on each chip.
See this for why
http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html
The modules are the ones available almost everywhere
Lots of modules are on line. We need to know exactly what one you have used. Please post a link to the one you are using.
Hello Paul,
Here it is. Lost after edit.
No, it does not appear to be.
Please do not post .pdf files.
Hello Paul, this is the instructions from the Forum.
Please read the instructions for posting.
Allowed file types: doc, gif, jpg, mpg, pdf, png, txt, zip, c, h, cpp, ino, pde
Hello Mike,
This is the one I am using.
Amazon.com
Not good enough I am afraid. You need a ceramic capacitor on each chip.
Mike, there are decoupling caps already on the PCB.
Somehow when I edited the post the attached was lost.
Here it is.
I do like PDF for many reasons. If you do not like PDF I will find a different file type that all of us do like.
Thank you all for your response and time.
MAX79XX problem.pdf (60.6 KB)
Hello all,
I think I attached an older file. Please disregard the previous attach.
Here is the latest attached in TXT format.
I hope this did not create too much confusion.
Sorry all.
Dave
:o
Dave_MAX7219_Working almost.txt (4.99 KB)
@Dave, Code is best attached inside code tags (</>) if it fits the character limits as opening attachments is difficult if you are using a phone or a tablet. Attaching in code tags maximises your chances of getting help. (btw, item 7 in 'how to post' is relevant here).
I think you may want to post a photo of the connections in this circuit as what you say and what you see happening don't seem to marry up.
For those playing at home, here is the code, which seems a slight variation on standard library example that are known working code, as stated.
//
// scrolling text - 11/24/2019 working version ! DAW
//
// Use the MD_MAX72XX library to scroll text on the display
//
// Demonstrates the use of the callback function to control what
// is scrolled on the display text.
//
// User can enter text on the serial monitor and this will display as a
// scrolling message on the display.
// Speed for the display is controlled by a pot on SPEED_IN analog in A5.
//
#include <MD_MAX72xx.h>
#include <SPI.h>
#define USE_POT_CONTROL 1
#define PRINT_CALLBACK 0
#define PRINT(s, v) { Serial.print(F(s)); Serial.print(v); }
// Define the number of devices we have in the chain and the hardware interface
// NOTE: These pin numbers will probably not work with your hardware and may
// need to be adapted
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
// Max was 11
#define MAX_DEVICES 20
#define CLK_PIN 13 // or SCK
#define DATA_PIN 11 // or MOSI
#define CS_PIN 10 // or SS
// SPI hardware interface
MD_MAX72XX mx = MD_MAX72XX(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
// Arbitrary pins
//MD_MAX72XX mx = MD_MAX72XX(HARDWARE_TYPE, DATA_PIN, CLK_PIN, CS_PIN, MAX_DEVICES);
// Scrolling parameters
#if USE_POT_CONTROL
#define SPEED_IN A5
#else
#define SCROLL_DELAY 100 // in milliseconds
#endif // USE_POT_CONTROL
#define CHAR_SPACING 1 // pixels between characters
// Global message buffers shared by Serial and Scrolling functions
// BUF was 75
#define BUF_SIZE 96
char curMessage[BUF_SIZE];
char newMessage[BUF_SIZE];
bool newMessageAvailable = false;
uint16_t scrollDelay; // in milliseconds
void readSerial(void)
{
static uint8_t putIndex = 0;
while (Serial.available())
{
newMessage[putIndex] = (char)Serial.read();
if ((newMessage[putIndex] == '\n') || (putIndex >= BUF_SIZE-3)) // end of message character or full buffer
{
// put in a message separator and end the string
newMessage[putIndex++] = ' ';
newMessage[putIndex] = '\0';
// restart the index for next filling spree and flag we have a message waiting
putIndex = 0;
newMessageAvailable = true;
}
else if (newMessage[putIndex] != '\r')
// Just save the next char in next location
putIndex++;
}
}
void scrollDataSink(uint8_t dev, MD_MAX72XX::transformType_t t, uint8_t col)
// Callback function for data that is being scrolled off the display
{
#if PRINT_CALLBACK
Serial.print("\n cb ");
Serial.print(dev);
Serial.print(' ');
Serial.print(t);
Serial.print(' ');
Serial.println(col);
#endif
}
uint8_t scrollDataSource(uint8_t dev, MD_MAX72XX::transformType_t t)
// Callback function for data that is required for scrolling into the display
{
static char *p = curMessage;
static uint8_t state = 0;
static uint8_t curLen, showLen;
static uint8_t cBuf[8];
uint8_t colData;
// finite state machine to control what we do on the callback
switch(state)
{
case 0: // Load the next character from the font table
showLen = mx.getChar(*p++, sizeof(cBuf)/sizeof(cBuf[0]), cBuf);
curLen = 0;
state++;
// if we reached end of message, reset the message pointer
if (*p == '\0')
{
p = curMessage; // reset the pointer to start of message
if (newMessageAvailable) // there is a new message waiting
{
strcpy(curMessage, newMessage); // copy it in
newMessageAvailable = false;
}
}
// !! deliberately fall through to next state to start displaying
case 1: // display the next part of the character
colData = cBuf[curLen++];
if (curLen == showLen)
{
showLen = CHAR_SPACING;
curLen = 0;
state = 2;
}
break;
case 2: // display inter-character spacing (blank column)
colData = 0;
curLen++;
if (curLen == showLen)
state = 0;
break;
default:
state = 0;
}
return(colData);
}
void scrollText(void)
{
static uint32_t prevTime = 0;
// Is it time to scroll the text?
if (millis()-prevTime >= scrollDelay)
{
mx.transform(MD_MAX72XX::TSL); // scroll along - the callback will load all the data
prevTime = millis(); // starting point for next time
}
}
uint16_t getScrollDelay(void)
{
#if USE_POT_CONTROL
uint16_t t;
t = analogRead(SPEED_IN);
t = map(t, 0, 1023, 25, 250);
return(t);
#else
return(SCROLL_DELAY);
#endif
}
void setup()
{
mx.begin();
mx.setShiftDataInCallback(scrollDataSource);
mx.setShiftDataOutCallback(scrollDataSink);
#if USE_POT_CONTROL
pinMode(SPEED_IN, INPUT);
#else
scrollDelay = SCROLL_DELAY;
#endif
strcpy(curMessage, "Happy Birthday Beckie! ");
newMessage[0] = '\0';
Serial.begin(57600);
Serial.print("\n[MD_MAX72XX Message Display]\nType a message for the scrolling display\nEnd message line with a newline");
}
void loop()
{
scrollDelay = getScrollDelay();
readSerial();
scrollText();
}
DaveWreski:
I do like PDF for many reasons. If you do not like PDF I will find a different file type that all of us do like.
Just so you follow why, two points of interest:
While recent browsers can display PDFs, a PDF cannot be part of a Web page. While one or two regular helpers here have a preference for attachments, most of us and especially those using tablets or phones - such as Mike above - prefer to examine things (code and photos) in the browser so if you post a graphic as an attachment, I will usually embed it as an image in a reply for you.
Similarly, Marco - who is the author of the "Parola" libraries you are using - has taken your text attachment which is within the size limit of a single posting here and embedded it in the more suitable form of a "code window". Now any of us can inspect it easily and explain problems or improvements.
Incidentally, while you can delete previous posts or modify them, other than adding material to improve or clarify them - such as adding the "code" tags to code posted without - is disruptive and unhelpful. So we are more than happy to have your PDF to look at.
The second point. The specific purpose of a PDF is for publishing - on paper.
It is however often used as a means of obfuscating the document, to make it unusable for excerpting, preventing cut-and-paste. Now what you posted as a PDF is a "genuine" one which actually contains the original data which can thus be readily extracted, many PDFs are no more than a scanned image from which essentially nothing can be used. And in this particular case, it is actually difficult to read, too large type, too widely spaced and inappropriately divided into pages. Usable, but not terribly practical!
But now - do tell us why you like PDFs? Do you work for Adobe?
Thanks for the link, can you post it as a clickable link next time. Use the icon to the right of the TV icon that is supposed to look like a link in a chain. Also quotes can be embedded using the speak bubble icon fourth from the right. All these things are mentioned in the how to use this forum sticky post.
Mike, there are decoupling caps already on the PCB.
That is not good enough every IC needs it’s own capacitor as close to the chip as possible. That means making the wires to the capacitor as short as possible as well. You see the leads act as an inductor which reduces the top frequency of interference they can filter out.