Difference between revisions of "Q100"

From Geekworm Wiki
Jump to navigation Jump to search
Line 52: Line 52:
 
Reter to [[NVMe SSD boot with the Raspberry Pi 5]]
 
Reter to [[NVMe SSD boot with the Raspberry Pi 5]]
 
===LCD display tutorial===
 
===LCD display tutorial===
Enable SPI interface
+
'''1. Enable SPI interface'''
  
 
Reter to [[How to enable SPI]]
 
Reter to [[How to enable SPI]]
  
 
  sudo raspi-config
 
  sudo raspi-config
Choose Interfacing Options -> SPI -> Yes  to enable SPI interface
+
Choose Interfacing Options -> SPI -> Yes  to enable SPI interface
  
Install lgpio liberery
+
'''2. Install Library'''
 +
 
 +
PS: If you use the bookworm system, you can only use lgpio library, bcm2835 and wiringPi can't be installed and used.
 +
 
 +
'''BCM2835'''
 +
<PRE>
 +
#Open the Raspberry Pi terminal and run the following command
 +
wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.71.tar.gz
 +
tar zxvf bcm2835-1.71.tar.gz
 +
cd bcm2835-1.71/
 +
sudo ./configure && sudo make && sudo make check && sudo make install
 +
# For more, you can refer to the official website at: http://www.airspayce.com/mikem/bcm2835/
 +
</PRE>
 +
 
 +
 
 +
'''WiringPi'''
 +
<pre>
 +
#Open the Raspberry Pi terminal and run the following command
 +
cd
 +
sudo apt-get install wiringpi
 +
#For Raspberry Pi systems after May 2019 (earlier than that can be executed without), an upgrade may be required:
 +
wget https://project-downloads.drogon.net/wiringpi-latest.deb
 +
sudo dpkg -i wiringpi-latest.deb
 +
gpio -v
 +
# Run gpio -v and version 2.52 will appear, if it doesn't it means there was an installation error
 +
 
 +
# Bullseye branch system using the following command:
 +
git clone https://github.com/WiringPi/WiringPi
 +
cd WiringPi
 +
. /build
 +
gpio -v
 +
# Run gpio -v and version 2.70 will appear, if it doesn't it means there was an installation error
 +
</pre>
 +
 
 +
'''lgpio'''
 +
<pre>
 +
#Open the Raspberry Pi terminal and run the following command
 +
wget https://github.com/joan2937/lg/archive/master.zip
 +
unzip master.zip
 +
cd lg-master
 +
sudo make install
 +
 
 +
# You can refer to the official website for more: https://github.com/gpiozero/lg
 +
</pre>
  
 
PS: If you use the bookworm system, you can only use lgpio library, bcm2835 and wiringPi can't be installed and used
 
PS: If you use the bookworm system, you can only use lgpio library, bcm2835 and wiringPi can't be installed and used
Line 73: Line 116:
 
</pre>
 
</pre>
  
Install Python
+
'''Python'''
 
<pre>
 
<pre>
 
sudo apt-get update
 
sudo apt-get update
Line 79: Line 122:
 
sudo apt-get install python3-pil
 
sudo apt-get install python3-pil
 
sudo apt-get install python3-numpy
 
sudo apt-get install python3-numpy
sudo pip3 install spidev
+
#sudo pip3 install spidev
 
</pre>
 
</pre>
  
Download Examples
+
'''Download Examples'''
 +
<pre>
 +
git clone https://github.com/geekworm-com/Q100.git
 +
cd Q100
 +
</pre>
  
Open the Raspberry Pi terminal and run the following command:
+
'''Run the demo'''
 
<pre>
 
<pre>
sudo apt-get install p7zip-full -y
+
cd python
wget https://sourceforge.net/projects/u-geek/files/HATs//Raspi_M2_HAT/Raspi_M2_HAT_code.7z
+
sudo python status.py
7z x Raspi_M2_HAT_code.7z -r -o./Raspi_M2_HAT_code
 
sudo chmod 777 -R Raspi_M2_HAT_code
 
cd Raspi_M2_HAT_code
 
 
</pre>
 
</pre>
 
Run the demo:
 
sudo python stats.py
 
  
 
<!--Add review function! -->
 
<!--Add review function! -->

Revision as of 19:43, 14 March 2024

Overview

PIN OUT

PIN Raspberry Pi Interface (BCM) Description
SCLK P11/SCLK SPI clock line
MOSI P10/MOS SPI data line
CS P8/CE0 Chip selection
DC P25 Data/Command control
RST NOT USE Reset
BL P27 Backlight

LCD and the controller

The ST7789VW is a single-chip controller/driver for 262K-color, graphic type TFT-LCD. It consists of 240 source line and 320 gate line driving circuits. The resolution of this LCD is 240 (H) RGB x 240(V), it supports horizontal mode and vertical mode, and it doesn't use all the RAM of the controller.

This LCD accepts 8-bits/9-bits/16-bits/18-bits parallel interface, that are RGB444, RGB565, RGB666. The color format used in demo codes is RGB565.

This LCD use a 4-line SPI interface for reducing GPIO and fast speed.LCD

LCD Working Protocol

Q100-lcd-work-protocol.png

Note: Different from the traditional SPI protocol, the data line from the slave to the master is hidden since the device only has display requirement.

RESX Is the reset pin, it should be low when powering the module and be higher at other times;

CSX is slave chip select, when CS is low, the chip is enabled.

D/CX is data/command control pin, when DC = 0, write command, when DC = 1, write data

SDA is the data pin for transmitting RGB data, it works as the MOSI pin of SPI interface;

SCL worka s the SCLK pins of SPI interface.

SPI communication has data transfer timing, which is combined by CPHA and CPOL.

CPOL determines the level of the serial synchronous clock at idle state. When CPOL = 0, the level is Low. However, CPOL has little effect to the transmission.

CPHA determines whether data is collected at the first clock edge or at the second clock edge of serial synchronous clock; when CPHL = 0, data is collected at the first clock edge.

There are 4 SPI communication modes. SPI0 is commonly used, in which CPHL = 0, CPOL = 0.

User Manual

NVMe SSD boot tutorial

Reter to NVMe SSD boot with the Raspberry Pi 5

LCD display tutorial

1. Enable SPI interface

Reter to How to enable SPI

sudo raspi-config

Choose Interfacing Options -> SPI -> Yes to enable SPI interface

2. Install Library

PS: If you use the bookworm system, you can only use lgpio library, bcm2835 and wiringPi can't be installed and used.

BCM2835

#Open the Raspberry Pi terminal and run the following command
wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.71.tar.gz
tar zxvf bcm2835-1.71.tar.gz 
cd bcm2835-1.71/
sudo ./configure && sudo make && sudo make check && sudo make install
# For more, you can refer to the official website at: http://www.airspayce.com/mikem/bcm2835/


WiringPi

#Open the Raspberry Pi terminal and run the following command
cd
sudo apt-get install wiringpi
#For Raspberry Pi systems after May 2019 (earlier than that can be executed without), an upgrade may be required:
wget https://project-downloads.drogon.net/wiringpi-latest.deb
sudo dpkg -i wiringpi-latest.deb
gpio -v
# Run gpio -v and version 2.52 will appear, if it doesn't it means there was an installation error

# Bullseye branch system using the following command:
git clone https://github.com/WiringPi/WiringPi
cd WiringPi
. /build
gpio -v
# Run gpio -v and version 2.70 will appear, if it doesn't it means there was an installation error

lgpio

#Open the Raspberry Pi terminal and run the following command
wget https://github.com/joan2937/lg/archive/master.zip
unzip master.zip
cd lg-master
sudo make install

# You can refer to the official website for more: https://github.com/gpiozero/lg

PS: If you use the bookworm system, you can only use lgpio library, bcm2835 and wiringPi can't be installed and used

#Open the Raspberry Pi terminal and run the following command
wget https://github.com/joan2937/lg/archive/master.zip
unzip master.zip
cd lg-master
sudo make install

# You can refer to the official website for more: https://github.com/gpiozero/lg

Python

sudo apt-get update
sudo apt-get install python3-pip
sudo apt-get install python3-pil
sudo apt-get install python3-numpy
#sudo pip3 install spidev

Download Examples

git clone https://github.com/geekworm-com/Q100.git
cd Q100

Run the demo

cd python
sudo python status.py
Add your comment
Geekworm Wiki welcomes all comments. If you do not want to be anonymous, register or log in. It is free.


Anonymous user #1

10 days ago
Score 0++
I am once again asking how to get in contact WITH ANY SUPPORT PERSON WHATSOEVER IN REGARDS TO A FAULTY X882-A1 CONNECTOR. POTENTIAL BUYERS be aware this is what they are putting their customers through. I have tried other means of communication only to be ignored.