Problem with ST7565 and SdCard

by ttfte on Thu Mar 28, 2013 6:44 am

Hello!

We are useing the Display Lib ST7565, and we want to use the Sd Card parallel to the Display!
but we have a problem, how can we make the slave select with this display lib.

at the moment de Display crashed when we start log on the Sd Card!
The measurement Values are stored on the SD card but the display disappears!


Our Microcontroller are ATmega90USB1286, (Teensy 2.0++)!
We are programming in ARDUINO!
ttfte
 
Posts: 4
Joined: Tue Mar 26, 2013 11:22 am

Re: Problem with ST7565 and SdCard

by franklin97355 on Thu Mar 28, 2013 11:07 am

You need to make sure your slave select line is different for each device, it sounds like it is not. I can't tell more as I don't know your code or connections.
User avatar
franklin97355
 
Posts: 4368
Joined: Mon Apr 21, 2008 1:33 pm

Re: Problem with ST7565 and SdCard

by ttfte on Fri Mar 29, 2013 11:44 am

Hello,

Here is the part of our Sourcecode:

Code: Select all | TOGGLE FULL SIZE
#include <DateTimeStrings.h>
#include <DateTime.h>
#include "ST7565.h"
#include <avr/sleep.h>
#include <ST7565_Menu.h>
#include <SD.h>

File file;

const int ledPin    = 6;   // Teensy has LED on 11, Teensy++ on 6

ST7565 glcd(22, 21, 27, 26, 24 );  // SPI //on these Pins our Display and SD-Card are connected!
//Slave Select for "SD-Card" are Pin 20 and Slave Select for "Display" are Pin 24!

float Current_O2;

    void loop()
    {
           WriteSd();
    }

    void WriteSd()
    {

        if (Sd_on_off == true)
        {
           
            if (SD.begin())
            {
                  file = SD.open("Test_O2.txt", FILE_WRITE);
                  file.println(Current_O2); // thats a measurement Value
                  file.print(time_is);
                  file.close();
                 
             }     
     }
 
  }


I hope you can to help us further! :)
Last edited by adafruit_support_bill on Fri Mar 29, 2013 12:18 pm, edited 1 time in total.
Reason: Please use the 'code' button when submitting code
ttfte
 
Posts: 4
Joined: Tue Mar 26, 2013 11:22 am

Re: Problem with ST7565 and SdCard

by adafruit_support_bill on Fri Mar 29, 2013 12:21 pm

//Slave Select for "SD-Card" are Pin 20 and Slave Select for "Display" are Pin 24!

Where are you setting that for the SD?
User avatar
adafruit_support_bill
 
Posts: 28831
Joined: Sat Feb 07, 2009 9:11 am

Re: Problem with ST7565 and SdCard

by ttfte on Fri Mar 29, 2013 1:39 pm

We have also tried "SD.begin(20);"
with the information from these two sites:

http://arduino.cc/en/Reference/SD
http://arduino.cc/en/Reference/SDbegin

it still does not work!
ttfte
 
Posts: 4
Joined: Tue Mar 26, 2013 11:22 am

Re: Problem with ST7565 and SdCard

by adafruit_support_bill on Fri Mar 29, 2013 1:55 pm

You might try contacting the Teensy engineers over at http://www.pjrc.com/
User avatar
adafruit_support_bill
 
Posts: 28831
Joined: Sat Feb 07, 2009 9:11 am