UART Setup in Raspberry Pi Bare Bones

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
thestew42
Member
Member
Posts: 38
Joined: Thu Jun 19, 2008 6:20 pm
Location: San Diego, CA

UART Setup in Raspberry Pi Bare Bones

Post by thestew42 »

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.
jnc100
Member
Member
Posts: 775
Joined: Mon Apr 09, 2007 12:10 pm
Location: London, UK
Contact:

Re: UART Setup in Raspberry Pi Bare Bones

Post by jnc100 »

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.
thestew42
Member
Member
Posts: 38
Joined: Thu Jun 19, 2008 6:20 pm
Location: San Diego, CA

Re: UART Setup in Raspberry Pi Bare Bones

Post by thestew42 »

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 :D ).
Post Reply