Francois

Members
  • Content Count

    2
  • Joined

  • Last visited

  1. Hello, I would like to do that but with the 2.2 inch tft from adafruit. It has the ili9340c controller instead of the The TFT driver (ST7735R). I have seen on the web that people have modify the adafruit library to make it fit for the chipkit uc32. How can I modify the adafruit ili9340 to use the chipkit uc32 instead of the Arduino Uno. On the Arduino it's working fine because Adafruit has made the library and the code to test the TFT screen but if I use the chipkit uc32 in the Arduino IDE and I'm getting error mostly because of the pins of the spi and because the memory is not the same on AVR and Microchip. int =8bits on AVR and int=16bits on a pic32. Can You help me to know how to make it fit. I tried some code here is the example to make it fit. /*************************************************** This is an example sketch for the Adafruit 2.2" SPI display. This library works with the Adafruit 2.2" TFT Breakout w/SD card ----> http://www.adafruit.com/products/1480 Check out the links above for our tutorials and wiring diagrams These displays use SPI to communicate, 4 or 5 pins are required to interface (RST is optional) Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit! Written by Limor Fried/Ladyada for Adafruit Industries. MIT license, all text above must be included in any redistribution ****************************************************/ //#include "SPI" #include "DSPI.h" // I PUT THAT #include "Adafruit_GFX.h" #include "Adafruit_ILI9340.h" // pour Arduino Due car c'est ce type de microcontrolleur sam3x8e #if defined(__SAM3X8E__) #undef __FlashStringHelper::F(string_literal) #define F(string_literal) string_literal #endif //// pour pic32 #if defined(__PIC32MX__) #ifndef _P32XXXX_H #define _P32xxxx_H #include <p32xxxx.h> #define __C32_UART __XC_UART #ifndef _P32MX340F512F_1 #define _P32MX340F512H_1 //_P32xxxx_H #include <plib.h> #ifndef _XC_H #include <xc.h> #endif /* _P32XXXX_H */ /* For backwards compatibility */ #undef __FlashStringHelper::F(string_literal) #define F(string_literal) string_literal #endif // These are the pins used for the UNO // for Due/Mega/Leonardo use the hardware SPI pins (which are different) #define _sclk 13 //connecteur spi sur Arduino Due #define _miso 12 //connecteur spi sur Arduino Due #define _mosi 11 //connecteur spi sur Arduino Due #define _cs 10 #define _dc 9 #define _rst 8 //connecteur spi sur Arduino Due // Using software SPI is really not suggested, its incredibly slow //Adafruit_ILI9340 tft = Adafruit_ILI9340(_cs, _dc, _mosi, _sclk, _rst, _miso); // Use hardware SPI Adafruit_ILI9340 tft = Adafruit_ILI9340(_cs, _dc, _rst); void setup() { Serial.begin(115200); while (!Serial); Serial.println("Adafruit 2.2\" SPI TFT Test!"); tft.begin(); Serial.println(F("Benchmark Time (microseconds)")); Serial.print(F("Screen fill ")); Serial.println(testFillScreen()); delay(500); etc.... Best Regards, Frank graphicstestChipkitUc32.ino
  2. Hello, I have a program that work on Arduino Uno. It is the graphictest given by adafruit with all their librarys for the tft 2.2" screen ili9340c https://www.adafruit.com/products/1480. I would like to make it work on the chipkit uc32 or chipkit Max32 or chipkit wf32 but don't know what line to put so the spi can work correctly on it. I tried to put this code before the arduino code but still have a lot of errors with the spi part. I just don't know how to transfer the dspi to an arduino program to make it work on the chipkit uc32. Is there somebody who can help me with this. Thank You, Best Regards, Francois *************************************************** This is an example sketch for the Adafruit 2.2" SPI display. This library works with the Adafruit 2.2" TFT Breakout w/SD card ----> http://www.adafruit.com/products/1480 Check out the links above for our tutorials and wiring diagrams These displays use SPI to communicate, 4 or 5 pins are required to interface (RST is optional) Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit! Written by Limor Fried/Ladyada for Adafruit Industries. MIT license, all text above must be included in any redistribution ****************************************************/ // #include "SPI" #include "DSPI.h" // I PUT THAT #include "Adafruit_GFX.h" #include "Adafruit_ILI9340.h" // pour Arduino Due car c'est ce type de microcontrolleur sam3x8e #if defined(__SAM3X8E__) #undef __FlashStringHelper::F(string_literal) #define F(string_literal) string_literal #endif //// pour pic32 #if defined(__PIC32MX__) #ifndef _P32XXXX_H #define _P32xxxx_H #include <p32xxxx.h> #define __C32_UART __XC_UART #ifndef _P32MX340F512F_1 #define _P32MX340F512H_1 //_P32xxxx_H #include <plib.h> #ifndef _XC_H #include <xc.h> #endif /* _P32XXXX_H */ /* For backwards compatibility */ #undef __FlashStringHelper::F(string_literal) #define F(string_literal) string_literal #endif // These are the pins used for the UNO // for Due/Mega/Leonardo use the hardware SPI pins (which are different) #define _sclk 13 //connecteur spi sur Arduino Due #define _miso 12 //connecteur spi sur Arduino Due #define _mosi 11 //connecteur spi sur Arduino Due #define _cs 10 #define _dc 9 #define _rst 8 //connecteur spi sur Arduino Due // Using software SPI is really not suggested, its incredibly slow //Adafruit_ILI9340 tft = Adafruit_ILI9340(_cs, _dc, _mosi, _sclk, _rst, _miso); // Use hardware SPI Adafruit_ILI9340 tft = Adafruit_ILI9340(_cs, _dc, _rst); void setup() { Serial.begin(115200); while (!Serial); Serial.println("Adafruit 2.2\" SPI TFT Test!"); tft.begin(); Serial.println(F("Benchmark Time (microseconds)")); Serial.print(F("Screen fill ")); Serial.println(testFillScreen()); delay(500); Serial.print(F("Text ")); Serial.println(testText()); delay(3000); Serial.print(F("Lines ")); Serial.println(testLines(ILI9340_CYAN)); delay(500);