RISC-V Assembly Language Programming by Stephen Smith

RISC-V Assembly Language Programming by Stephen Smith

Author:Stephen Smith
Language: eng
Format: epub
ISBN: 9798868801372
Publisher: Apress


GPIO Overview

The Starfive Visionfive 2 has a 40-pin GPIO header. They either provide power or are generally programmable:Pins 1 and 17: Provide +3.3V DC power.

Pins 2 and 4: Provide +5V DC power.

Pins 6, 9, 14, 20, 25, 30, 34, and 39: Provide electrical ground.

Other pins are programmable for general purposes.

The programmable pins can be used for output, whether they output power or not (binary 1 or 0). They can be read to see if power is provided, for instance, if they are connected to a switch.

However, this isn’t all there is to GPIO; besides the functions presented so far, a number of the pins have alternate functions that can be selected programmatically. For instance, pins 3 and 5 can support the I2C standard that allows two microchips to talk to each other.

Also, there are pins that can support two serial ports to connect to radios or printers. In addition, there are pins that support Pulse Width Modulation (PWM) and Pulse-Position Modulation (PPM) that convert digital to analog and are handy for controlling electric motors.

For the first program, Linux will do the heavy lifting, which is typical for how to control hardware when there is a device driver available.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.