Go to advanced search

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: 177

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: 441

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: 561

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: 561

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: 404

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: 679

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: 679

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: 1018

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: 270

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: 40473

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: 776

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: 519

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: 1533

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: 1533

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: 857

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: 54
Views: 20385

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: 474

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: 124

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: 492

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: 247

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: 24
Views: 10479

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...
by juj
Fri Dec 01, 2017 8:16 pm
Forum: Graphics programming
Topic: Speeding up rpi-fbcp
Replies: 54
Views: 20385

Re: Speeding up rpi-fbcp

Stumbled on to this old thread when looking for related resources. I have recently implemented a custom driver to replace rpi-fbcp when interfacing with my ILI9341 controlled PiTFT 2.8" display. This driver operates like rpi-fbcp, and can be found at: Code: https://github.com/juj/fbcp-ili9341 Video:...
by juj
Fri Dec 01, 2017 7:25 pm
Forum: Gaming
Topic: Fast refresh rates up to 60fps with an SPI display (ILI9341)
Replies: 8
Views: 2280

Re: Fast refresh rates up to 60fps with an SPI display (ILI9341)

Uploaded an updated version with better performance and a performance statistics overlay view. A new video can be found at https://www.youtube.com/watch?v=rKSH048XRjA.
by juj
Thu Nov 23, 2017 4:32 pm
Forum: Gaming
Topic: Fast refresh rates up to 60fps with an SPI display (ILI9341)
Replies: 8
Views: 2280

Re: Fast refresh rates up to 60fps with an SPI display (ILI9341)

That's exactly right - if a display is connected to the HDMI, then the VideoCore GPU uses its internal dedicated circuitry to schedule sending the image frames over to the HDMI attached display, and the main CPU does not have to take part in this. When the display is connected to the GPIO pins, then...
by juj
Mon Nov 20, 2017 9:24 pm
Forum: Gaming
Topic: Fast refresh rates up to 60fps with an SPI display (ILI9341)
Replies: 8
Views: 2280

Fast refresh rates up to 60fps with an SPI display (ILI9341)

Hi all, if you're like me, you may have gotten excited about some DIY handheld games console projects packages out there when you first stumbled to that corner of the web, got the parts, and built the kit. What they did not mention was that the display the kit came with was a SPI-based one, and as r...

Go to advanced search