{"action":"created","issue":{"url":"https://api.github.com/repos/marekburiak/ILI9341_due/issues/4","labels_url":"https://api.github.com/repos/marekburiak/ILI9341_due/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/marekburiak/ILI9341_due/issues/4/comments","events_url":"https://api.github.com/repos/marekburiak/ILI9341_due/issues/4/events","html_url":"https://github.com/marekburiak/ILI9341_due/issues/4","id":107387212,"number":4,"title":"program blocks if  running a SD card on the SPI bus additionally to ILI9341_due","user":{"login":"VogonJeltz","id":11213519,"avatar_url":"https://avatars.githubusercontent.com/u/11213519?v=3","gravatar_id":"","url":"https://api.github.com/users/VogonJeltz","html_url":"https://github.com/VogonJeltz","followers_url":"https://api.github.com/users/VogonJeltz/followers","following_url":"https://api.github.com/users/VogonJeltz/following{/other_user}","gists_url":"https://api.github.com/users/VogonJeltz/gists{/gist_id}","starred_url":"https://api.github.com/users/VogonJeltz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VogonJeltz/subscriptions","organizations_url":"https://api.github.com/users/VogonJeltz/orgs","repos_url":"https://api.github.com/users/VogonJeltz/repos","events_url":"https://api.github.com/users/VogonJeltz/events{/privacy}","received_events_url":"https://api.github.com/users/VogonJeltz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-09-20T11:09:16Z","updated_at":"2015-09-20T11:59:30Z","closed_at":null,"body":"I just encountered the reason why my further test programs didn't show correct display outputs:\r\nit happened when a SD card was plugged to the SPI bus additionally.\r\n\r\nthis is the SD init function:\r\n~~~\r\n\r\n\r\nint16_t initSD() {\r\n   char sbuf[128];\r\n   uint32_t  tstamp;\r\n   int16_t   ior=0;\r\n  \r\n   tstamp = clock();\r\n   ior=SD.begin(sd_cs);  // true on sucess; else false\r\n   while( !ior) {      \r\n      sprintf(sbuf, \"#: ...SD not found... \");  \r\n      curlf(); lcdprint(\"#: ...SD not found... \"); \r\n      Serial.println(sbuf);\r\n      delay(1000);   \r\n      ior=SD.begin(sd_cs);\r\n      if (clock()-tstamp>20000) {Serial.println(\"#: ...break!\"); break; }\r\n   } \r\n  if(!ior) return -16;     // SD ioresult==0 => error = -16 \r\n  return 1 ;                     // SD ioresult==1 => ok = 1\r\n} \r\n\r\n~~~\r\nthis is the call in setup():\r\n\r\n~~~\r\n// SD card\r\n   sprintf(sbuf, \"SD init... \");   Serial.println(sbuf);\r\n   i = initSD();\r\n   if(i==-16) sprintf(sbuf, \"SD failed! ERROR ! \");  \r\n   else sprintf(sbuf, \"SD OK ! \");   \r\n   Serial.println(sbuf);   \r\n   curlf(); \r\n   lcdprint(sbuf);\r\n~~~\r\n\r\nlcdprint() is a macro which is basically\r\n{ dtft.cursorToXY(x,y);    dtft.printAt(str, x, y); }\r\n\r\nit works fine with Adafruit ILI9340, but with ILI9341_due the program blocks then.\r\n(not only lcd print is blocked, but also Serial hangs up and the program stops running prematurely).\r\n\r\nInstead if I outcomment the SD init line\r\n// i = initSD();\r\n\r\nthen again the display works also fine with ILI9341_due.\r\n\r\nWhat do I have to change to make the SPI bus work with both the ILI9341_due and the SD ?"},"comment":{"url":"https://api.github.com/repos/marekburiak/ILI9341_due/issues/comments/141781555","html_url":"https://github.com/marekburiak/ILI9341_due/issues/4#issuecomment-141781555","issue_url":"https://api.github.com/repos/marekburiak/ILI9341_due/issues/4","id":141781555,"user":{"login":"VogonJeltz","id":11213519,"avatar_url":"https://avatars.githubusercontent.com/u/11213519?v=3","gravatar_id":"","url":"https://api.github.com/users/VogonJeltz","html_url":"https://github.com/VogonJeltz","followers_url":"https://api.github.com/users/VogonJeltz/followers","following_url":"https://api.github.com/users/VogonJeltz/following{/other_user}","gists_url":"https://api.github.com/users/VogonJeltz/gists{/gist_id}","starred_url":"https://api.github.com/users/VogonJeltz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VogonJeltz/subscriptions","organizations_url":"https://api.github.com/users/VogonJeltz/orgs","repos_url":"https://api.github.com/users/VogonJeltz/repos","events_url":"https://api.github.com/users/VogonJeltz/events{/privacy}","received_events_url":"https://api.github.com/users/VogonJeltz/received_events","type":"User","site_admin":false},"created_at":"2015-09-20T11:59:30Z","updated_at":"2015-09-20T11:59:30Z","body":"if uncommented: SD seems to work but then display text blocks instead."}}