Touch Screens (ADS7843/XPT2046 etc)

ahull
Tue Jun 02, 2015 9:13 pm
We have several working TFT and OLED screen libraries ported so output is more or less covered, the next thing I suspect we need is input, and with serial more or less put to bed, that leaves, amongst other things… touch screens.

Since we have had some success porting the Adafruit TFT and GFX libraries to my mind the Adafruit Touch library looks like a pretty reasonable target for our porting efforts.

If I get a chance in the next couple of days I will take a look at this, my initial wildly enthusiastic “try it and see, but don’t bother reading the instructions” method crashed and burned with a bunch of interesting errors, :D so I suspect a little more digging is required.
/home/ahull/PersonalApps/Arduino.cc/beta/arduino-nightly/hardware/Arduino_STM32/STM32F1/variants/generic_stm32f103c/variant.h:4:38: error: 'PIN_MAP' was not declared in this scope
#define digitalPinToPort(P) ( PIN_MAP[P].gpio_device )
^
/home/ahull/Arduino/libraries/TouchScreen/TouchScreen.cpp:57:21: note: in expansion of macro 'digitalPinToPort'
uint8_t xp_port = digitalPinToPort(_xp);
^
/home/ahull/PersonalApps/Arduino.cc/beta/arduino-nightly/hardware/Arduino_STM32/STM32F1/variants/generic_stm32f103c/variant.h:5:61: error: 'BIT' was not declared in this scope
#define digitalPinToBitMask(P) ( BIT(PIN_MAP[P].gpio_bit) )
^
/home/ahull/Arduino/libraries/TouchScreen/TouchScreen.cpp:62:20: note: in expansion of macro 'digitalPinToBitMask'
uint8_t xp_pin = digitalPinToBitMask(_xp);
^
/home/ahull/Arduino/libraries/TouchScreen/TouchScreen.cpp:70:16: error: 'INPUT' was not declared in this scope
pinMode(_yp, INPUT);
^
/home/ahull/Arduino/libraries/TouchScreen/TouchScreen.cpp:70:21: error: 'pinMode' was not declared in this scope
pinMode(_yp, INPUT);
^
In file included from /home/ahull/PersonalApps/Arduino.cc/beta/arduino-nightly/hardware/Arduino_STM32/STM32F1/variants/generic_stm32f103c/pins_arduino.h:6:0,
from /home/ahull/Arduino/libraries/TouchScreen/TouchScreen.cpp:6:
/home/ahull/PersonalApps/Arduino.cc/beta/arduino-nightly/hardware/Arduino_STM32/STM32F1/variants/generic_stm32f103c/variant.h:6:44: error: base operand of '->' is not a pointer
#define portOutputRegister(port) ( &(port->regs->ODR) )
^
/home/ahull/Arduino/libraries/TouchScreen/TouchScreen.cpp:73:4: note: in expansion of macro 'portOutputRegister'
*portOutputRegister(yp_port) &= ~yp_pin;
^
/home/ahull/PersonalApps/Arduino.cc/beta/arduino-nightly/hardware/Arduino_STM32/STM32F1/variants/generic_stm32f103c/variant.h:6:44: error: base operand of '->' is not a pointer
#define portOutputRegister(port) ( &(port->regs->ODR) )
^
/home/ahull/Arduino/libraries/TouchScreen/TouchScreen.cpp:74:4: note: in expansion of macro 'portOutputRegister'
*portOutputRegister(ym_port) &= ~ym_pin;
^
/home/ahull/Arduino/libraries/TouchScreen/TouchScreen.cpp:78:16: error: 'OUTPUT' was not declared in this scope
pinMode(_xp, OUTPUT);
^
In file included from /home/ahull/PersonalApps/Arduino.cc/beta/arduino-nightly/hardware/Arduino_STM32/STM32F1/variants/generic_stm32f103c/pins_arduino.h:6:0,
from /home/ahull/Arduino/libraries/TouchScreen/TouchScreen.cpp:6:
/home/ahull/PersonalApps/Arduino.cc/beta/arduino-nightly/hardware/Arduino_STM32/STM32F1/variants/generic_stm32f103c/variant.h:6:44: error: base operand of '->' is not a pointer
#define portOutputRegister(port) ( &(port->regs->ODR) )
^
/home/ahull/Arduino/libraries/TouchScreen/TouchScreen.cpp:82:4: note: in expansion of macro 'portOutputRegister'
*portOutputRegister(xp_port) |= xp_pin;
^
/home/ahull/PersonalApps/Arduino.cc/beta/arduino-nightly/hardware/Arduino_STM32/STM32F1/variants/generic_stm32f103c/variant.h:6:44: error: base operand of '->' is not a pointer
#define portOutputRegister(port) ( &(port->regs->ODR) )
^
/home/ahull/Arduino/libraries/TouchScreen/TouchScreen.cpp:83:4: note: in expansion of macro 'portOutputRegister'
*portOutputRegister(xm_port) &= ~xm_pin;
^
/home/ahull/Arduino/libraries/TouchScreen/TouchScreen.cpp:86:33: error: 'analogRead' was not declared in this scope
samples[i] = analogRead(_yp);
^
In file included from /home/ahull/PersonalApps/Arduino.cc/beta/arduino-nightly/hardware/Arduino_STM32/STM32F1/variants/generic_stm32f103c/pins_arduino.h:6:0,
from /home/ahull/Arduino/libraries/TouchScreen/TouchScreen.cpp:6:
/home/ahull/PersonalApps/Arduino.cc/beta/arduino-nightly/hardware/Arduino_STM32/STM32F1/variants/generic_stm32f103c/variant.h:6:44: error: base operand of '->' is not a pointer
#define portOutputRegister(port) ( &(port->regs->ODR) )
^
/home/ahull/Arduino/libraries/TouchScreen/TouchScreen.cpp:98:5: note: in expansion of macro 'portOutputRegister'
*portOutputRegister(xp_port) &= ~xp_pin;
^
/home/ahull/PersonalApps/Arduino.cc/beta/arduino-nightly/hardware/Arduino_STM32/STM32F1/variants/generic_stm32f103c/variant.h:6:44: error: base operand of '->' is not a pointer
#define portOutputRegister(port) ( &(port->regs->ODR) )
^
/home/ahull/Arduino/libraries/TouchScreen/TouchScreen.cpp:102:5: note: in expansion of macro 'portOutputRegister'
*portOutputRegister(yp_port) |= yp_pin;
^
/home/ahull/Arduino/libraries/TouchScreen/TouchScreen.cpp:107:33: error: 'analogRead' was not declared in this scope
samples[i] = analogRead(_xm);
^
In file included from /home/ahull/PersonalApps/Arduino.cc/beta/arduino-nightly/hardware/Arduino_STM32/STM32F1/variants/generic_stm32f103c/pins_arduino.h:6:0,
from /home/ahull/Arduino/libraries/TouchScreen/TouchScreen.cpp:6:
/home/ahull/PersonalApps/Arduino.cc/beta/arduino-nightly/hardware/Arduino_STM32/STM32F1/variants/generic_stm32f103c/variant.h:6:44: error: base operand of '->' is not a pointer
#define portOutputRegister(port) ( &(port->regs->ODR) )
^
/home/ahull/Arduino/libraries/TouchScreen/TouchScreen.cpp:121:5: note: in expansion of macro 'portOutputRegister'
*portOutputRegister(xp_port) &= ~xp_pin;
^
/home/ahull/PersonalApps/Arduino.cc/beta/arduino-nightly/hardware/Arduino_STM32/STM32F1/variants/generic_stm32f103c/variant.h:6:44: error: base operand of '->' is not a pointer
#define portOutputRegister(port) ( &(port->regs->ODR) )
^
/home/ahull/Arduino/libraries/TouchScreen/TouchScreen.cpp:125:5: note: in expansion of macro 'portOutputRegister'
*portOutputRegister(ym_port) |= ym_pin;
^
/home/ahull/PersonalApps/Arduino.cc/beta/arduino-nightly/hardware/Arduino_STM32/STM32F1/variants/generic_stm32f103c/variant.h:6:44: error: base operand of '->' is not a pointer
#define portOutputRegister(port) ( &(port->regs->ODR) )
^
/home/ahull/Arduino/libraries/TouchScreen/TouchScreen.cpp:129:5: note: in expansion of macro 'portOutputRegister'
*portOutputRegister(yp_port) &= ~yp_pin;
^
/home/ahull/Arduino/libraries/TouchScreen/TouchScreen.cpp:133:27: error: 'analogRead' was not declared in this scope
int z1 = analogRead(_xm);
^
/home/ahull/Arduino/libraries/TouchScreen/TouchScreen.cpp: In member function 'int TouchScreen::readTouchX()':
/home/ahull/Arduino/libraries/TouchScreen/TouchScreen.cpp:180:17: error: 'INPUT' was not declared in this scope
pinMode(_yp, INPUT);
^
/home/ahull/Arduino/libraries/TouchScreen/TouchScreen.cpp:180:22: error: 'pinMode' was not declared in this scope
pinMode(_yp, INPUT);
^
/home/ahull/Arduino/libraries/TouchScreen/TouchScreen.cpp:182:22: error: 'LOW' was not declared in this scope
digitalWrite(_yp, LOW);
^
/home/ahull/Arduino/libraries/TouchScreen/TouchScreen.cpp:182:25: error: 'digitalWrite' was not declared in this scope
digitalWrite(_yp, LOW);
^
/home/ahull/Arduino/libraries/TouchScreen/TouchScreen.cpp:185:17: error: 'OUTPUT' was not declared in this scope
pinMode(_xp, OUTPUT);
^
/home/ahull/Arduino/libraries/TouchScreen/TouchScreen.cpp:186:22: error: 'HIGH' was not declared in this scope
digitalWrite(_xp, HIGH);
^
/home/ahull/Arduino/libraries/TouchScreen/TouchScreen.cpp:190:31: error: 'analogRead' was not declared in this scope
return (1023-analogRead(_yp));
^
/home/ahull/Arduino/libraries/TouchScreen/TouchScreen.cpp: In member function 'int TouchScreen::readTouchY()':
/home/ahull/Arduino/libraries/TouchScreen/TouchScreen.cpp:195:17: error: 'INPUT' was not declared in this scope
pinMode(_xp, INPUT);
^
/home/ahull/Arduino/libraries/TouchScreen/TouchScreen.cpp:195:22: error: 'pinMode' was not declared in this scope
pinMode(_xp, INPUT);
^
/home/ahull/Arduino/libraries/TouchScreen/TouchScreen.cpp:197:22: error: 'LOW' was not declared in this scope
digitalWrite(_xp, LOW);
^
/home/ahull/Arduino/libraries/TouchScreen/TouchScreen.cpp:197:25: error: 'digitalWrite' was not declared in this scope
digitalWrite(_xp, LOW);
^
/home/ahull/Arduino/libraries/TouchScreen/TouchScreen.cpp:200:17: error: 'OUTPUT' was not declared in this scope
pinMode(_yp, OUTPUT);
^
/home/ahull/Arduino/libraries/TouchScreen/TouchScreen.cpp:201:22: error: 'HIGH' was not declared in this scope
digitalWrite(_yp, HIGH);
^
/home/ahull/Arduino/libraries/TouchScreen/TouchScreen.cpp:205:31: error: 'analogRead' was not declared in this scope
return (1023-analogRead(_xm));
^
/home/ahull/Arduino/libraries/TouchScreen/TouchScreen.cpp: In member function 'uint16_t TouchScreen::pressure()':
/home/ahull/Arduino/libraries/TouchScreen/TouchScreen.cpp:211:16: error: 'OUTPUT' was not declared in this scope
pinMode(_xp, OUTPUT);
^
/home/ahull/Arduino/libraries/TouchScreen/TouchScreen.cpp:211:22: error: 'pinMode' was not declared in this scope
pinMode(_xp, OUTPUT);
^
/home/ahull/Arduino/libraries/TouchScreen/TouchScreen.cpp:212:21: error: 'LOW' was not declared in this scope
digitalWrite(_xp, LOW);
^
/home/ahull/Arduino/libraries/TouchScreen/TouchScreen.cpp:212:24: error: 'digitalWrite' was not declared in this scope
digitalWrite(_xp, LOW);
^
/home/ahull/Arduino/libraries/TouchScreen/TouchScreen.cpp:216:21: error: 'HIGH' was not declared in this scope
digitalWrite(_ym, HIGH);
^
/home/ahull/Arduino/libraries/TouchScreen/TouchScreen.cpp:220:16: error: 'INPUT' was not declared in this scope
pinMode(_xm, INPUT);
^
/home/ahull/Arduino/libraries/TouchScreen/TouchScreen.cpp:224:26: error: 'analogRead' was not declared in this scope
int z1 = analogRead(_xm);
^


madias
Tue Jun 02, 2015 9:24 pm
Andy: the good news: Hennig Karlsen’s UTOUCH runs out of the box!
http://www.rinkydinkelectronics.com/library.php?id=56
This is for all ali/ebay ILI9341 TFT’s with touch (or all modules using the xpt2046 controller chip)
The only nice thing could be translating the calibration example sketch to the adafruit one (written for UTFT)
Edit: I think I translated the adafruit touch library some months ago… with a very disappointing result (and yes, this lib doesn’t work with xpt2046 chips, so I abandoned the “project”, because I don’t use my other displays anymore)

ahull
Tue Jun 02, 2015 9:30 pm
Thanks I’ll give it a try.

madias
Tue Jun 02, 2015 9:32 pm
Ok, I found my old versions of the adafruit touchscreen libs converted to STM32, there are two ones (I don’t remember why….). Maybe this is a starting point for you.
Andy: Don’t forget: If you are using a touchpad controller, don’t waste your time with this lib! (two different technologies..)

ahull
Tue Jun 02, 2015 9:33 pm
OK That Utouch2 library compiles with no errors. Looks like a less painful path to follow. I’ll keep you posted. I might have a touchy feely scope pig update soon. :D

EDIT: I’ll look at the contents of your .zip too. Probably tomorrow before I get a chance.


madias
Tue Jun 02, 2015 9:36 pm
…and don’t forget to do the calibration first, I don’t know If you have the old UTFT_STM32 lib for ILI9341. You can also run the sketch with an arduino or chipkit, you need to write down two or three data lines shown on display. This should be only need for every individual display :)

ahull
Tue Jun 02, 2015 10:59 pm
madias wrote:…and don’t forget to do the calibration first, I don’t know If you have the old UTFT_STM32 lib for ILI9341. You can also run the sketch with an arduino or chipkit, you need to write down two or three data lines shown on display. This should be only need for every individual display :)

zoomx
Wed Jun 03, 2015 9:21 am
Question; these touch screen doesn’t have any digital communications?
Are they resistive touch screen with resistive output like the Nintendo DS ones?

madias
Wed Jun 03, 2015 2:11 pm
@zoomx: As I wrote, all of the common ILI9341 displays with touch (ali, ebay) are using the xpt2046 controller chip, so no resistive analog output, just digital.

ahull
Wed Jun 03, 2015 8:34 pm
There is always an exception to every rule, and a rule for every exception..

These…

http://www.ebay.co.uk/itm/271751780632? … EBIDX%3AIT

.. are neither ILI9341, nor digital touch screen. They look the same, or very similar but they have a different controller, 8 bit parallel interface, and a resistive touch screen multiplexed with the display control lines. I have yet to get mine working, but given enough time I intend to give it a try.


madias
Wed Jun 03, 2015 9:32 pm
@Andy: Yup, exactly for this display (ST7781 or ST7783) I rewrote the adafruit touch library, but with less success : The touch panel isn’t really stable with STM32.
BTW: Which TFT library do you use for this? May you can post it?

Thanks
Matthias


ahull
Wed Jun 03, 2015 10:22 pm
madias wrote:@Andy: Yup, exactly for this display (ST7781 or ST7783) I rewrote the adafruit touch library, but with less success : The touch panel isn’t really stable with STM32.
BTW: Which TFT library do you use for this? May you can post it?

Thanks
Matthias


madias
Wed Jun 03, 2015 10:27 pm
Puh, Andy, to protect you from double work, here is my adapted swift shield library (taken from smokeandwires). I don’t really know if it’s work correctly (I played with it about an half a year ago) and I adapted it for my nucleo FB103 board, but maybe it’s useful for you!
edit: you have to change the ‘#ifndef’s start at line 102 in SWIFT.h for your board. I tried it out on my nucleo and it works!

ahull
Wed Jun 03, 2015 10:33 pm
Thanks.. I’ll take a look… once I figure out if I just toasted my new “Yellow Peril” STM32F103RCXX board by attempting to use more RAM than even the STMF103REXX has… i.e. some time tomorrow…. hopefully.

Currently the new board is sulking downstairs attached to my dev. machine after I flashed a sketch that said “use more than 64K of ram if you dare” and I am too lazy to go down there and give it a stern talking to. I fear I may have lobotomised it :D

On the plus side, if it is toast, there is another one on its way on the slow boat from China… and at least this time nothing actually exploded, so all is not lost.


madias
Wed Jun 03, 2015 10:46 pm
andy: please read my edit in my last post.
BTW: I toasted my first mini exactly yet! :) Just the diode because of some short cuts (rule #1: Never have a ball of spare jumpers on your project desk). Fun fact: There was smoke, there was an awful smell and a fat bump on the diode, BUT: It still works!

ahull
Wed Jun 03, 2015 11:47 pm
madias wrote:andy: please read my edit in my last post.
BTW: I toasted my first mini exactly yet! :) Just the diode because of some short cuts (rule #1: Never have a ball of spare jumpers on your project desk). Fun fact: There was smoke, there was an awful smell and a fat bump on the diode, BUT: It still works!

ahull
Thu Jun 04, 2015 7:33 am
The strange behaviour of the “yellow pill R” board was resolved by power cycling. It seems my attempts to scramble its brains failed… no doubt I will scramble them again at some point, but for now… it lives…

ahull
Thu Jun 04, 2015 2:40 pm
madias wrote:Andy: the good news: Hennig Karlsen’s UTOUCH runs out of the box!
http://www.rinkydinkelectronics.com/library.php?id=56
This is for all ali/ebay ILI9341 TFT’s with touch (or all modules using the xpt2046 controller chip)
The only nice thing could be translating the calibration example sketch to the adafruit one (written for UTFT)
Edit: I think I translated the adafruit touch library some months ago… with a very disappointing result (and yes, this lib doesn’t work with xpt2046 chips, so I abandoned the “project”, because I don’t use my other displays anymore)

madias
Thu Jun 04, 2015 4:59 pm
Hm. I don’t think that this problem is pin related.
Do you own a maple mini (clone)?
Here is a link with a working bundle:
UTFT library (SPI) + touch-lib + two test sketches. I tried this out just yet, so it should working (IF the touch has no hardware failure). I see that I’ve take some backups of the touch library – maybe I changed a little thing? (I can’t really remember)
Pin definition is in the sketches (RS = DC!) and take care: it is using hardware SPI, so don’t change the SCK or SDA pins.
https://drive.google.com/file/d/0B3sgtw … sp=sharing

EDIT: Are you sure that the the TFT module is fitted with the XPT2046 chip? (Small 16 pin smd chip on the backside, “U1”)


ahull
Thu Jun 04, 2015 11:56 pm
madias wrote:Hm. I don’t think that this problem is pin related.

zoomx
Fri Jun 05, 2015 9:55 am
ahull wrote:There is always an exception to every rule, and a rule for every exception..

These…

http://www.ebay.co.uk/itm/271751780632? … EBIDX%3AIT

.. are neither ILI9341, nor digital touch screen. They look the same, or very similar but they have a different controller, 8 bit parallel interface, and a resistive touch screen multiplexed with the display control lines. I have yet to get mine working, but given enough time I intend to give it a try.


ahull
Fri Jun 05, 2015 10:05 am
Well… not sure about *wrong* screen, but certainly you bought a different screen, however is should be possible to get it to work…

Try the UTFT and UTouch drivers here http://www.rinkydinkelectronics.com/library.php?id=56 and here http://www.rinkydinkelectronics.com/library.php?id=52

I haven’t used the TFT drivers, but I might give them a go later. I am using the UTouch lib though and it works for my panel.
I used the Adafruit Libs for the display however. It would be interesting to see which library is quicker for the same display type the Adafruit ones or the UTFT ones.

I believe the UTFT libs probably support both your screen and touch panel too. The touch panel on those boards has been reported as not working by some people, but I think that is because it multiplexes the touch pins with the data pins. In other words it appears that the touch pins are not brought out on the connectors, but they are.. they are just on shared pins. This means a little more head scratching will be involved in making it work. Keep us posted if you manage.

Failing that, grab one of these… http://www.ebay.co.uk/itm/291346921118? … EBIDX%3AIT since this is what I used for the PigScope.


ahull
Fri Jun 05, 2015 10:31 pm
madias wrote:

EDIT: Are you sure that the the TFT module is fitted with the XPT2046 chip? (Small 16 pin smd chip on the backside, “U1”)

ahull
Sat Jun 06, 2015 10:17 pm
madias wrote:Hm. I don’t think that this problem is pin related.
Do you own a maple mini (clone)?
Here is a link with a working bundle:
UTFT library (SPI) + touch-lib + two test sketches. I tried this out just yet, so it should working (IF the touch has no hardware failure). I see that I’ve take some backups of the touch library – maybe I changed a little thing? (I can’t really remember)
Pin definition is in the sketches (RS = DC!) and take care: it is using hardware SPI, so don’t change the SCK or SDA pins.
https://drive.google.com/file/d/0B3sgtw … sp=sharing

EDIT: Are you sure that the the TFT module is fitted with the XPT2046 chip? (Small 16 pin smd chip on the backside, “U1”)


madias
Sun Jun 07, 2015 7:21 am
Andy: The UTFT library is nice to try out, but far behind our “DMA enabled” versions of the driver (too much memory needed, slow….) There is nothing against combining Utouch with the adafruit ones or I missed something?

ahull
Sun Jun 07, 2015 10:59 am
madias wrote:Andy: The UTFT library is nice to try out, but far behind our “DMA enabled” versions of the driver (too much memory needed, slow….) There is nothing against combining Utouch with the adafruit ones or I missed something?

zoomx
Mon Jun 15, 2015 2:05 pm
@ahull
I got the TFT but it seems it doesn’t work.
Communication is parallel and not SPI and it is a shield for Arduino UNO.
I followed the instructions here
http://misc.ws/2015/01/24/lcd-touch-screen-information/
My shield is made by KeDei http://kedei.taobao.com and there is a date 2015/01/20 but they don’t sell it anymore.
I run the identification sketch and got a id of 0x0303 but with the modified Adafruit library, that has a function for reading the ID I get a 0x343!
I made modifications for the two ID with no luck.

I will try the UTFT library but I have different pins. I have to modify the library or connect wires. Since connecting wires seems more simple I will use wires and if successful I will modify the library since I have a shield that fit on Arduino UNO.

Maybe it is faulty, I am not shure if it’s better to write to the seller. Maybe after trying the UTFT library.

ahull wrote:
Failing that, grab one of these… http://www.ebay.co.uk/itm/291346921118? … EBIDX%3AIT since this is what I used for the PigScope.


ahull
Mon Jun 15, 2015 4:03 pm
Try the UTFT and Utouch libs, you may have more joy with those and that parallel display. I have a similar one that I may have a play with soon.

zoomx
Tue Jun 16, 2015 2:36 pm
No luck, I wrote to the seller for a library and that I suspect that maybe the shield is faulty.

UTFT is a grat library but there are some strange things
The PDFs are protected so one can’t copy the relevant parts. IMHO is silly because you can unlock them easily
The very strange thing is that if I disable a driver that I use in the constructor I don’t get any error.


madias
Tue Jun 16, 2015 7:54 pm
No luck, I wrote to the seller for a library and that I suspect that maybe the shield is faulty.
zoomx: You should give my libraries/sketches a try:
I think it is exactly the display I own!
So please download this:
https://drive.google.com/file/d/0B3sgtw … sp=sharing
In this folder you will find:
1) The adapted swift-shield library by myself: Attention! You have to edit the nucleo_103rb.h file (in the swift-library folder) for changing the pins. There is no need to rename it (I didn’t made any #ifdef’s, so this file is loaded by the library anyway equal which board you use!):
Starting at line 38-41 (CS,CD,WR,RD) and(!)
starting at line 90-99 (the 8-bit port pins) [for sure this can be done faster: use a whole port-write, but I used it as shield for the nucleo, so I wasn’t able to select the pins by myself]
2) The adapted touchscreen library by myself
3) Test Sketches:
3.1.) “7781”: raw code for the display, no driver needed (was for testing, creepy slow! :) )
3.2.) “7783”: all swift library test sketches (inclusive touchscreen example)
I tested it on nucleo only, so please adapt all pins!

edit: If you find some “Serial2” in my code: This was the “old” simple “Serial” on nucleo, so just change every “Serial2” to “Serial”
regards
Matthias


zoomx
Tue Jun 16, 2015 8:46 pm
Thanks madias, I will give it a try.

madias
Tue Jun 16, 2015 9:04 pm
fun part: the example “tft-paint-nearly-working” is now working awesome! As I wrote the sketch it wasn’t really running smooth :) So there must be done some good changes in the last 2-3 months in the core. So all I can say: “touchscreen” is now working flawlessly!

zoomx
Fri Jun 26, 2015 9:00 am
I found Kedei shop on Aliexpress so I wrote to him and he was so kind to send the drivers. They works.

Maybe I will find the difference with the other drivers.


ahull
Tue Jun 30, 2015 7:34 pm
madias wrote:fun part: the example “tft-paint-nearly-working” is now working awesome! As I wrote the sketch it wasn’t really running smooth :) So there must be done some good changes in the last 2-3 months in the core. So all I can say: “touchscreen” is now working flawlessly!

madias
Tue Jun 30, 2015 8:09 pm
ahull: All the files from here viewtopic.php?f=15&t=272&start=20#p2937

Did your swift-shield library make it in to the main repo or is it separate?
No plan if the library is cross compatible at the moment, because I use the Arduino IDE only for STM32 (for the rest I use UECIDE), but I think for this version I’ve disabled the #ifdefs (shouldn’t be a problem to solve if needed)

Did you modify it to do 8 bit single port write, or does it do 8 writes to individual pins?
-> individual pins, because I need it as “Arduino shield”. Look at nucleo_f103rb.h here is all the magic done!
More or less the same game like: (You have to change a pin many times in this code, so be careful!)
gpio_write_bit(GPIOA, 9, (d) & BIT0_MSK_8BIT);\
gpio_write_bit(GPIOC, 7, (d) & BIT1_MSK_8BIT);\
gpio_write_bit(GPIOA, 10, (d) & BIT2_MSK_8BIT);\
gpio_write_bit(GPIOB, 3, (d) & BIT3_MSK_8BIT);\
gpio_write_bit(GPIOB, 5, (d) & BIT4_MSK_8BIT);\
gpio_write_bit(GPIOB, 4, (d) & BIT5_MSK_8BIT);\
gpio_write_bit(GPIOB, 10, (d) & BIT6_MSK_8BIT);\
gpio_write_bit(GPIOA, 8, (d) & BIT7_MSK_8BIT);\


ahull
Tue Jun 30, 2015 9:09 pm
Thanks for the quick reply, if I get time tomorrow, I’ll give it a try. If I get it working I’ll look at using port write rather than bit writes. Since I am using individual wires to connect the shield to my board, I can wire it up however I chose.

Leave a Reply

Your email address will not be published. Required fields are marked *