-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathbuild_notes.txt
executable file
·98 lines (68 loc) · 3.45 KB
/
build_notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
Europi Install & Build instructions
Download, compile and install the PIGPIO library\
edit /boot/config.txt and take the comment off the following line:
#dtparam=spi=on
add the following line to prevent the under-voltage warning being displayed if
the power voltage drops:
avoid_warnings=1
Note: If you change the 1 to a 2, then it will also prevent the Pi disabling Turbo mode
if the power drops (normal behaviour). i thought this a bit risky, as it might cause the
pi to crash, hence why I stuck with the =1
Add the ads7846 touchscreen overlay:
- Towards the end of /boot/config.txt add the following line:
dtoverlay=ads7846,penirq=17,speed=1600000,xohms=100
The following line loads the fbtft driver manually, though note that later on in this doc
there is an explanation as to how to load the fbtft driver at boot time
sudo modprobe fbtft_device custom name=fb_iti9340 buswidth=8 speed=16000000 bgr=1 gpios=reset:27,dc:22 rotate=270
Also in /boot/config.txt if you add the following lines, it will force the raspberry Pi into native
1280x960 graphics mode, which is the same aspect ration (4:3) as the 320x240 TFT display. Doing
this has certain advantages inasmuch as it is then possible, whilst deverloping under X11
to check the resulting display on the 320x240TFT display as it scales exactly:
framebuffer_width=1280
framebuffer_height=960
hdmi_group=2
hdmi_mode=32
hdmi_cvt 1280 960 60 1 0 0 0
When you are ready to run headless with only the TFT display, use the following instead, which
will set the Pi to native 320x240:
framebuffer_width=320
framebuffer_height=240
hdmi_group=2
hdmi_mode=87
hdmi_cvt 320 240 60 1 0 0 0
The following two changes mean that you don't have to run the sudo modprobe line each time the pi boots:
>sudo nano /etc/modules-load.d/modules.conf
add the following 2 lines:
spi-bcm2835
fbtft_device
>sudo nano /etc/modprobe.d/fbtft.conf (ie create this file, as it probably doesn't already exist)
add the following line:
options fbtft_device custom name=fb_ili9340 buswidth=8 speed=16000000 bgr=1 gpios=reset:27,dc:22 rotate=270
Note that the argument bgr=1 is only necessary to fix the situation where Red and Blue colours are swapped, which
it the case with the SpotPear TFT Screens.
To get europi to run automatically at startup, do the following:
>sudo crontab -e
If it gives you a choice of editor, choose whichever you want (I use nano). Once you have made a choice, it'll open in that editor from then onwards
Add the following to the bottom of the crontab file:
@reboot /usr/bin/sudo /home/pi/projects/Europi/europi
SET The Touchscreen Device:
Depending on how many devices are connected to the SPI bus, the Touchscreen may appear as
device1, 2, 3 etc., to view the input devices:
>cat /proc/bus/input/devices
Mine looks like this:
I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="ADS7846 Touchscreen"
P: Phys=spi0.1/input0
S: Sysfs=/devices/platform/soc/3f204000.spi/spi_master/spi0/spi0.1/input/input3
U: Uniq=
H: Handlers=mouse1 event3
B: PROP=0
B: EV=b
B: KEY=400 0 0 0 0 0 0 0 0 0 0
B: ABS=1000003
That H: line shows that it is being handled by event3
Fri 24th June: I was adding stuff to get me to the stsage where I could use IOCTL to read touch events
I got the prog to compile OK, but it crashes with a SIGINT 11 (basically a memory violation) as it
tries to query the device capabilities.
Sat 25th Jun: I removed all the touchscreen code I'd added, and decided instead to just try linking
in the example C code from Mark Williams