Go to advanced search

by juj
Sun Dec 16, 2018 10:25 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: How can I connect this display to raspi?
Replies: 5
Views: 970

Re: How can I connect this display to raspi?

For some reason images are not coming through on the forum. Any details on what you got, e.g. a URL to a shop link or similar? What did you try so far?
by juj
Sun Dec 16, 2018 10:21 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: LCD /TFT display with SPI
Replies: 9
Views: 1133

Re: LCD /TFT display with SPI

Googling for "ili9341 pdf" or "ili9486 pdf" should lead to darasheets of ilitek's most commonly used SPI display controller chips. Both of them have sections in them about communicating via SPI.
by juj
Thu Dec 13, 2018 12:04 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI very high speed behavior
Replies: 2
Views: 988

Re: SPI very high speed behavior

Not quite sure about the bit shifting behavior you are seeing when reading, but to answer the spi clock speeds part of the question: the maximum spi clock speed is 200mhz when not overclocking the pi (core_freq=400 MHz is default), and it is practically possible to configure the pi to use any desire...
by juj
Wed Dec 12, 2018 11:53 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: 3.5 tft lcd very laggy low frame rate
Replies: 5
Views: 2120

Re: 3.5 tft lcd very laggy low frame rate

If you are able to identify the controller on the display, it may be possible to squeeze some more performance out of the display by using this driver: https://github.com/juj/fbcp-ili9341
by juj
Wed Jul 25, 2018 7:13 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Problem with ST7735S controller lcd display
Replies: 1
Views: 386

Re: Problem with ST7735S controller lcd display

If the only difference between ST7735S and ST7735R is the resolution (128x64 instead of 128x160), then you may be able to use fbcp-ili9341 to drive the display, by changing this line https://github.com/juj/fbcp-ili9341/blob/master/st7735r.h#L23 to do 64 instead of 160. See https://github.com/juj/fbc...
by juj
Wed Jul 25, 2018 4:43 pm
Forum: C/C++
Topic: Spi Kernel Module
Replies: 2
Views: 1816

Re: Spi Kernel Module

I experimented with building a kernel side SPI driver a while ago for https://github.com/juj/fbcp-ili9341. The test code still exists at https://github.com/juj/fbcp-ili9341/tree/master/kernel , although will not build out of the box anymore, since I abandoned the approach. Perhaps you may find it us...
by juj
Sun Jul 08, 2018 9:40 pm
Forum: Bare metal, Assembly language
Topic: Any tricks to further optimize this memory diffing code?
Replies: 4
Views: 1171

Re: Any tricks to further optimize this memory diffing code?

Thanks, good points. Unfortunately this is not for the Pi 3, but for the Zero, since I do find that I can easily reach my performance target on the Pi 3 already, but Pi Zero is proving somewhat harder. Familiarized myself with the ARMv6 manual at http://infocenter.arm.com/help/topic/com.arm.doc.ddi0...
by juj
Thu Jul 05, 2018 6:43 pm
Forum: Bare metal, Assembly language
Topic: Any tricks to further optimize this memory diffing code?
Replies: 4
Views: 1171

Any tricks to further optimize this memory diffing code?

I need to do really fast diffs of two memory blocks of fixed size 307200, well aligned to my will, to find the first index of where those two blocks differ, on a Raspberry Pi Zero. Here is my current best attempt: int diff(uint8_t *a, uint8_t *b) { uint8_t *endPtr; asm volatile( "mov r1, %[a]\n" // ...
by juj
Sun Jul 01, 2018 8:28 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI DMA and continuous transfers
Replies: 2
Views: 1976

Re: SPI DMA and continuous transfers

There is a hardware limitation that a single SPI DMA transfer control block cannot exceed 64KB, but one can chain multiple DMA transfers together to do arbitrarily long DMA transfers without CPU intervention. Check out https://github.com/juj/fbcp-ili9341 for a codebase that does this.
by juj
Fri Jun 22, 2018 11:35 am
Forum: Bare metal, Assembly language
Topic: CM3 GPIO takes way longer to read than write. Why, and can I speed it up?
Replies: 4
Views: 1021

Re: CM3 GPIO takes way longer to read than write. Why, and can I speed it up?

Also tried hammering GPIO sets and reads on a Pi 3B+, and there the results came out in the same ballpark: ~10nsecs for a write, ~69nsecs for a read.
by juj
Fri Jun 22, 2018 11:26 am
Forum: Bare metal, Assembly language
Topic: CM3 GPIO takes way longer to read than write. Why, and can I speed it up?
Replies: 4
Views: 1021

Re: CM3 GPIO takes way longer to read than write. Why, and can I speed it up?

With fbcp-ili9341, I am doing around 140MHz SPI write communication to a Tontec MZ61581 based display, and around ~70-80MHz communication to other ILI9341 based displays. That suggests that the SPI peripheral is able to bypass these generic GPIO bottlenecks, so if SPI based communication might be an...
by juj
Fri Jun 22, 2018 11:18 am
Forum: Bare metal, Assembly language
Topic: DMA configuration issue
Replies: 3
Views: 1438

Re: DMA configuration issue

Hi Malcolm, I recently implemented support for SPI DMA transfers for the Pi, check out https://github.com/juj/fbcp-ili9341/blob/master/dma.cpp for reference. (There are actually two variants, one geared for power saving, another one for performance) The code there does 4-wire SPI, i.e. it flips the ...
by juj
Thu Jun 21, 2018 3:25 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI CLK divisor ?
Replies: 2
Views: 482

Re: SPI CLK divisor ?

What is the value of BCM2835_CORE_CLK_HZ in that code? Also, what is SPI_CLK_reg[0]? If SPI_CLK_reg[0] is memory mapped register location of the SPI0 CDIV register, then the value of that register represents the divider, and not the Hz rate. So you'd assign the value of the 'divisor' variable in SPI...
by juj
Wed Jun 13, 2018 11:46 am
Forum: HATs and other add-ons
Topic: [Review] KeDei 3.5" HDMI display with touch for Raspberry Pi
Replies: 47
Views: 52522

Re: [Review] KeDei 3.5" HDMI display with touch for Raspberry Pi

I got one of those KeDei 3.5" HDMI displays as well, and did a side by side comparison video of it versus Adafruit's 2.8" PiTFT running fbcp-ili9341. You can find the video here: https://www.youtube.com/watch?v=1yvmvv0KtNs It's a pretty neat little display (both of them)! I was surprised though that...
by juj
Tue Jun 12, 2018 10:30 am
Forum: C/C++
Topic: Bare Metal GPIO programming
Replies: 2
Views: 1074

Re: Bare Metal GPIO programming

That is the upper speed of the Pi SPI. Now your screen uses the GPIO outputs raw and here comes the problem, the GPIO has a relatively slow bus connection and it has maximum speeds and they are Pi1 .. 22Mhz Pi2 .. 48Mhz Pi3 .. 68Mhz The fact your signal degraded at 20Mhz tells me you are on a Pi1. ...
by juj
Sun May 27, 2018 12:59 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: How fast is your ILI9486 or ILI9486L 4-wire SPI display?
Replies: 1
Views: 1882

How fast is your ILI9486 or ILI9486L 4-wire SPI display?

Hi, I recently ported my https://github.com/juj/fbcp-ili9341/ driver over to also work on ILI9486 as well. Check out a demo video at https://www.youtube.com/watch?v=dqOLIHOjLq4 My result was that the maximum I am able to drive a WaveShare 3.5" (B) display is 31.875MHz SPI bus speed, achieved by sett...
by juj
Wed May 23, 2018 10:32 am
Forum: C/C++
Topic: Increase GPIO toggle frequency
Replies: 24
Views: 2917

Re: Increase GPIO toggle frequency

How can I 'pause' (either setting HIGH or LOW) the SPI CLK line using spidev (linux/spi/spidev.h)? The hardware BC2835 SPI peripheral automatically stops driving the CLK signal immediately when there are no bytes left in the FIFO (SPI send queue) to send. That is, when you don't transmit, the CLK s...
by juj
Wed May 23, 2018 10:23 am
Forum: C/C++
Topic: Increase GPIO toggle frequency
Replies: 24
Views: 2917

Re: Increase GPIO toggle frequency

To sleep for a specific period, don't do a volatile variable hammering for(int i = 0; i < pauseTime; ++i) /*nop*/; approach. That will not tell you how long you slept, and it will be dependent on your CPU clock frequency and turbo state, and possibly even contention on the memory bus, so it is very ...
by juj
Sun May 13, 2018 5:43 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI0 and DLEN in non-DMA mode (errata)
Replies: 4
Views: 1237

Re: SPI0 and DLEN in non-DMA mode (errata)

Thanks a million for discovering this hardware quirk! About 6 months ago I was also observing this 9th clock sleep in my application with logic analyzer. Being able to author an easy perf win such as this made my day: https://github.com/juj/fbcp-ili9341/commit/e109c434cbd7512311032cf33d8064d2a192945...
by juj
Sun May 13, 2018 5:30 pm
Forum: Graphics programming
Topic: Speeding up rpi-fbcp
Replies: 57
Views: 24205

Re: Speeding up rpi-fbcp

Hello Juj, thank you for the post and your contribution with fbcp-ili9341... I am receiving "illegal instruction" when try to run your binary under Raspbian "Stretch"... have you had any success with Stretch yet? Thank you. --Chris Hi cookrx7, recently when updating the code to work on Pi Zero W, I...
by juj
Sun May 13, 2018 5:26 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Gpio simultaneous reading
Replies: 10
Views: 846

Re: Gpio simultaneous reading

I don't know what the answer to the actual GPIO peripheral updating the GPIO register being atomic is, but looking at the posted example code that does threaded reads, there is a synchronization bug there at least, that might have an effect. In a code such as Thread 1: while(semo==0) ; //wait until ...
by juj
Tue May 01, 2018 1:46 pm
Forum: Raspbian
Topic: Bypassing L2 cache (from Linux user space program)
Replies: 0
Views: 200

Bypassing L2 cache (from Linux user space program)

Hi all, I'm trying to allocate pages of memory in Raspbian user space program that would bypass the L2 cache, since the DMA peripheral is not connected to it, and only sees coherency up to the L1 cache. The code I'm trying out so far is at https://github.com/juj/Raspberry-Pi-DMA-Example/commit/4dd50...
by juj
Tue May 01, 2018 9:37 am
Forum: General discussion
Topic: What is the clock speed of the BCM2837 chip on Pi 3 Model B+?
Replies: 2
Views: 1262

What is the clock speed of the BCM2837 chip on Pi 3 Model B+?

On Pi 3 Model B, when it is not in turbo mode, the CPU clock speed is 600 MHz and the BCM2837 chip runs at 250MHz. When it turbos, the CPU clock speed goes up to 1200MHz, and the BCM2837 chip boosts up to 400 MHz. The new Pi 3 Model B+ clock speed is stated to be 1400 MHz. What is the BCM2837 chip c...
by juj
Mon Apr 30, 2018 5:36 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: ILI9341 using ioctl
Replies: 2
Views: 437

Re: ILI9341 using ioctl

Not quite sure about ioctl()s - but you are able to programmatically control the data/command mode of a connected ILI9341 display in user space programmatically - the D/C line connects to a GPIO pin, which can be mapped to user space via /dev/mem (https://github.com/juj/fbcp-ili9341/blob/master/spi....
by juj
Sat Dec 23, 2017 11:22 am
Forum: Graphics programming
Topic: run the HDMI and TFT screen simultaneously
Replies: 37
Views: 30303

Re: run the HDMI and TFT screen simultaneously

The fbtft project ( https://github.com/notro/fbtft ) does create a framebuffer for the second SPI display. This framebuffer appears as /dev/fb1 whereas the main HDMI display appears as /dev/fb0. These can be driven separately with separate contents, or one can use a mirroring technique to continuous...

Go to advanced search