4/20/2021 0 Comments Beaglebone Black Gpio Interrupt
Note that the BeagleBone White pinouts are different from the BeagleBone Black.A lot of frustration may come from not knowing this sometimes when it appears that all should be working, it does not.
The microcontroller needs to be reconfigured to enable some of the pin modes. To understand what may be available, you need to study table 10 on page 70 for the P8 header and table 11 on page 72 for the P9 header in the BeagleBone Black System Reference Manual. Pay close attention to which header is P8 and which is P9 (page 68) because they feel backwards to me. Referencing page 72 mode 7 column, it shows pin 12 to be gpio128, pin 14 to be gpio118, pin 15 to be gpio116, pin 16 to be gpio119. All of these pins are on the gpio1 controller ( gpiochip32 ). To get to the GPIO number that should be exported from the kernel, we must add on 32 to each GPIO (64 for gpio2, and 96 for gpio3 ). I will just do all the math here and we will refer to them by the kernel nomenclature and stop with the gpio1x business as it gets confusing. To make this example easy to follow, I am just going to use bash scripts, but all of the same principles apply to the file manipulation APIs in your favorite language. To do so, we need to copy the gpio number we want to export into the kernel gpiolib sysclassgpioexport file. Beaglebone Black Gpio Interrupt Manual For AllI suggest you read the Linux GPIO Interfaces manual for all of the details. I am only covering the basics here, and the Linux GPIO Interfaces manual is a very important read to understanding Linux gpio control. It does not make sense to configure anything else ahead of this and as far as I know, the kernel doesnt let you do anything else with it until you set the gpio as input or output. For outputs there is an alternative nomenclature where output direction can be set instead as high or low to help with glitch free operation. It is kind of cool to watch if you hook relays up to the board.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |