YMMV

* your mileage may vary

Saturday, 28 June 2014

Beaglebone Black (BBB) setting GPIO Pins with devmem2

Access and setting GPIO Pins quickly using devmem2. Get devmem2 source and compile/build.
www.lartmaker.nl/lartware/port/devmem2.c. 
Memory offset of the GPIO registers is required.

GPIO0 0x44E0_7000
GPIO1 0x4804_C000 //P8.11;P8.12;P8.15
GPIO2 0x481A_C000
GPIO3 0x481A_E000

Read the P8.15 Configuration
./devmem2 0x44e1083c
  • Value at address 0x44E1083C (0xb6fd983c): 0x27
Read Pin directions
./devmem2 0x4804C134
  • Value at address 0x4804C134 (0xb6fba134): 0xF60FFFFF
Set P8.15 as output (low)
./devmem2 0x4804c134 w 0xF60F7FFF
  • Value at address 0x4804C134 (0xb6f9f134): 0xF60F7FFF
Read Pin Value
./devmem2 0x4804c194
  • Value at address 0x4804C194 (0xb6fc4194): 0x8809000
Set pin P8.15 high
./devmem2 0x4804c194 w 0x8000
  • Written 0x8000; readback 0x8809000
Set pin P8.15 low
./devmem2 0x4804c190 w 0x8000
  • Written 0x8000; readback 0x8801000

No comments:

Post a Comment