MAX6954: Anyone Have Any Luck With Inferfacing With Arduino?

I have a few 6954s and read a ton of articles about how hard it is to get the communication through SPI to work correctly using this chip. Was wondering if anyone has played with it.

codlink:
I have a few 6954s and read a ton of articles about how hard it is to get the communication through SPI to work correctly using this chip. Was wondering if anyone has played with it.

The answer is no, but I just did a bit of research on this and the problem is that the MAX6954 expects the clock pin to be handled in a way that is incompatible with the way Atmel processors or Arduino do SPI (not sure which). From the datasheet:

Specifically, the SPI library takes CLK low before you can take CS high. This is inconvenient, but hardly a show-stopper. If you read the datasheet, know what the device expects, and control the lines yourself manually, you can make this happen. There are only three lines here to work your magic on. This is called bit-banging and it works just fine (I have used it on the MAX7219 and TLC5940, not to mention 74HC595s). The chip on the other side has no idea you are doing it in software rather than using the SPI hardware in the processor and wouldn't care anyway.

The answer is no, but I just did a bit of research on this and the problem is that the MAX6954 expects the clock pin to be handled in a way that is incompatible with the way Atmel processors or Arduino do SPI

Well there was a site in German where someone had made a chess board with an arduino and a MAX6954 chip, but when I checked it now it seems to have changed and there is no mention of the chip on that page. That site put me onto this chip in the first place. I have some samples but have not used them in a project yet. The page used to be at:-
http://www.andreadrian.de/schach/#Selbstbau_Schachcomputer_SHAH

Google showed this:-

Then there is an unresolved thread on this forum.
http://arduino.cc/forum/index.php/topic,12946.0.html

Grumpy_Mike:
Well there was a site in German where someone had made a chess board with an arduino and a MAX6954 chip, but when I checked it now it seems to have changed and there is no mention of the chip on that page. That site put me onto this chip in the first place. I have some samples but have not used them in a project yet. The page used to be at:-
Computer Schach

Wow, that's one hell of a post..

Grumpy_Mike:
Google showed this:-
Communicating with the MAX 6954 over an SPI bus using an ATMEGA328P. · GitHub

Yes found that as well, and got me thinking it could work. I really haven't been through the code line by line yet, but will go over it and take out what I don't need. Maybe I can get something happening.

Grumpy_Mike:
Then there is an unresolved thread on this forum.

http://arduino.cc/forum/index.php/topic,12946.0.html

Read that one as well, wondering why they stopped working on it...

I think I may pursue this a little harder and see what I can come up with. Maybe make a library to support it.

Hi everyone! I was also trying to get the MAX6954 working on the Arduino. Especially on the Arduino Due. To me it seems to be impossible with the builtin SPI routines. In the following example, the very first command being sent is fine (switching on the display test mode) but the next one is not accepted anymore:

#include <SPI.h>

// SPI on Arduino Due:   MOSI    MISO    SCK     SS
//                       ICSP-4  ICSP-1  ICSP-3  4,10,52
#define CS   52

void setup() {
  SPI.begin(CS);
  SPI.setClockDivider(CS, 84);
  SPI.setBitOrder(MSBFIRST);
  SPI.setDataMode(SPI_MODE0);
  
  // Enabling Display Test Mode
  SPI.transfer(CS, 0x07, SPI_CONTINUE);
  SPI.transfer(CS, 0x01);

  // Disabling Display Test Mode
  SPI.transfer(CS, 0x07, SPI_CONTINUE);
  SPI.transfer(CS, 0x00);
}

void loop() {
}

I think the reason is the strange timing behaviour of the chip. The MAX6954 expects the CLK to be low before CS goes low but afterwards the CLK should be high before CS goes high (see it's datasheet). That's just strange. I attached a measurement done with my Open Bench Logic Sniffer logic analyzer. It shows the behaviour of the code above. It reveals that the CLK is low when when CS changes to low as well as when CS changes to high as you would expect for a normal SPI device.

I don't want to implement the device using bit-banging. I'll check out the MAX6955 (which doesn't come as DIP :frowning: ) and try to use its I2C bus.

I don't understand how Anthony DiGirolamo got it working with the Arduino (see [1] and [2]) (without implementing bit-banging mode!).

Here are links to similar problems: A discussion also describing the timing problem and some PIC code for the MAX6954 obviously also non-working.

SPI-Bus-MAX6954_0x07-0x01.png

pklaus:
Hi everyone! I was also trying to get the MAX6954 working on the Arduino. Especially on the Arduino Due. To me it seems to be impossible with the builtin SPI routines. In the following example, the very first command being sent is fine (switching on the display test mode) but the next one is not accepted anymore:

#include <SPI.h>

// SPI on Arduino Due:   MOSI    MISO    SCK     SS
//                       ICSP-4  ICSP-1  ICSP-3  4,10,52
#define CS   52

void setup() {
 SPI.begin(CS);
 SPI.setClockDivider(CS, 84);
 SPI.setBitOrder(MSBFIRST);
 SPI.setDataMode(SPI_MODE0);
 
 // Enabling Display Test Mode
 SPI.transfer(CS, 0x07, SPI_CONTINUE);
 SPI.transfer(CS, 0x01);

// Disabling Display Test Mode
 SPI.transfer(CS, 0x07, SPI_CONTINUE);
 SPI.transfer(CS, 0x00);
}

void loop() {
}




I think the reason is the strange timing behaviour of the chip. The MAX6954 expects the CLK to be low before CS goes low but afterwards the CLK should be high before CS goes high (see it's datasheet). That's just strange. I attached a measurement done with my *Open Bench Logic Sniffer* logic analyzer. It shows the behaviour of the code above. It reveals that the CLK is low when when CS changes to low as well as when CS changes to high as you would expect for a normal SPI device.

I don't want to implement the device using bit-banging. I'll check out the MAX6955 (which doesn't come as DIP :( ) and try to use its I2C bus.

I don't understand how [Anthony DiGirolamo](https://gist.github.com/AnthonyDiGirolamo) got it working with the Arduino (see [[1]](https://gist.github.com/AnthonyDiGirolamo/1176125) and [[2]](http://anthonydigirolamo.github.io/blog/2013/02/13/lights-out-box/)) (without implementing bit-banging mode!).

Here are links to similar problems: [A discussion also describing the timing problem](http://digital-diy.com/forum/electronics-projects/spi-help-and-advice-needed-t103.html) and [some PIC code for the MAX6954 obviously also non-working](http://www.mikroe.com/forum/viewtopic.php?f=147&t=54618).

Did you get any further with this? I am tearing my hair out with this damn chip. I to cannot understand how Anthony got his project to work perfectly? I cannot get anything displayed at all on my test breadboard (1 chip , 2 16 segment alpha digits). I have tried using the hardware serial SPI approach and creating a software approach.