Hardware Reference
In-Depth Information
Solution
The solution is to use a simple utility called devmem2 , with which you can read and write
registers from the command line.
WARNING
This solution is much more involved than the previous ones. You need to understand binary
and hex numbers and be able to read the AM335x Technical Reference Manual .
First, download and install devmem2 :
bone# wget http://free-electrons.com/pub/mirror/devmem2.c
bone# gcc -o devmem2 devmem2.c
bone# mv devmem2 /usr/bin
This solution will read a pushbutton attached to P9_42 and flash an LED attached to
P9_13 . Note that this is a change from the previous solutions that makes the code used
here much simpler. Wire up your Bone as shown in Figure 8-2 .
Search WWH ::




Custom Search