Raspberry Pi Stand-Alone Programmer

Pages
Contributors: QCPete
Favorited Favorite 10

Better Safe Than Sorry

Logic Levels

At some point during my research I read that the hardware SPI pins on the Raspberry Pi are never supposed to see a logic level higher than 3.3V. Oops! I've been programming 5V targets all day.

I figured it was better safe than sorry. And isn't the whole point of my design to be reliable? So I messed around with the TXB converter for a while, but couldn't get it to work. I had also tried the bi-direcitonal logic level converter and it just worked, so I decided to go that route. Some nice jumper selections were added to the design to choose where I want the target logic level to come from.

Restarting / Shutting Down a Headless Pi Using Python

Another thing that came up on this HAT design, was how to properly shut down the Raspberry Pi from the Python module. Ah yes, it was just another Google search away:

language:python
def restart():
    command = "/usr/bin/sudo /sbin/shutdown -r now"
    import subprocess
    process = subprocess.Popen(command.split(), stdout=subprocess.PIPE)
    output = process.communicate()[0]
    print output