Saturday, September 2, 2017

Orange PI PC + TFT ILI9341

Here is a quick way to configure a TFT display with a ILI9341 driver.
This should work with most (if not all) of Orange PI boards that are based on H3 (no Pi Zero).
I use Armbian as the OS.
such as:
to:

here are the connections that are needed:

Once connected, install Armbian for your board and connect to a network.
Find the IP of the device (connect to a screen and a keyboard, use the log of the router and etc.)
Putty/ssh to it, login (user: root pass:1234 , it's the default values - please change the password to something more secure)

The TFT screen should be ON (white or black screen) with nothing on it.

Create a new file /etc/modules-load.d/fbtft.conf with the following content:

fbtft_device

Create another file /etc/modprobe.d/fbtft.conf with the 
configuration for the fbtft_device device:

options fbtft_device custom name=fb_ili9341 gpios=dc:6,reset:9 speed=48000000 fps=25 busnum=0 rotate=270

restart device:
shutdown -r now

wait for boot,login again (the screen should be black)

Goto /etc/X11/xorg.conf and edit it, change the line that says
 Option                  "fbdev" "/dev/fb0"

to:
 Option                  "fbdev" "/dev/fb8"

And restart again,
shutdown -r now

When the device boots you should have a working screen.

Friday, February 17, 2017

RS232 to TTL level shifter using transistors

Here is a schematic for a convenient circuit to connect a micro to RS232 (COM) port using only common parts, no MAX232 and such.


BOM:
C1         220pF
D1         1N4007 - Can be almost any regular diode
J1         DB9
P1         CONN_4 - Can just use wires
Q1         BC558  -  PNP Transistor can probably use any PNP transistor
Q2         BC547 - NPN Transistor can probably use any NPN transistor
R1         10K
R2         10K
R3         10K
R4         3.3K
R5         3.3K
R6         3.3K

PIN 1 requires VCC the same voltage that the Microcontroller uses

Tested up to speeds 115200, used in many projects, ESP8266,sniffing router ports and the likes.