0

I messed around with the MAX7456 chip for a while, even the character set updating sketch seemed to work after a few modifications. But now it is not displaying anything with the Hello World sketch that worked before. No signal seems to pass through it, the screen is just black.

The datasheet says that one must write Video Mode 0 Register (VM0) at address 00H bit 1 to 1 via SPI to reset it, how would I do it? Also, how would one verify that the chip indeed did reset itself and responds to the commands given to it afterwards? (The board looks like this)

  • Can you clarify: The board used to work, and now -- using the same code -- it doesn't? Or it works for a while, and then not? Or it works with some code but not other code? – Nick Gammon Aug 31 '15 at 22:16
  • @NickGammon Yes, using the same code the board does not work any more. – Avamander Sep 1 '15 at 10:29
  • Well, after powering the chip off it should reset. I don't think sending a software reset would achieve anything more than a power off. It is possible you damaged it, however without more information it is impossible to say. – Nick Gammon Sep 1 '15 at 11:04
  • Your answer seemed to fix the issue. It now works. – Avamander Sep 1 '15 at 12:55
1
+50

The datasheet says:

The SPI commands are 16 bits long with the 8 most significant bits (MSBs) representing the register address and the 8 least significant bits (LSBs) representing the data ...

Thus, you need to write address / data after selecting the chip.

digitalWrite (SS, LOW);  // select the chip 
SPI.transfer (0x00);     // select address 0x00 (Video Mode 0)
SPI.transfer (bit (1));  // write bit 1 (Software Reset Bit)
digitalWrite (SS, HIGH); // done

According to the datasheet you need to wait around 20 µs for the operation to complete. You could, of course, just wait 20 µs but it might be nice to see if the bit gets cleared.

  byte result;

  do 
    {
    digitalWrite (SS, LOW);      // select the chip 
    SPI.transfer (0x80);         // select address 0x00 (Video Mode 0) - read mode
    result = SPI.transfer (0);   // read it
    digitalWrite (SS, HIGH);     // done
    } while (result & bit (1));  // loop while not reset yet

Also, how would one verify that the chip indeed did reset itself and responds to the commands given to it afterwards?

I'm not sure, without the chip in hand, what other tests you can make, but if you added a counter into the above loop, you could probably verify that it was doing something. eg.

  // reset chip
  digitalWrite (SS, LOW);  // select the chip 
  SPI.transfer (0x00);     // select address 0x00 (Video Mode 0) - write mode
  SPI.transfer (bit (1));  // write bit 1 (Software Reset Bit)
  digitalWrite (SS, HIGH); // done

  byte result;
  unsigned int counter = 0;

  // wait for it to become ready, or time-out      
  do 
    {
    digitalWrite (SS, LOW);      // select the chip 
    SPI.transfer (0x80);         // select address 0x00 (Video Mode 0) - read mode
    result = SPI.transfer (0);   // read it
    digitalWrite (SS, HIGH);     // done
    if ((result & bit (1)) == 0)
      counter++;     // count times not ready
    } while ((result & bit (1)) && (counter < 1000) );  // loop while not reset yet

  if (counter == 0 || counter >= 1000)
    {
    // chip does not seem to be responding
    }
  else
    {
    // all OK!
    }
  • This sketch seemed to do the job. The hello world sketch started working (but for obvious reasons the character set is wrong). – Avamander Sep 1 '15 at 12:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.