-
Notifications
You must be signed in to change notification settings - Fork 1
GPIO Output Test
Kshitij Sharma edited this page Mar 2, 2022
·
1 revision
The deadman switch requires a square wave at a frequency of 100Hz. This test was conducted to ensure the Arduino UNO and BeagleBoneBlack were both able to output a wave at the required frequency.
unsigned int freq = 0;
int sqwPin = 13;
void setup() {
Serial.begin(9600); // Serial Port Baud = 9600 8,N,1
}
void loop() {
while (Serial.available() > 0) {
char tmpChar = Serial.read();
if (isDigit(tmpChar)) {
freq = (freq * 10 ) + tmpChar - '0';
}
if (tmpChar == '\n' || tmpChar == '\r') {
if (freq > 0) {
Serial.print(freq);
Serial.println(" Hz Sqw");
tone(sqwPin, freq);
}
freq = 0;
}
}
}
- Connect Oscilloscope to Pin 13 on the Arduino and GND.
- Flash Arduino with sketch
- Enter required frequency via the serial monitor
Frequency | Output |
---|---|
75 | ✓ |
100 | ✓ |
250 | ✓ |
500 | ✓ |
1000 | ✓ |
2500 | ✓ |
var_count=0
repeat=1000
while [ $var_count -lt $repeat ]
do
echo 1 > /sys/class/gpio/gpio88/value
sleep 0.005
echo 0 > /sys/class/gpio/gpio88/value
let 'var_count+=1'
if [ $var_count -ge $repeat ]
then
echo "Test Completed"
fi
done
- Connect Oscilloscope to Pin P8_28 (28th pin on the right header) on the BBB and GND.
- Run file as an executable
Frequency | Output |
---|---|
125 | Fluctuations down to 75Hz |
100 | Fluctuations down to 75Hz |
75 | Fluctuations down to 50Hz |
50 | ✓ |
- Home
- How to add and edit pages on the wiki
- Glossary
- Admin
- Projects & Subsystems
- Motor Controllers
- Navigation
- Quality Assurance
- Sensors
- State Machine
- Telemetry
- Technical Guides
- BeagleBone Black (BBB)
- Configuration
- Contributing
- Testing
- Install VM on Mac
- Makefiles
- Reinstall MacOS Mojave
- Travis Troubleshooting
- Knowledge Base