Explanation on Raspberry PI's pull up/pull down and clock

Viewed 10

I'm working on a baremetal project with the Raspberry PI 3. I am currently trying to get the UART channel to work. The only references (https://youtu.be/36hk_Qov5Uo?list=PLVxiWMqQvhg9FCteL7I0aohj1_YiUx1x8&t=682) I can find say I need to set the GPIO pull up/pull down register (GPPUD) to 0, then "enable" the clock for the pins, and then set GPPUD to 0 again (with 150 cycles wait time in between those steps).

I'd just like some more explanation on this.

  • Why do you need to set GPPUD before and after with time in between?
  • Why set it to 0? The datasheet for bcm2837 shows that a 0 means pull up/down is disabled, a 1 means "pull down control", and a 2 means "pull up control". What do each of these do and why set it to 0 before and after?
  • How does all this terminology relate/differ to the internal pull up or pull down for the gpio ports (https://grantwinney.com/using-pullup-and-pulldown-resistors-on-the-raspberry-pi/)? I.E. would these registers be how I set a port to pull either up or down while it is floating? And if so, how does the clock fit in?
0 Answers
Related