Setup UART trên Raspberry Pi

  • Setup UART trên Raspberry Pi

Hướng dẫn setup UART trên Raspberry Pi để giao tiếp với Kit Arduino, các MCU : MSP430, PIC, ARM,....

Bước 1 : Disable Login Shell over Serial (PL2303, Hercules, Serial Monitor - Arduino, 115200 )

Bước 2 : Enable Serial Port Hardware

+ Lưu ý : Với Raspberry Pi 2 tới bước này các bạn Reboot là có thể sử dụng được UART trên Pi 2. Với Pi 3 các bạn thực hiện thêm Bước 3.

Bước 3 : Disable Bluetooth and Stop Bluetooth Service + Disable Bluetooth $ sudo nano /boot/config.txt $ dtoverlay=pi3-disable-bt + Stop Bluetooth Service $ sudo systemctl disable hciuart

+ Lưu ý : Nếu muốn Bluetooth hoạt động trở lại thì các bạn chỉ cần thực hiện Bước 3 này , và thay đổi disable = enable trong các câu lệnh ở Bước 3 này.

Bước 4 : Reboot $ sudo reboot

Bước 5 : Test giao tiếp UART với Arduino

Link bài viết kỹ thuật chi tiết : http://pivietnam.com.vn/bai-4-lap-trinh-raspberry-pi-su-dung-cong-truyen-thong-uart-pivietnam-com-vn.html

Link playlist video học Raspberry Pi :https://www.youtube.com/playlist?list=PLljUM3eP-e77JRwwKSp-kISyMogrejan-