UART Setup in Raspberry Pi Bare Bones
UART Setup in Raspberry Pi Bare Bones
Hi everyone. I've been reading the C bare bones tutorial for raspberry pi and am a little unclear on the setup of UART. I started reading through the Broadcom peripherals documentation to understand what was going on with the pull-up/pull-down setting, which now makes sense to me. However, while I was reading the documentation I see that the GPIO pins can be configured to different alternate functions (including UART). The tutorial does not set any of the function select registers, but the description of these functions as "alternates" makes it sound like they are not enabled by default. Does the bootloader set these in this tutorial, or are the ALT0 functions set by default? I just want to know if there is any good reason to configure these registers on initialization. Thanks.
Re: UART Setup in Raspberry Pi Bare Bones
The default is that GPIO14 and 15 are connected to the UART as TX and RX respectively (at least on RPi ver 1 with BCM 2835 chipset). If you want to access additional pins (i.e. CTS/RTS) or enable UART1 (the 'mini' UART) you will indeed need to reassign those particular pins (as the default is as a GPIO instead). Most USB to UART adapters though only need connecting to TX and RX.
Regards,
John.
Regards,
John.
Re: UART Setup in Raspberry Pi Bare Bones
Thanks John. And yeah I noticed that the adafruit USB adapter I'm using does not have CTS/RTS (although it does have mislabeled green/white leads...that took a while to figure out ).