Tuesday, October 2, 2012

How to Change the Baudrate of Raspberry Pi USART




Default boudrate of Raspberry Pi USART available in GPIO is 115200. To use this serial port for communicating with Slow microcontrollers Like Arduino and PIC  you need some modifications. For example if you want to change Raspberry Pi USART Boudrate to 9600:

Fist You change the  console baudrate:
To change the console baudrate, edit /boot/cmdline.txt to look like this (this is all in single line):
dwc_otg.lpm_enable=0 console=ttyAMA0,9600 kgdboc=ttyAMA0,9600 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait

Then  edit /etc/inittab to change the baudrate of the getty (you should find a line with baudrate of 115200, change that number to 9600):
2:23:respawn:/sbin/getty -L ttyAMA0 9600 vt100

Restart the system. 

No comments: