xistor 910619de4c fix missing semicolon | 1 år sedan | |
---|---|---|
.. | ||
Makefile | 5 år sedan | |
Makefile.clang | 2 år sedan | |
Makefile.gcc | 2 år sedan | |
OLVASSEL.md | 6 år sedan | |
README.md | 6 år sedan | |
delays.c | 1 år sedan | |
delays.h | 6 år sedan | |
gpio.h | 6 år sedan | |
kernel8.img | 4 år sedan | |
link.ld | 6 år sedan | |
main.c | 6 år sedan | |
mbox.c | 6 år sedan | |
mbox.h | 6 år sedan | |
start.S | 3 år sedan | |
uart.c | 3 år sedan | |
uart.h | 6 år sedan |
It is very important to wait precise amounts of time while you're interfacing with low level hardware. In this tutorial we'll cover there ways. One is CPU frequency dependent (and useful if wait time is given in CPU clock cycles), the other two are microsec (millionth of a second) based.
wait_cycles(n)
this is a very straightforward thing, we execute the 'nop' instruction n times.
wait_msec(n)
this implementation uses ARM system registers (available on all AArch64 CPUs).
wait_msec_st(n)
is a BCM specific implementation, which uses the System Timer peripheral (not available on qemu).
We use different wait implementations between printing strings on serial console.