Interfacing

Fbtft...

31 16300
igorpec  
Edited by igorpec at 2014-10-19 03:37



It's working

Details:
http://www.igorpecovnik.com/2014 ... n-sd-image/#display

hnsncxy  
Good Job

Great job slovenia!

Hi,
I managed to make my display work (HY28A), but the touchpanel is not.
Here is what I do, step by step :

Update and install dependent packages.
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential u-boot-tools uboot-mkimage libncurses5-dev

Update gcc to 4.7 version.
sudo apt-get install gcc-4.7 g++-4.7
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.7 40 --slave /usr/bin/g++ g++ /usr/bin/g++-4.7
sudo update-alternatives

Download kernel source from the git repository of bananapi kernel.
git clone https://github.com/LeMaker/linux-sunxi.git
cd linux-bananapi/
zcat /proc/config.gz > .config

Edit configuration files.
cd drivers
cd video
echo "obj-y += fbtft/" >> Makefile
sed -i 's/endmenu/source "drivers\/video\/fbtft\/Kconfig"\n\nendmenu/' Kconfig

Config fbtft option from kernel menu.
cd ../..
make prepare scripts

  ADS7846 device support (ADS7846_DEVICE) [N/m/y/?] (NEW) m
*
* Support for small TFT LCD display modules
*
Support for small TFT LCD display modules (FB_TFT) [N/m/y] (NEW) m
  FB driver for the BD663474 LCD Controller (FB_TFT_BD663474) [N/m/?] (NEW) m
  FB driver for the HX8340BN LCD Controller (FB_TFT_HX8340BN) [N/m/?] (NEW) m
  FB driver for the HX8347D LCD Controller (FB_TFT_HX8347D) [N/m/?] (NEW) m
  FB driver for the HX8353D LCD Controller (FB_TFT_HX8353D) [N/m/?] (NEW) m
  FB driver for the ILI9320 LCD Controller (FB_TFT_ILI9320) [N/m/?] (NEW) m
  FB driver for the ILI9325 LCD Controller (FB_TFT_ILI9325) [N/m/?] (NEW) m
  FB driver for the ILI9340 LCD Controller (FB_TFT_ILI9340) [N/m/?] (NEW) m

make menuconfig

Enable regulator and dummy regulator options or edit .config file
sudo nano .config
    CONFIG_REGULATOR=y
    CONFIG_REGULATOR_DUMMY=y

Build kernel uImage and module files.
make uImage modules

Move new kernel
sudo mv /boot/bananapi/uImage /boot/bananapi/uImage.bak
sudo cp arch/arm/boot/uImage /boot/bananapi

Install modules
sudo make modules_install

Add modules
sudo nano /etc/modules
    spi-sun7i
    fbtft dma=0
    fbtft_device name=hy28a rotate=270 speed=48000000 fps=50
    ads7846_device gpio_pendown=17 cs=1 speed=2000000 x_plate_ohms=100 pressure_max=255 verbose=3 keep_vref_on=1 model=7846

Enable spi and reboot
sudo raspi-config
sudo reboot


Touchpanel seems to load correctly :
dmesg | grep ads7846 :
[   19.133684] ads7846_device: ads7846_device_init()
[   19.145912] ads7846_device: SPI devices registered:
[   19.156437] ads7846_device:    spidev spi0.1 12000kHz 8 bits mode=0x03
[   19.168821] ads7846_device:    fb_ili9320 spi0.0 48000kHz 8 bits mode=0x03
[   19.179439] ads7846_device:
[   19.184916] ads7846_device: Settings:
[   19.191635] ads7846_device:   model = 7846
[   19.206824] ads7846_device:   gpio_pendown = 17
[   19.217633] ads7846_device:   swap_xy = 0
[   19.224535] ads7846_device:   x_min = 0
[   19.231450] ads7846_device:   x_max = 4095
[   19.239545] ads7846_device:   y_min = 0
[   19.257919] ads7846_device:   y_max = 4095
[   19.265581] ads7846_device:   x_plate_ohms = 60
[   19.276801] ads7846_device:   pressure_min = 0
[   19.284908] ads7846_device:   pressure_max = 255
[   19.292946] ads7846_device:   keep_vref_on = 1
[   19.301137] ads7846_device:   vref_delay_usecs = 0
[   19.308927] ads7846_device:   vref_mv = 0
[   19.316882] ads7846_device:   settle_delay_usecs = 0
[   19.326475] ads7846_device:   penirq_recheck_delay_usecs = 0
[   19.335547] ads7846_device:   y_plate_ohms = 0
[   19.343405] ads7846_device:   debounce_max = 0
[   19.351248] ads7846_device:   debounce_tol = 0
[   19.359104] ads7846_device:   debounce_rep = 0
[   19.366716] ads7846_device: Deleting spi0.1
[   19.375306] ads7846_device: SPI devices registered:
[   19.386852] ads7846_device:    fb_ili9320 spi0.0 48000kHz 8 bits mode=0x03
[   19.399831] ads7846_device:    ads7846 spi0.1 2000kHz 8 bits mode=0x00
[   19.409565] ads7846_device:
[   19.866439] ads7846 spi0.1: touchscreen, irq 191


lsmod :
Module                  Size  Used by
ads7846                10656  0
ads7846_device          6142  0
fb_ili9320              4657  1
fbtft_device           32017  0
fbtft                  30436  2 fb_ili9320,fbtft_device
spidev                  6145  0
spi_sun7i              17600  0
mali_drm                2616  0
drm                   207598  1 mali_drm
mali                  111806  0
ump                    50985  1 mali


Touchpanel is present in /dev/input/event4, but I see no interrupt coming to /proc/interrupts
I attached a led to the interrupt pin, and it's going from on to off when I touch the display, so I assume interrupt is working hardware wise.
I also tested the display on a Raspberry Pi, and it's working well.

What could be wrong ?

I was wrong : ads7846 interrupts register correctly to /proc/interrupts (I now see the counter incrementing).
But there is nothing more. It's like interrupts are not passed to userspace.

Any ideas ?

igorpec  
HWL_Stouf replied at Wed Nov 5, 2014 09:29
I was wrong : ads7846 interrupts register correctly to /proc/interrupts (I now see the counter incre ...

I haven't got to the touch part yet. I only have one display to test and it's not clear that touch is working. It look's like it has it but the item description is "no touch" ...

I think you should post the question here:
https://github.com/notro/fbtft/issues

I'm coming back here to see if someone has an idea... My touchpanel is still not working, despite the help provided by Lemaker and Notro (thanks to them).

I can see interrupts firing in /proc/interrupts when I touch the screen.
A /dev/input/event2 correponding to the ads7846 is also present, but I see no event coming when I cat it or check evtest.
I also attached the touchscreen to a Raspberry Pi and it's working fine.

Here are the various settings / checks :

    TFT working
    ADS7846 driver loaded correctly
    touchpanel present in /dev/input/event2
    interrupts firing in /proc/interrupts
    interrupts firing in ads7846_hard_irq But, touchpanel does nothing : /dev/input/event2 remains blank and evtest detects the ADS7846 but stays on "Testing... (interrupt to exit)".


/etc/modules
  1. spi-sun7i
  2. fbtft dma=0
  3. fbtft_device name=hy28a rotate=270 speed=48000000 fps=50
  4. ads7846_device gpio_pendown=17 cs=1 speed=2000000 x_plate_ohms=100 pressure_max=255 verbose=3 keep_vref_on=1 model=7846
Copy the Code
script.bin
  1. [spi0_para]
  2. spi_used = 1
  3. spi_cs_bitmap = 3
  4. spi_cs0 = port:PI10<2><default><default><default>
  5. spi_cs1 = port:PI14<2><default><default><default>
  6. spi_sclk = port:PI11<2><default><default><default>
  7. spi_mosi = port:PI12<2><default><default><default>
  8. spi_miso = port:PI13<2><default><default><default>

  9. [spi_devices]
  10. spi_dev_num = 2

  11. [spi_board0]
  12. modalias = "spidev"
  13. max_speed_hz = 12000000
  14. bus_num = 0
  15. chip_select = 0
  16. mode = 3
  17. full_duplex = 0
  18. manual_cs = 0

  19. [spi_board1]
  20. modalias = "spidev"
  21. max_speed_hz = 12000000
  22. bus_num = 0
  23. chip_select = 1
  24. mode = 3
  25. full_duplex = 0
  26. manual_cs = 0
Copy the Code
dmesg | grep ads7846
  1. [ 19.342947] ads7846_device: ads7846_device_init()
  2. [ 19.360928] ads7846_device: SPI devices registered:
  3. [ 19.371990] ads7846_device: spidev spi0.1 12000kHz 8 bits mode=0x03
  4. [ 19.385125] ads7846_device: fb_ili9320 spi0.0 48000kHz 8 bits mode=0x03
  5. [ 19.394371] ads7846_device:
  6. [ 19.400932] ads7846_device: Settings:
  7. [ 19.407716] ads7846_device: model = 7846
  8. [ 19.419201] ads7846_device: gpio_pendown = 17
  9. [ 19.426792] ads7846_device: swap_xy = 0
  10. [ 19.436454] ads7846_device: x_min = 0
  11. [ 19.443385] ads7846_device: x_max = 4095
  12. [ 19.450269] ads7846_device: y_min = 0
  13. [ 19.457195] ads7846_device: y_max = 4095
  14. [ 19.466043] ads7846_device: x_plate_ohms = 100
  15. [ 19.477987] ads7846_device: pressure_min = 0
  16. [ 19.486530] ads7846_device: pressure_max = 255
  17. [ 19.494600] ads7846_device: keep_vref_on = 1
  18. [ 19.502785] ads7846_device: vref_delay_usecs = 0
  19. [ 19.510547] ads7846_device: vref_mv = 0
  20. [ 19.519117] ads7846_device: settle_delay_usecs = 0
  21. [ 19.529220] ads7846_device: penirq_recheck_delay_usecs = 0
  22. [ 19.539030] ads7846_device: y_plate_ohms = 0
  23. [ 19.549762] ads7846_device: debounce_max = 0
  24. [ 19.557648] ads7846_device: debounce_tol = 0
  25. [ 19.565509] ads7846_device: debounce_rep = 0
  26. [ 19.573118] ads7846_device: Deleting spi0.1
  27. [ 19.581650] ads7846_device: SPI devices registered:
  28. [ 19.593082] ads7846_device: fb_ili9320 spi0.0 48000kHz 8 bits mode=0x03
  29. [ 19.605595] ads7846_device: ads7846 spi0.1 2000kHz 8 bits mode=0x00
  30. [ 19.614163] ads7846_device:
  31. [ 19.960197] ads7846 spi0.1: touchscreen, irq 191
Copy the Code
cat /proc/interrupts | grep ads7846
  1. 191: 239 0 gpio-sunxi ads7846
Copy the Code
modprobe
  1. Module Size Used by
  2. ads7846 11167 0
  3. ads7846_device 6858 0
  4. fb_ili9320 4754 1
  5. fbtft_device 32752 0
  6. fbtft 31904 2 fb_ili9320,fbtft_device
  7. spidev 6342 0
  8. spi_sun7i 19657 0
  9. mali_drm 2638 0
  10. drm 213190 1 mali_drm
  11. mali 113903 0
  12. ump 57103 1 mali
  13. 8192cu 453340 0
  14. evbug 1896 0
Copy the Code
Thanks !

tpol  
I have a HY28B and it works fine on the Bananian 15.01, no kernel compile is needed, everything is already there, just setup the modules in /etc/modules and that's it!

bdwk  
hi everybody,
who can tell me ,how link the wire for ili9340? thanks!

nike roshe run
damian lillard shoes
pandora jewelry
longchamp bags
ysl handbags
jordan retro 6
nmd
gucci belt
ysl bags
yeezy 700
nike zoom
michael kors handbags
roshe run
air max 2018
adidas nmd r1
adidas stan smith sneakers
curry 4
louboutin shoes
goyard bags
nike shoes for men
vapormax
jordan 4
air jordan shoes
nike air force 1
yeezy boost 700
hermes belts for men
adidas ultra
100% real jordans for cheap
nike air max
nike lebron soldier 10
adidas tubular shadow
red bottoms
zx flux
kobe shoes
caterpillar boots
http://www.kobeshoes.uk
yeezy boost 350
yeezy boost 350 v2
vans shoes
adidas shoes
michael kors outlet
lacoste online shop
supreme hoodie
ferragamo belts
nike air max 90
chrome hearts
yeezy boost 350
nike sneakers
led shoes
nike flyknit
nike lebron soldier 11
lebron 13
tory burch shoes
lacoste polo
nike outlet store online shopping
nike shoes
michael kors handbags
bape hoodie
nike air zoom
asics kayno
nike flyknit
longchamp handbags
yeezy boost
michael kors outlet
nike roshe one
goyard handbags
chrome hearts
adidas nmd
longchamp bags
converse shoes
yeezy boost 350
adidas yeezy
calvin klein outlet
adidas superstar shoes
kd shoes
goyard handbags
nmd
balenciaga shoes
moncler jackets
yeezy shoes
nike sneakers for men
supreme clothing
michael kors outlet store
yeezys
red bottom shoes
paul george shoes
michael kors outlet
nba jerseys
kate spade handbags
moncler jackets
tom ford eyewear
longchamp outlet
nmd
yeezy shoes
yeezy shoes
longchamp bags
adidas stan smith
nike air force
nike huarache
authentic jordans

You have to log in before you can reply Login | Sign Up

Points Rules