notro
Posts: 695
Joined: Tue Oct 16, 2012 6:21 pm
Location: Drammen, Norway

Re: 320x240 LCD with integrated SSD1289 controller

Sat Jan 04, 2014 8:00 pm

alberthrocks wrote:notro, is the information on your wiki up to date regarding the FPS for Sainsmart 3.2"/SSD1289? Were there any advancements in trying to raise the frequency (and therefore, the FPS)?
I tried to use DMA mode with the SPI interface circuit.
It didn't work. The colors where all wrong, because of transmission errors. The reason is probably because a display update using DMA triggers only ~40 interrupts, while non DMA triggers ~1400 interrupts. These interrupts pauses the transfer, giving circuit/LCD controller time to keep up. At least this is my best guess.
The fastest I got was 12fps, but I forgot to measure CPU utilization at this speed, which is probably ~100%.

Details: https://github.com/notro/fbtft/wiki/Per ... mart32_spi

alberthrocks
Posts: 5
Joined: Wed Jan 01, 2014 8:49 pm

Re: 320x240 LCD with integrated SSD1289 controller

Sat Jan 04, 2014 10:24 pm

notro wrote:I tried to use DMA mode with the SPI interface circuit.
It didn't work. The colors where all wrong, because of transmission errors. The reason is probably because a display update using DMA triggers only ~40 interrupts, while non DMA triggers ~1400 interrupts. These interrupts pauses the transfer, giving circuit/LCD controller time to keep up. At least this is my best guess.
The fastest I got was 12fps, but I forgot to measure CPU utilization at this speed, which is probably ~100%.

Details: https://github.com/notro/fbtft/wiki/Per ... mart32_spi
Interesting... since DMA doesn't seem to work at all in all of the LCDs you say that support it, I'll take a blind shot - does your kernel driver allocate the right DMA channels? I believe the kernel and certain hardware on the RPi use certain DMA channels (notably, 0, 1, 2, 3, 6, and 7), so accidentally using one of those channels will result in strange things occurring.

There's supposedly an API for allocating DMA channels, which can be used to pick an unused channel.
(See: https://github.com/raspberrypi/linux/bl ... dma.c#L152)

Of course, this is pure speculation - I haven't really looked at your DMA code at all!

notro
Posts: 695
Joined: Tue Oct 16, 2012 6:21 pm
Location: Drammen, Norway

Re: 320x240 LCD with integrated SSD1289 controller

Sun Jan 05, 2014 1:21 pm

alberthrocks wrote: does your kernel driver allocate the right DMA channels? I believe the kernel and certain hardware on the RPi use certain DMA channels (notably, 0, 1, 2, 3, 6, and 7), so accidentally using one of those channels will result in strange things occurring.

There's supposedly an API for allocating DMA channels, which can be used to pick an unused channel.
(See: https://github.com/raspberrypi/linux/bl ... dma.c#L152)
It's the SPI master driver that allocates channels, and it's using that API: https://github.com/notro/spi-bcm2708/bl ... 708.c#L272 (this is a forked spi_bcm2708 with DMA capabilities)
The DMA code in the FBTFT driver is just allocating DMA memory and passing that on to spi_sync(). Shown in this post: http://www.raspberrypi.org/phpBB3/viewt ... 65#p479765

I think the problem most likely is with my SPI interface circuit in combination with the LCD controller that can't keep up when 4k bytes come out with no gaps between.
In non-DMA mode, there are gaps between each ~110 bytes.
(The vanilla SPI master driver only sends 16 bytes per interrupt. Details: https://github.com/notro/spi-bcm2708/wiki#fifo-size)

sheinrichs
Posts: 14
Joined: Tue Aug 13, 2013 7:31 pm

Re: 320x240 LCD with integrated SSD1289 controller

Wed Feb 05, 2014 3:43 pm

Hi notro,

its me again.

is it posible to get it work in pidora?
my raspbian has always trouble with w-lan and i´m not so familiar with debian i´m closer to redhat.
but i don´t know how to get your kernel-modules run in pidora

regards Sascha

notro
Posts: 695
Joined: Tue Oct 16, 2012 6:21 pm
Location: Drammen, Norway

Re: 320x240 LCD with integrated SSD1289 controller

Wed Feb 05, 2014 6:33 pm

Do rpi-update work in pidora?

Code: Select all

sudo wget https://raw.github.com/Hexxeh/rpi-update/master/rpi-update -O /usr/bin/rpi-update && sudo chmod +x /usr/bin/rpi-update
sudo REPO_URI=https://github.com/notro/rpi-firmware rpi-update

sheinrichs
Posts: 14
Joined: Tue Aug 13, 2013 7:31 pm

Re: 320x240 LCD with integrated SSD1289 controller

Fri Feb 07, 2014 4:40 pm

hi notro

rpi-update works

modprobe fbtft_device name=sainsmart32_spi rotate=3 works too

only the permanent loading on boot don't work systemd can't find the module
[[email protected] modules]$ sudo /usr/lib/systemd/systemd-modules-load
[sudo] password for pi:
Failed to find module 'fbtft_device name=sainsmart32_spi rotate=3'

where is the module that systemd can't find it

regards Sascha

notro
Posts: 695
Joined: Tue Oct 16, 2012 6:21 pm
Location: Drammen, Norway

Re: 320x240 LCD with integrated SSD1289 controller

Fri Feb 07, 2014 5:22 pm

You probably have to set the options like in Arch Linux: https://github.com/notro/fbtft/wiki#wik ... arch-linux

nejemia
Posts: 10
Joined: Mon Apr 29, 2013 12:53 pm

Re: 320x240 LCD with integrated SSD1289 controller

Sun Feb 09, 2014 6:22 pm

Dear Notro:
A challenge to your memory ! Do you remember if the itdb28 (par 8 bits) supports Rotation for the Xserver ? xrandr does not work and adding parameter rotate= 1 also does not work. It runs nice but only in portrait mode, I need it working in Landscape and have no idea how to do that.
I tryed aldo the
Any help will be very appreciated. All the best ! Neslon/

notro
Posts: 695
Joined: Tue Oct 16, 2012 6:21 pm
Location: Drammen, Norway

Re: 320x240 LCD with integrated SSD1289 controller

Sun Feb 09, 2014 7:34 pm

Most of the drivers support rotation, included the fb_ili9325 which itdb28 uses.
modprobe fbtft_device name=itdb28 rotate={0,90,180,270}

nejemia
Posts: 10
Joined: Mon Apr 29, 2013 12:53 pm

Re: 320x240 LCD with integrated SSD1289 controller

Sun Feb 09, 2014 10:21 pm

Dear NOTRO: just run some tests but unfortunatelly can't manage to rotate the X11 screen... Well, I am doing something wrong, the problem is I dont know what. This is my modules script
snd-bcm2835
fbtft_device name=itdb28fb rotate=0 gpios=reset:17,dc:3,wr:2,cs:27,db00:9,db01:11,db02:18,db03:23,db04:24,db05:25,db06:8,db07:7,led:4
itdb28fb
It work nice inportrait, but can not make it work in landscape even changing "rotate" to 90, or other values...
Will not spend too much time with this, if you have an idea where to look for will be very welcome, otherwise, will try a different Display.
Cheers. nelson.

neodd70
Posts: 2
Joined: Mon Feb 10, 2014 3:02 am

Re: 320x240 LCD with integrated SSD1289 controller

Mon Feb 10, 2014 3:18 am

I have a question for whoever can answer. I have connected all the hardware and now I'm trying to copy over the files to replace the existing files (I have no experience in linux nor in doing the patches the hard way (compiling on my own). I have copied most of the files overwriting the existing files and folders up to the folders and files in the "firmware" folder. None of the folder names match what is in the "firmware" folder on my SD card for the RasPi. I have Raspian as my OS and the folders on my SD card are "ar3k", "brcm", "libertas", "mwl8k", "RTL8192E", "RTL8192SU", "rtl_nic" and RTLwifi" and I have non of the files in the "firmware" folder on my SD card that are in the "firmware" folder that I download from Valdodov. Am I just supposed to move those folders and files over or should I be running a different OS, one that would have those folders and files? Any help would be appreciated. BTW I just installed Raspian from the NOOBS download 2 days ago so I'm not sure if it is a newer version than what these replacement files where made for.

notro
Posts: 695
Joined: Tue Oct 16, 2012 6:21 pm
Location: Drammen, Norway

Re: 320x240 LCD with integrated SSD1289 controller

Mon Feb 10, 2014 3:13 pm

nejemia wrote: fbtft_device name=itdb28fb rotate=0 gpios=reset:17,dc:3,wr:2,cs:27,db00:9,db01:11,db02:18,db03:23,db04:24,db05:25,db06:8,db07:7,led:4
itdb28fb
The rotate parameter has undergone some changes in the past:
6 months ago rotate supported the following values: 0,1,2,3: modprobe fbtft_device rotate={0,1,2,3}
Some time before that, rotate was a driver parameter: modprobe itdb28fb rotate={0,1,2,3}

nejemia
Posts: 10
Joined: Mon Apr 29, 2013 12:53 pm

Re: 320x240 LCD with integrated SSD1289 controller

Mon Feb 10, 2014 3:47 pm

Bingo ! - My version worked fine with the parameter rotate=1 passed to the driver. modprobe itdb28fb rotate=1 did it. Thanks a million genius !

neodd70
Posts: 2
Joined: Mon Feb 10, 2014 3:02 am

Re: 320x240 LCD with integrated SSD1289 controller

Mon Feb 10, 2014 10:42 pm

Has anyone else run into this problem. When I plug in the Pi the LCD turns on, goes white, and scrolls text as it does the boot but then instead of loading into the GUI it just gives me a blank screen with a fast flashing cursor in the upper left corner. The OS was working fine before I ran the raspberry-pi fix from valdodov that replaces all the necessary files for the LCD to work. Could the fix have corrupted any of the files needed for the OS?

montesnublados
Posts: 1
Joined: Sun Sep 14, 2014 11:40 pm

Re: 320x240 LCD with integrated SSD1289 controller

Sun Sep 14, 2014 11:55 pm

Hi guys!
I've been following this thread (although i think it has gone cold some time from now...hope iam wrong!). I have got a 2.4 TFT 240*320 but the person who sold it to me hadn't the slightest idea about specs, datsheet, lcd driver or anything... there is no useful data in the backside of it. It is a 40 pin breakout and it says (in the front below the screen) 2.4'TFT 240*320 V1.3. It looks very similar to this one.

The question is...how can I be %100 sure which driver it has?

From what I've researched I've cut it down to two possibilities: S6D1121 or ILI9325

I've seen that the ILI9325 is compatible with Notros's library....but I am not sure about S6D1121.

Has anyone has this problem before?

I already thought about disassembling the TFT screen to see if there's an IC I can identify...but I don't want to end up destroying it.


Thanks!

guzunty
Posts: 276
Joined: Mon Jan 14, 2013 10:13 am

Re: 320x240 LCD with integrated SSD1289 controller

Mon Sep 15, 2014 7:53 am

Yeah, disassembly is *definitely* the last resort.

My reading of the google hits is that the v1.3 board has the ILI9325 controller, which as you say is supported by the fbtft library.

So try that first. If you need to go on to try the S6D1121, things get a little trickier, but not impossible. If you google 's6d1121 arduino' you will see a hit for an arduino driver. My recommendation would be to get or borrow an arduino to try it out first. Once you have confirmed that the initialisation code works, you can port it to the fbtft library by using the flexible version of the driver. It takes an argument allowing you to specify the sequence of bytes to write to initialise the screen.

good luck! and please let us know how you get on.
Guzunty: A fully programmable peripheral you build yourself! https://github.com/Guzunty/Pi/wiki

razael
Posts: 1
Joined: Mon Feb 09, 2015 9:48 pm

Re: 320x240 LCD with integrated SSD1289 controller

Mon Feb 09, 2015 9:57 pm

Hi NOTRO,

I have a problem with display HY32D. It is with ssd1289 driver so i tought it wont be a problem to drive it with your guide.

I downloaded your kernel , put it on sd card.
Then i booted the Raspi and everythink was good so far.
Then i tryed to enable your driver with this configuration

sudo modprobe fbtft_device name=sainsmart32 gpios=reset:16,dc:26,wr:20,cs:21,db00:2,db01:3,db02:4,db03:14,db04:15,db05:17,db06:18,db07:27,db08:22,db09:23,db10:24,db11:25,db12:5,db13:6,db14:12,db15:13

dmesg shows

[ 118.132372] fbtft_device: SPI devices registered:
[ 118.132420] fbtft_device: spidev spi0.0 500kHz 8 bits mode=0x00
[ 118.132439] fbtft_device: spidev spi0.1 500kHz 8 bits mode=0x00
[ 118.132453] fbtft_device: 'fb' Platform devices registered:
[ 118.132484] fbtft_device: bcm2708_fb id=-1 pdata? no
[ 118.132566] argument 'rotate' should be an angle. Values 1-3 is deprecated. Setting it to 270.
[ 118.135972] fbtft_device: GPIOS used by 'sainsmart32':
[ 118.136013] fbtft_device: 'reset' = GPIO16
[ 118.136027] fbtft_device: 'dc' = GPIO26
[ 118.136038] fbtft_device: 'wr' = GPIO20
[ 118.136049] fbtft_device: 'cs' = GPIO21
[ 118.136059] fbtft_device: 'db00' = GPIO2
[ 118.136069] fbtft_device: 'db01' = GPIO3
[ 118.136082] fbtft_device: 'db02' = GPIO4
[ 118.136093] fbtft_device: 'db03' = GPIO14
[ 118.136104] fbtft_device: 'db04' = GPIO15
[ 118.136114] fbtft_device: 'db05' = GPIO17
[ 118.136125] fbtft_device: 'db06' = GPIO18
[ 118.136136] fbtft_device: 'db07' = GPIO27
[ 118.136146] fbtft_device: 'db08' = GPIO22
[ 118.136157] fbtft_device: 'db09' = GPIO23
[ 118.136167] fbtft_device: 'db10' = GPIO24
[ 118.136178] fbtft_device: 'db11' = GPIO25
[ 118.136188] fbtft_device: 'db12' = GPIO5
[ 118.136198] fbtft_device: 'db13' = GPIO6
[ 118.136211] fbtft_device: 'db14' = GPIO12
[ 118.136222] fbtft_device: 'db15' = GPIO13
[ 118.136233] fbtft_device: 'fb' Platform devices registered:
[ 118.136264] fbtft_device: bcm2708_fb id=-1 pdata? no
[ 118.136348] fbtft_device: fb_ssd1289 id=0 pdata? yes
[ 118.349714] graphics fb1: fb_ssd1289 frame buffer, 320x240, 150 KiB video memory, 4 KiB DMA buffer memory, fps=20

Then i type

FRAMEBUFFER=/dev/fb1 startx

and nothink happens the display was still white and in terminal comes this massage

[email protected] ~ $ FRAMEBUFFER=/dev/fb1 startx


X.Org X Server 1.12.4
Release Date: 2012-08-27
X Protocol Version 11, Revision 0
Build Operating System: Linux 3.2.0-2-mx5 armv7l Debian
Current Operating System: Linux raspberrypi 3.18.5+ #1 PREEMPT Fri Feb 6 23:35:59 CET 2015 armv6l
Kernel command line: dma.dmachans=0x7f35 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm2708.boardrev=0x10 bcm2708.serial=0x92817f72 smsc95xx.macaddr=B8:27:EB:81:7F:72 bcm2708_fb.fbswap=1 bcm2708.disk_led_gpio=47 bcm2708.disk_led_active_low=0 sdhci-bcm2708.emmc_clock_freq=250000000 vc_mem.mem_base=0x1ec00000 vc_mem.mem_size=0x20000000 dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
Build Date: 18 December 2013 05:20:52PM
xorg-server 2:1.12.4-6+deb7u2 (Julien Cristau <[email protected]>)
Current version of pixman: 0.29.3
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Mon Feb 9 21:54:18 2015
(==) Using config directory: "/etc/X11/xorg.conf.d"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
FATAL: Module g2d_23 not found.


Where is the problem what i dont do right?

P.S. i using raspberry Pi B+ v1.2 which is with 40 pin header so i can drive the display in direct mode


Thank you!

Best regards!

Respectech
Posts: 53
Joined: Sat Sep 29, 2012 12:27 am

Re: 320x240 LCD with integrated SSD1289 controller

Tue May 05, 2015 12:44 am

If you want to pick up a screen that's already preconfigured, I picked up one at http://ameridroid.com/products/odroid-w ... -kit-as-is for less than $40 US including 8GB MicroSD and USB power cable. Works great!

biley
Posts: 1
Joined: Wed Dec 02, 2015 11:34 am

Re: 320x240 LCD with integrated SSD1289 controller

Wed Dec 02, 2015 11:43 am

Hi drsb
I'm happy to know that you have managed with connections, but could you please share schematics how have you connected the display to Raspberry.
Thank you!

User avatar
marciokoko
Posts: 295
Joined: Sat Aug 27, 2016 4:33 pm

Re: 320x240 LCD with integrated SSD1289 controller

Sun May 28, 2017 12:15 am

Hi guys

I know this is old but I'm trying to connect a RPi to a 3.2" tft touch display with sd1289 labeled 320qvt.

Dis any of you draw up a tutorial or post with the necessary steps for this process?

Return to “Other projects”