Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: SPI and Digole Display Clock divider problems.

Threaded View

  1. #1

    SPI and Digole Display Clock divider problems.

    Hardware:

    I am trying to get my Teensy to communicate with the Digole display over an SPI interface however I can not seem to get the display to respond.
    Using the Digole Library everthing works perfectly however I am forced to use 24MHz clock speed which I would rather not do.

    I believe this is a case of newb programmer missing something important, so please enlighten me as to why the following code will not work:
    Code:
    #include <SPI.h>  // include the SPI library:
    
    const int slaveSelectPin = 10;
    
    SPISettings settingsA(1600000, MSBFIRST, SPI_MODE1);
    
    void setup() {
      // set the slaveSelectPin as an output:
      pinMode (slaveSelectPin, OUTPUT);
      // initialize SPI:
      SPI.begin();
      delay(10);  //waiting for display model ready
      ClearScreen();
    }
    
    void loop(){
      WriteChar('5');
      delay(1000);
    }
    
    void ClearScreen(){
      SPI.beginTransaction(settingsA);
      digitalWrite(slaveSelectPin,LOW);
      //  send in the address and value via SPI:
      SPI.transfer('C');
      SPI.transfer('L');
      // take the SS pin high to de-select the chip:
      digitalWrite(slaveSelectPin,HIGH); 
      SPI.endTransaction();
    }
    
    void WriteChar(int integer){
      SPI.beginTransaction(settingsA);
      digitalWrite(slaveSelectPin,LOW);
      //  send in the address and value via SPI:
      SPI.transfer('TT');
      SPI.transfer(integer);
      // take the SS pin high to de-select the chip:
      digitalWrite(slaveSelectPin,HIGH);
      SPI.endTransaction(); 
    }
    Last edited by jacky4566; 11-26-2014 at 04:36 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •