2008-01-21 10:52:50 touchscreen for SHARP LQ043 on a BF561 custom board
Bill Fassler (UNITED STATES)
Message: 49886 I am trying to incorporate and test this driver, however I am not sure which driver to use.
The hardware folks tell me that the touchscreen came bundled with the LCD and are a "package", yet I see no relevant information regarding touchscreen in my LCD LQ043 datasheet.
From what I remember seeing on the forum folks already have touchscreen working with the LQ043 with uClinux on Blackfin yet I see no software driver for a SHARP touchscreen. Which driver should I be using?
I currently see these options in my menuconfig:
--- Touchscreens
< > Gunze AHL-51S touchscreen (NEW)
< > Elo serial touchscreens(NEW)
< > MicroTouch serial touchscreens(NEW)
< > ICS MicroClock MK712 touchscreen(NEW)
< > Penmount serial touchscreen(NEW)
< > Touchright serial touchscreen(NEW)
< > Touchwin serial touchscreen(NEW)
< > Philips UCB1400 touchscreen(NEW)
< > USB Touchscreen Driver (NEW)
Can someone enlighten me at all?
Bill
QuoteReplyEditDelete
2008-01-21 11:14:06 Re: touchscreen for SHARP LQ043 on a BF561 custom board
Bill Fassler (UNITED STATES)
Message: 49888 Although I am not using BF548 I configured the distribution for this board using the LQ043 LCD TFT just to see what driver was used there and I see "AD7877" but am still confused. Will this driver work for me?
If so I obviously do not have SPI_MASTER defined because I am not seeing this driver as an option.
Bill
QuoteReplyEditDelete
2008-01-21 12:13:07 Re: touchscreen for SHARP LQ043 on a BF561 custom board
Michael Hennerich (GERMANY)
Message: 49889 What comes with the LCD is just a two pieces of laminated glass, with some conductors. Every touch screen needs a touch screen digitizer (multichannel ADC with some internal switches and reference voltage).
You need SPI_MASTER and the AD7877 touch screen digitizer driver.
-Michael
QuoteReplyEditDelete
2008-01-21 12:47:07 Re: touchscreen for SHARP LQ043 on a BF561 custom board
Bill Fassler (UNITED STATES)
Message: 49890 Thank you Michael. I appreciate the confirmation of what I seemed to have deduced. Building the code was no problem, now I need to compare the BF548-EZKIT schematics to our custom board and make sure the connections are correct and test it all.
I also see now that it is referred to as "touchpanel" in the data sheet. While I was searching for "touchscreen". As trivial a mistake as that seems I think it is a good example of how the linguistic/terminology differences between what hardware people tend to use vs what software people tend to use can be confusing at times......
Bill
QuoteReplyEditDelete
2008-01-21 17:10:58 Re: touchscreen for SHARP LQ043 on a BF561 custom board
Bill Fassler (UNITED STATES)
Message: 49896 Mike H. -
I see in my new image that SPI is apparently initialized (based on the standard output I see), but I didn't notice any touchscreen specific output and am uncertain how to verify that it is built (I did not build it as a module).
I did try it with nano-x/microwindows to no avail, but that is probably because I need to do some tweaks there since I have yet to even get nano-x to work with a mouse or keyboard because I lack proper USB hardware/software (at least on these new custom boards)
Is there any other method I could use to confirm that the hardware and software for the touchscreen works?
Bill
QuoteReplyEditDelete
2008-01-21 17:14:39 Re: touchscreen for SHARP LQ043 on a BF561 custom board
Bill Fassler (UNITED STATES)
Message: 49897 PS - I also tried "event_test /dev/input/event0" and I get that there is no such device, so something is astray....
Bill
QuoteReplyEditDelete
2008-01-21 17:37:54 Re: touchscreen for SHARP LQ043 on a BF561 custom board
Mike Frysinger (UNITED STATES)
Message: 49898 like any other platform driver, you need to make sure you have the platform resources declared for the ad7877
QuoteReplyEditDelete
2008-01-22 16:21:23 Re: touchscreen for SHARP LQ043 on a BF561 custom board
Bill Fassler (UNITED STATES)
Message: 49963 I implemented the platform resources using the BF548 declarations, changing basically only the interrupt. When I boot the board up now I see this (excerpt only):
.
.
.
bfin-spi bfin-spi.0: Blackfin BF5xx on-chip SPI Contoller Driver, Version 1.0, r
egs_base@ffc00500, dma channel@16
sl811: driver sl811-hcd, 19 May 2005
mice: PS/2 mouse device common for all mice
spi0.2: Failed to probe AD7877 Touchscreen
.
.
.
I see no resource indication of an address for the 7877 so I immediately thought something might be wrong with my SPI (This is the only driver that uses SPI so it has not been tested elsewhere)
So, I build in the SPI_TEST and tried to run it and get this:
root:/bin> spi_test
NULL pointer access (probably)
Deferred excecption or HW Error context
CURRENT PROCESS:
COMM=spi_test PID=131
TEXT = 0x06cfc000-0x06cfcf7c DATA = 0x035b4f7c-0x035b519c
BSS = 0x035b519c-0x016c0000 USER-STACK = 0x016dfec0
return address: [0x002df35c]; contents of:
0x002df330: 300a 2005 3211 9950 0c00 1837 6409 6018
0x002df340: 5401 0c00 17f8 e147 fefe e143 8080 3211
0x002df350: e107 feff e103 8080 09ca 101d [9010] 5038
0x002df360: 5418 0c00 1c16 e590 fffc 304a 0c00 67e1
SEQUENCER STATUS:
SEQSTAT: 00000027 IPEND: 0030 SYSCFG: 0006
HWERRCAUSE: 0x0
EXCAUSE : 0x27
RETE: <0x00000000> /* Maybe null pointer? */
RETN: <0x016a4000> /* unknown address */
RETX: <0x002df35c> [ /lib/libuClibc-0.9.29.so + 0x1f35c ]
RETS: <0x06cfcbf4> [ /bin/spi_test + 0xbf4 ]
PC : <0x002df35c> [ /lib/libuClibc-0.9.29.so + 0x1f35c ]
DCPLB_FAULT_ADDR: <0x00000000> /* Maybe null pointer? */
ICPLB_FAULT_ADDR: <0x002df35c> [ /lib/libuClibc-0.9.29.so + 0x1f35c ]
PROCESSOR STATE:
R0 : 00000000 R1 : 00000000 R2 : 00000000 R3 : 80808080
R4 : 06cfce54 R5 : 035b50f8 R6 : 00000000 R7 : fefefeff
P0 : 016a8b6c P1 : 00000001 P2 : 00000000 P3 : 016a9118
P4 : 016a8798 P5 : 016dfec4 FP : 016dfe30 SP : 016a3f24
LB0: 0029dda1 LT0: 0029dd94 LC0: 00000000
LB1: 0029cbfd LT1: 0029cbfc LC1: 00000000
B0 : 00000000 L0 : 00000000 M0 : 00000000 I0 : 016dffe3
B1 : 00000000 L1 : 00000000 M1 : 00000000 I1 : 016a9118
B2 : 00000000 L2 : 00000000 M2 : 00000000 I2 : 00000000
B3 : 00000000 L3 : 00000000 M3 : 00000000 I3 : 00000000
A0.w: 00000000 A0.x: 00000000 A1.w: 00000000 A1.x: 00000000
USP : 016dfe30 ASTAT: 02003025
Hardware Trace:
0 Target : <0x001035c0> { _trap_c + 0x0 }
Source : <0xffa00a8c> { _exception_to_level5 + 0xb4 }
1 Target : <0xffa009d8> { _exception_to_level5 + 0x0 }
Source : <0xffa00930> { _ex_trap_c + 0x5c }
2 Target : <0xffa008d4> { _ex_trap_c + 0x0 }
Source : <0xffa00b2c> { _trap + 0x28 }
3 Target : <0xffa00b04> { _trap + 0x0 }
Source : <0x002df35a> [ /lib/libuClibc-0.9.29.so + 0x1f35a ]
4 Target : <0x002df346> [ /lib/libuClibc-0.9.29.so + 0x1f346 ]
Source : <0x002df3bc> [ /lib/libuClibc-0.9.29.so + 0x1f3bc ]
5 Target : <0x002df3ba> [ /lib/libuClibc-0.9.29.so + 0x1f3ba ]
Source : <0x002df326> [ /lib/libuClibc-0.9.29.so + 0x1f326 ]
6 Target : <0x002df316> [ /lib/libuClibc-0.9.29.so + 0x1f316 ]
Source : <0x002df30a> [ /lib/libuClibc-0.9.29.so + 0x1f30a ]
7 Target : <0x002df300> [ /lib/libuClibc-0.9.29.so + 0x1f300 ]
Source : <0x0029dd7e> { _setup_arch + 0x3ce }
8 Target : <0x0029dd6c> { _setup_arch + 0x3bc }
Source : <0x0029dc92> { _setup_arch + 0x2e2 }
9 Target : <0x0029dc86> { _setup_arch + 0x2d6 }
Source : <0x0029dc50> { _setup_arch + 0x2a0 }
10 Target : <0x0029dc3c> { _setup_arch + 0x28c }
Source : <0x0029bc92> { _do_header + 0x4e }
11 Target : <0x0029bc84> { _do_header + 0x40 }
Source : <0x0029bebc> { _huft_build + 0x28 }
12 Target : <0x0029beba> { _huft_build + 0x26 }
Source : <0x0029bc52> { _do_header + 0xe }
13 Target : <0x0029bc08> { _inflate_codes + 0x42c }
Source : <0x0029bcbc> { _do_header + 0x78 }
14 Target : <0x0029bcb8> { _do_header + 0x74 }
Source : <0x0029bbfe> { _inflate_codes + 0x422 }
15 Target : <0x0029bbf4> { _inflate_codes + 0x418 }
Source : <0x0029bc04> { _inflate_codes + 0x428 }
Stack from 016a3f04:
00000110 ffa00a90 00288784 00288784 00288780 016dfa84 00000000 002ccf38
002df35c 00000030 00000027 00000000 016a4000 002df35c 002df35c 06cfcbf4
00000000 02003025 0029cbfd 0029dda1 0029cbfc 0029dd94 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 016a9118 016dffe3 016dfe30 016dfe30 016dfec4 016a8798
Call Trace:
SIGSEGV
root:/bin>
I know you are much better than I at this so maybe you see something in that stack dump that is useful, but I don't. I am also including my customboard.c in case you can find the time to peruse it for mistakes. I know you are all busier than one-armed wall paper hangers so maybe you don't have time, but I can hope.
Meanwhile I will be probing hardware since I can only assume the problem is there now.
Bill
QuoteReplyEditDelete
2008-01-22 16:44:05 Re: touchscreen for SHARP LQ043 on a BF561 custom board
Michael Hennerich (GERMANY)
Message: 49965
Bill,
using this SPI test application is not helpful.
You need to specify the SPI chip_select - see blow ... you should
-Michael
#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
.cs_change_per_word = 0,
.enable_dma = 0,
.bits_per_word = 16,
};
static const struct ad7877_platform_data bfin_ad7877_ts_info = {
.model = 7877,
.vref_delay_usecs = 50, /* internal, no capacitor */
.x_plate_ohms = 419,
.y_plate_ohms = 486,
.pressure_max = 1000,
.pressure_min = 0,
.stopacq_polarity = 1,
.first_conversion_delay = 3,
.acquisition_time = 1,
.averaging = 1,
.pen_down_acc_interval = 1,
};
#endif
#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
{
.modalias = "ad7877",
.platform_data = &bfin_ad7877_ts_info,
.irq = IRQ_PF13,
.max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
.bus_num = 0,
.chip_select = 7,
.controller_data = &spi_ad7877_chip_info,
},
#endif
QuoteReplyEditDelete
2008-01-23 10:57:35 Re: touchscreen for SHARP LQ043 on a BF561 custom board
Bill Fassler (UNITED STATES)
Message: 50037 Mike H.
Now that I fixed my chip select things look a little better but it still doesn't work. Here is what I see when I boot up the board (excerpt):
. <blah>
. <blah>
. <blah>
bfin-spi bfin-spi.0: Blackfin BF5xx on-chip SPI Contoller Driver, Version 1.0, r
egs_base@ffc00500, dma channel@16
sl811: driver sl811-hcd, 19 May 2005
mice: PS/2 mouse device common for all mice
ad7877 spi0.7: touchscreen, irq 87
input: AD7877 Touchscreen as /class/input/input0
. <blah>
. <blah>
. <blah>
Yet, when I tried the device on microwindows/Nano-X it didn't seem to work, so I tried debugging with the event_test utility, hich I don't always have a lot of luck using on the BF561 as I state in this thread:
As you can see I don't have and event0 or event1 in my /dev or /dev/input directories, just ts0 (and mice) and that provides no feedback when I tried that and touched the screen....
root:/dev> event_test
Usage: evtest /dev/inputX
Where X = input device number
root:/dev> event_test /dev/event0
evtest: No such file or directory
root:/dev> event_test /dev/event1
evtest: No such file or directory
root:/dev> event_test /dev/input/ts0
tsdev (compaq touchscreen emulation) is scheduled for removal.
See Documentation/feature-removal-schedule.txt for details.
Input driver version is 774.54.140
Input device ID: bus 0xfea4 vendor 0x16d product 0x2 version 0x0
Input device name: "Unknown" (????????)
Supported events:
Testing ... (interrupt to exit)
I tried touching the sceen many times in here....
<INTERRUPT>
I am going to try to probe I guess, but the ad7877 chip is located under the LCD, so I'll have to try to gently move the LCD (untape it and flip it over) to even get to the chip and connections. These LCDs and there connections are so fragile I hate doing this. Is there any other ways I may troubleshoot this?
Bill
QuoteReplyEditDelete
2008-01-23 11:39:00 Re: touchscreen for SHARP LQ043 on a BF561 custom board
Michael Hennerich (GERMANY)
Message: 50041
Bill,
you need to enable the evdev ...
<*> Event interface
-Michael
QuoteReplyEditDelete
2008-01-23 12:37:49 Re: touchscreen for SHARP LQ043 on a BF561 custom board
Bill Fassler (UNITED STATES)
Message: 50048 I've always had that selected. Here is my selections in the input menu:
<*> Generic input layer (needed for keyboard, mouse,...)
< > Support for memoryless force-feedback devices
< > Polled input device
--- Userland interfaces
<*> Mouse interface
[*] Provide legacy /dev/psaux device
(480) Horizontal screen resolution
(272) Vertical screen resolution
< > Joystick interface
<*> Touchscreen interface
(480) Horizontal screen resolution
(272) Vertical screen resolution
<*> Event interface
<*> Event debugging
--- Input Device Drivers
[*] Keyboards --->
[*] Mice --->
[ ] Joysticks/Gamepads --->
[ ] Tablets --->
[*] Touchscreens--->
[ ] Miscellaneous devices --->
Hardware I/O ports --->
QuoteReplyEditDelete
2008-01-29 13:18:05 Re: touchscreen for SHARP LQ043 on a BF561 custom board
Bill Fassler (UNITED STATES)
Message: 50326 I have yet to get this working and am still debugging. I looked into the data sheet for the ad7877 and I couldn't seem to verify validate this info from this standard output from the event_test:
tsdev (compaq touchscreen emulation) is scheduled for removal.
See Documentation/feature-removal-schedule.txt for details.
Input driver version is 774.54.140
vendor 0x16d <== Is this correct for the AD7877 ?
product 0x2 <== Is this correct for the AD7877 ?
version 0x0 <== Is this correct for the AD7877 ?
Input device name: "Unknown" (????????) <== Why is this "unknown"
Supported events:
Testing ... (interrupt to exit)
Bill
QuoteReplyEditDelete
2008-01-29 15:00:29 Re: touchscreen for SHARP LQ043 on a BF561 custom board
Michael Hennerich (GERMANY)
Message: 50330
Bill,
The only valid command line is
#event_test /dev/input/eventX
You don't need the tsdev ...
-Michael
QuoteReplyEditDelete
2008-01-29 16:14:16 Re: touchscreen for SHARP LQ043 on a BF561 custom board
Bill Fassler (UNITED STATES)
Message: 50333 Michael H. - It would appear my faux pas was that I was building the event interface as a module. I am now seeing this:
It still isn't working and I am relatively sure it is a hardware connection issue, but I want to make sure this is suppose to report vendor, product and version IDs of 0x0??
root:/dev/input> ls
event0 mice ts0
root:/dev/input> event_test /dev/input/event0
Input driver version is 1.0.0
Input device ID: bus 0x0 vendor 0x0 product 0x0 version 0x0 <== This is right??
Input device name: "AD7877 Touchscreen"
Supported events:
Event type 0 (Reset)
Event code 0 (Reset)
Event code 3 (Absolute)
Event type 3 (Absolute)
Event code 0 (X)
Value 0
Min 0
Max 4095
Event code 1 (Y)
Value 0
Min 0
Max 4095
Event code 24 (Pressure)
Value 0
Min 0
Max 1000
Testing ... (interrupt to exit)
QuoteReplyEditDelete
2008-01-30 05:56:28 Re: touchscreen for SHARP LQ043 on a BF561 custom board
Michael Hennerich (GERMANY)
Message: 50346 Bill,
I added a few notes about AD7877 touchscreen testing to the wiki.
Follow the link here:
http://docs.blackfin.uclinux.org/doku.php?id=ad7877_touchscreen_input_device_driver
Regarding your question:
>Input device ID: bus 0x0 vendor 0x0 product 0x0 version 0x0 <== This is right??
Yes BUS, Vendor and product ID is left uninitialized in the driver and is therefore set to 0.
This doesn't have any influence ...
There is not much meaningful we could put there. The input device layer doesn't know BUS_SPI...
Putting random numbers for Vendor and Product ID also doesn't make any sense to me.
#define BUS_PCI 0x01
#define BUS_ISAPNP 0x02
#define BUS_USB 0x03
#define BUS_HIL 0x04
#define BUS_BLUETOOTH 0x05
#define BUS_VIRTUAL 0x06
#define BUS_ISA 0x10
#define BUS_I8042 0x11
#define BUS_XTKBD 0x12
#define BUS_RS232 0x13
#define BUS_GAMEPORT 0x14
#define BUS_PARPORT 0x15
#define BUS_AMIGA 0x16
#define BUS_ADB 0x17
#define BUS_I2C 0x18
#define BUS_HOST 0x19
#define BUS_GSC 0x1A
#define BUS_ATARI 0x1B
-Michael