Cov txheej txheem:

Raspberry PI 3 - Pab Kev Sib Txuas Txuas rau TtyAMA0 rau BCM GPIO 14 thiab GPIO 15: 9 Cov Kauj Ruam
Raspberry PI 3 - Pab Kev Sib Txuas Txuas rau TtyAMA0 rau BCM GPIO 14 thiab GPIO 15: 9 Cov Kauj Ruam

Video: Raspberry PI 3 - Pab Kev Sib Txuas Txuas rau TtyAMA0 rau BCM GPIO 14 thiab GPIO 15: 9 Cov Kauj Ruam

Video: Raspberry PI 3 - Pab Kev Sib Txuas Txuas rau TtyAMA0 rau BCM GPIO 14 thiab GPIO 15: 9 Cov Kauj Ruam
Video: Saib Mis paub Poj niam (hluas nkauj) tus yam ntxwv lub siab 2024, Hlis ntuj nqeg
Anonim
Raspberry PI 3 - Pab Txhawb Kev Sib Txuas rau TtyAMA0 rau BCM GPIO 14 thiab GPIO 15
Raspberry PI 3 - Pab Txhawb Kev Sib Txuas rau TtyAMA0 rau BCM GPIO 14 thiab GPIO 15
Raspberry PI 3 - Pab Txhawb Kev Sib Txuas rau TtyAMA0 rau BCM GPIO 14 thiab GPIO 15
Raspberry PI 3 - Pab Txhawb Kev Sib Txuas rau TtyAMA0 rau BCM GPIO 14 thiab GPIO 15

Kuv nyuam qhuav muaj kev txaus siab los ua kom UART0 ntawm kuv tus Raspberry Pi (3b) kom kuv tuaj yeem txuas nws ncaj qha rau RS-232 teeb liab qib ntaus ntawv siv tus qauv 9-pin d-sub txuas yam tsis tas yuav hla USB mus rau RS-232 adapter.

Ib feem ntawm kuv qhov kev txaus siab ntawm no yog tseem tuaj yeem txuas ib qho kev hloov pauv RS-232 (MAX3232) lossis RS-485 ntaus ntawv (MAX485).

Kuv tau tawm tsam me ntsis sim ua Pi teeb tsa ua haujlwm. Kuv tsis muaj kev paub ntau nrog Raspberry Pi, lossis nws yog lub kaw lus ua haujlwm, yog li kuv nyob ntawm txoj kev nkhaus ncaj ncees.

Thaum kawg, los ntawm Google tshawb nrog rau "Kev sim thiab yuam kev", Kuv tau tswj los rub ua ke txhua qhov ntsiab lus kom nws ua haujlwm kom kuv txaus siab, tab sis cov ntaub ntawv tsis nyob hauv ib daim ntawv luv uas muaj tag nrho cov kauj ruam los ua qhov no tshwm sim.

Kuv tau teev cov npe ntawm no cov kauj ruam uas kuv tau ua los ua txoj haujlwm no rau kuv.

Khoom siv

1 - Raspberry Pi. Kuv tau siv tus qauv 3b..

2 - Ib qho "mini" RS -232 Theem Converter - TTL rau RS -232 - Kuv tau siv PCB me me ntim nrog MAX 3232 IC rau nws uas kuv yuav los ntawm eBay.. Kuv kuj ua tiav qhov no nrog TTL rau RS -485 hloov pauv - tseem yuav los ntawm eBay.

Thaum Pi tau teeb tsa, ob lub hloov pauv ua haujlwm rau kuv qhov kev txaus siab yam tsis muaj teeb meem pom los ntawm kuv.

Kauj Ruam 1: Nruab FRESH Luam ntawm Raspbian ntawm Koj Daim Npav Nco

Nruab ib daim FRESH Luam ntawm Raspbian ntawm Koj Daim Npav Nco
Nruab ib daim FRESH Luam ntawm Raspbian ntawm Koj Daim Npav Nco

Kuv pib los ntawm kev txhim kho Daim Ntawv Tshiab / Feem Ntau Tshaj Tawm ntawm Raspberry Pi IOS (yav dhau los Raspian) ntawm kuv Daim Npav Nco. Kuv xaiv tsis mus txoj kev NOOBS.

Rub tawm thiab teeb tsa Imager cuab yeej

www.raspberrypi.org/downloads/

Rub tawm, Unzip thiab nruab rau koj daim npav nco Raspberry Pi IOS duab.

Tom qab boot-up, txheeb xyuas thiab hloov kho raws li xav tau …

Kauj Ruam 2: Pab kom Raspberry Pi Serial Port - Siv GUI

Pab kom Raspberry Pi Serial Port - Siv GUI
Pab kom Raspberry Pi Serial Port - Siv GUI
Pab kom Raspberry Pi Serial Port - Siv GUI
Pab kom Raspberry Pi Serial Port - Siv GUI

Los ntawm lub neej ntawd, ntawm qhov tshiab Raspberry Pi IOS kev teeb tsa UART0 tau tshwj tseg rau "Logon Plhaub". Qhov ntawd yog lub ntsiab lus muab rau koj qee qhov nkag mus / tswj ntawm Pi ntawm Serial chaw nres nkoj / Terminal program ua ke.

Txhawm rau siv UART0 rau lwm daim ntawv thov, koj yuav tsum "tig-tua" qhov kev txuas mus rau Logon Plhaub. Qhov no tshwm sim hauv ob peb kauj ruam yooj yim haum.

Txoj kev nrawm tshaj plaws los pab "Serial Port" yog ua los ntawm GUI.

Los ntawm "Raspberry - Drop -Down Menu", xaiv "Preferences", thiab tom qab ntawd "Raspberry Pi Configuration"

Los ntawm qhov ntawd, mus rau ntu "Interfaces" tab, thiab "Enable" Serial Port (los ntawm txhaj rau lub pob nyem uas tsim nyog).

Nyem OK kom tawm, thiab tom qab ntawd rov ua dua.

LOS YOG.. koj tuaj yeem ua raws txoj kev no …

Kauj Ruam 3: Ib txoj hauv kev los pab kom lub Serial Port (thiab Disable Login Plhaub)

Lwm txoj hauv kev los pab kom Port Serial (thiab Xiam Tus Login Plhaub)
Lwm txoj hauv kev los pab kom Port Serial (thiab Xiam Tus Login Plhaub)
Lwm txoj hauv kev los pab kom Port Serial (thiab Xiam Tus Login Plhaub)
Lwm txoj hauv kev los pab kom Port Serial (thiab Xiam Tus Login Plhaub)
Lwm txoj hauv kev los pab kom Port Serial (thiab Xiam Tus Login Plhaub)
Lwm txoj hauv kev los pab kom Port Serial (thiab Xiam Tus Login Plhaub)
Lwm txoj hauv kev los pab kom qhov chaw nres nkoj Serial (thiab Disable Login Plhaub)
Lwm txoj hauv kev los pab kom qhov chaw nres nkoj Serial (thiab Disable Login Plhaub)

Hom no yog siv rau - tsis tsim nyog tab sis zoo paub txog.

== == ==

Lwm txoj hauv kev los xiam lub Console Siv UART0 ntawm Boot-up.

siv:

sudo raspi-teeb tsa

Xaiv Qhov Xaiv #5 - Kev Xaiv Ua Haujlwm ==> Xaiv

Xaiv P6 Serial ==> Xaiv

Teb TSIS YOG: Koj puas xav kom lub plhaub nkag mus nkag tau yooj yim dua ntawm cov ntawv?

Teb YES rau: Koj puas xav kom lub khoos phis tawj chaw nres nkoj txuas kom qhib?

Cov lus teb yuav yog:

Lub plhaub tus lej nkag nkag tau xiam

Serial interface tau qhib

Xaiv OK

Xaiv Tiav

Kauj Ruam 4: Xiam Bluetooth - Tso UART0 thiab Pub Dawb Rau TtyAMA0

Lov tes taw Bluetooth - Tso UART0 thiab Pub Dawb Rau TtyAMA0
Lov tes taw Bluetooth - Tso UART0 thiab Pub Dawb Rau TtyAMA0
Lov tes taw Bluetooth - Tso UART0 thiab Pub Dawb Rau TtyAMA0
Lov tes taw Bluetooth - Tso UART0 thiab Pub Dawb Rau TtyAMA0
Lov tes taw Bluetooth - Tso UART0 thiab Pub Dawb Rau TtyAMA0
Lov tes taw Bluetooth - Tso UART0 thiab Pub Dawb Rau TtyAMA0

Qhov thib ob ntawm cov txheej txheem tseem yuav txuas lub Bluetooth los ntawm UART0.

Ib nplooj ntawv "UART CONFIGURATION" nplooj ntawv no koj yuav tsum tau txuas lub Bluetooth ntaus ntawv los ntawm UART0, thiab pub dawb UART0 rau ttyAMA0 - Yog xav tau koj tuaj yeem txav Bluetooth mus rau "mini -UART"

Ua los ntawm kev kho cov ntaub ntawv npe "config.txt" (nyob hauv "khau raj" phau ntawv teev npe) thiab ntxiv ONE kab nyob rau hauv qab ntawm nplooj ntawv:

dtoverlay = lov tes taw-bt

Nyob ntawm koj qhov xwm txheej thiab xav siv Bluetooth, tej zaum koj yuav xav ntxiv cov kab hauv qab no (tab sis nws tsis tsim nyog rau qhov kev qhia no ua haujlwm kom raug). Nplooj ntawv no tseem muaj cov ntsiab lus tseem ceeb ntawm txhua qhov lag luam no. Thov siv sijhawm los nyeem cov ntawv txuas (saib saum toj no) kom nkag siab qhov no.

dtoverlay = miniuart-bt

Txheeb ob zaug koj cov ntawv sau, tom qab ntawd khaws cov ntawv thaum koj tawm, thiab rov pib dua.

Txij ntawm no mus, koj yuav tsum zoo mus.

Kauj Ruam 5: RPI Pin-out rau UART Port

RPI Pin-out rau UART Port
RPI Pin-out rau UART Port

Ib lub vev xaib "pinout.xyz" Raspberry Pi UART0 pins tuaj yeem nkag tau ntawm cov pins hauv qab no.

UART pins hauv BCM hom yog: RPI Pin #8 / GPIO14 ==> TXD

RPI Pin #10 / GPIO15 ==> RXD

Nco ntsoov tias rau cov koob, lawv yog "3.3 Volt TTL qib".. Cov CANOT no tau siv los tsav thiab tau txais los ntawm qib RS-232 lossis qib-RS-422/RS-485 ntaus ntawv. Kev sim ua li ntawd YUAV ua rau koj lub rooj tsav xwm UART hlawv tawm, thiab feem ntau yuav siv cov txheej txheem nrog nws.

Koj YUAV TSUM siv qib hloov pauv.

Txhawm rau txuas rau qib RS-232 lossis qib RS-422/RS-485 koj yuav tsum muaj tus hloov pauv qib tsim nyog.

Kauj Ruam 6: Ntxiv Qib RS-232 rau TTL Qib Hloov Dua Ntaus rau Koj Raspberry Pi

Ntxiv ib qib RS-232 rau TTL Theem Hloov Cov Ntaus rau Koj Raspberry Pi
Ntxiv ib qib RS-232 rau TTL Theem Hloov Cov Ntaus rau Koj Raspberry Pi
Ntxiv ib qib RS-232 rau TTL Theem Hloov Cov Ntaus rau Koj Raspberry Pi
Ntxiv ib qib RS-232 rau TTL Theem Hloov Cov Ntaus rau Koj Raspberry Pi
Ntxiv ib qib RS-232 rau TTL Theem Hloov Cov Ntaus rau Koj Raspberry Pi
Ntxiv ib qib RS-232 rau TTL Theem Hloov Cov Ntaus rau Koj Raspberry Pi

Rau TTL rau RS-232 qib kev hloov pauv kuv siv cov hloov pauv hauv qab no.

MAX3232 raws Mini RS232 rau TTL qib hloov pauv.

Cov khoom no tuaj yeem siv tau los ntawm 3.3 VDC lossis txawm tias 5 VDC (ob qho tib si muaj los ntawm cov koob tshwj xeeb ntawm koj li RPI) thiab siv tau tam sim no tsawg heev.

Cov ntawv rau MAX3232 muab cov ntsiab lus muaj txiaj ntsig ntawm nws txoj haujlwm, tab sis qhov tseeb tsis tas yuav tsum muaj coding los ua txoj haujlwm no

Xa mus rau cov duab txuas, thiab siv sijhawm los ua tib zoo txuas Raspberry Pi pins rau tus pin tsim nyog ntawm tus qauv. Tsuas yog paub tias lub cuab yeej no yuav ua haujlwm ntawm 3.3VDC lossis ntawm 5 VDC - ob qho tib si muaj nyob ntawm RPI (xa mus rau Pin -out daim duab).

CEEB TOOM:

Kuv yuav ntau 10 ntawm cov chav no los ntawm eBay, thiab kuv tsis tuaj yeem ua ib qho ntawm lawv ua haujlwm. Ntawm qhov chaw lawv zoo li nws yuav tsum yooj yim txaus siv cov no, tab sis tsis yog. Tom qab tawm tsam nrog lawv me ntsis, Kuv pom ntau cov ntsiab lus ntawm FAKE MAX3232 muaj nyob online.

www.eevblog.com/forum/reviews/fake-max3232-any-additional-details/…

Kuv tsis pom zoo cov khoom no.

Kauj Ruam 7: Ntxiv qib RS-485 rau TTL Qib Hloov Dua Ntaus rau Koj Raspberry Pi

Ntxiv ib qib RS-485 rau TTL Theem Hloov Cov Ntaus rau Koj Raspberry Pi
Ntxiv ib qib RS-485 rau TTL Theem Hloov Cov Ntaus rau Koj Raspberry Pi
Ntxiv ib qib RS-485 rau TTL Theem Hloov Cov Ntaus rau Koj Raspberry Pi
Ntxiv ib qib RS-485 rau TTL Theem Hloov Cov Ntaus rau Koj Raspberry Pi
Ntxiv ib qib RS-485 rau TTL Theem Hloov Cov Ntaus rau Koj Raspberry Pi
Ntxiv ib qib RS-485 rau TTL Theem Hloov Cov Ntaus rau Koj Raspberry Pi

Zoo ib yam ntawm ntau txoj hauv kev rau qib dhau los, ntxiv qhov hloov pauv RS -485 yog ib qho yooj yim - tej zaum kuj yooj yim dua.

Rau TTL rau RS-232 qib kev hloov pauv kuv siv cov hloov pauv hauv qab no.

MAX485 puag puag RS485 qib rau TTL qib hloov pauv. Ib zaug ntxiv cov khoom no tuaj yeem siv tau los ntawm 3.3 VDC lossis txawm tias 5 VDC (ob qho tib si muaj los ntawm cov koob tshwj xeeb ntawm koj li RPI) thiab siv tau tam sim no tsawg heev. Cov ntawv rau MAX485 muab cov ntsiab lus muaj txiaj ntsig ntawm nws txoj haujlwm, tab sis qhov tseeb tsis tas yuav tsum muaj coding los ua txoj haujlwm no

Xa mus rau cov duab txuas, thiab siv sijhawm los ua tib zoo txuas Raspberry Pi pins rau tus pin tsim nyog ntawm tus qauv. Tsuas yog paub tias lub cuab yeej no yuav ua haujlwm ntawm 3.3VDC lossis ntawm 5 VDC - ob qho tib si muaj nyob ntawm RPI (xa mus rau Pin -out daim duab).

Ntawm kev ceeb toom-tsis zoo li RS-232, RS-485 tsis muaj "tus qauv" txuas hom txuas nrog nws. Cov npe teev npe feem ntau yog "B-" thiab "A+", tab sis nco ntsoov tias tsis yog txhua tus neeg xa khoom ua raws tib lub npe sib xws. RS -485 khiav ntawm "Kev Sib Txawv Ua Ke" cov phiaj xwm teeb tsa - Cov ncauj lus kom ntxaws ntxiv ntawm qhov muaj nyob ntawm no. "Hav zoov sab hnub poob" nyob hauv hav RS-485..

Kauj Ruam 8: Tam sim no, Nws yog koj li

Tam sim no koj yuav tsum muaj peev xwm txuas koj li Raspberry Pi ncaj qha rau lwm lub cuab yeej uas koj xaiv.. Muaj PLENTY ntawm lawv tseem siv niaj hnub no.

Koj yuav ua li cas yog nyob ntawm koj …

Txhawm rau pib, txheeb xyuas "Minicom" lossis "CuteCom", lossis tshawb xyuas qhov muaj peev xwm siv "NodeRED".

Kauj ruam 9: Synopsys

Xav tias dawb tawm lus, lossis cov lus pom / kev kho. Kuv yuav txaus siab rau qhov ntawd.

Pom zoo: