BeagleBone Black Pin Mode Configuration?

Hi everyone,

I am trying to set the P8_11 through P8_19 pins of the BeagleBone Black headers to “MODE 1” on the pinout chart, which will output more LCD_DATA signals, which I need for a 24-bit display. In its default configuration, the BeagleBone Black only has 16 LCD_DATA pins, however, it appears the other 8 LCD_DATA pins can be accessed in “MODE 1”.

Is there a way to configure these pins to MODE 1 without having to write overlay code?

I believe there is a utility called “config-pin”, which can display the information of each pin.

In the command line, I entered “config-pin -l P8_11”. This listed various GPIO information, however, I didn’t see any options for LCD_DATA or HDMI. Is there something I’m missing?

Thank you in advance!

You are correct, the HDMI pin-mux options are not available in
config-pin, it's best to setup an overlay..

Regards,

Hi Robert,

How would I go about setting up an overlay that would set these pins to MODE 1? Is there a step-by-step guide on how to write the overlay and where to save it?

Thank you

https://github.com/beagleboard/bb.org-overlays/blob/master/src/arm/BB-BONE-NH7C-01-A0.dts#L110-L117

Regards,

Hi Robert,

What do I do with this file? Where do I save it/compile it? Will my HDMI port still work once this overlay is used?

Thank you

The BeagleBoard Overlays are located here:

https://github.com/beagleboard/bb.org-overlays

On your Beagle run:

git clone https://github.com/beagleboard/bb.org-overlays
cd ./bb.org-overlays/

To Buid them all run:
make

To install them all run:
sudo make install

This is the list of all current ones:
https://github.com/beagleboard/bb.org-overlays/tree/master/src/arm

This is a 24bit lcd example:

https://github.com/beagleboard/bb.org-overlays/blob/master/src/arm/BB-BONE-NH7C-01-A0.dts

Here are the docs on how to load specific overlays in u-boot:

https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_Overlays

Regards,

That depends, if you touch any of the LCD pins the HDMI port using,
you could lose video on HDMI.

But your question is missing important details, which pins/etc., i
can't reply with yes or no..

Regards,

Since I’m only looking to enable 24-bit LCD_DATA, I don’t need to build them all correct? If I were to do this offline, would I simply save the overlay in the home directory and then “make” it with a specific command?

Sorry if these questions are trivial.

Hi Robert,

voodoo@x1-am57xx-beagle-x15-2gb:~/bb.org-overlays$ make help
Targets:
  all: Build all device tree binaries for all architectures
  clean: Clean all generated files
  install: Install all generated files (sudo)

  all_<ARCH>: Build all device tree binaries for <ARCH>
  clean_<ARCH>: Clean all generated files for <ARCH>
  install_<ARCH>: Install all generated files for <ARCH> (sudo)

  src/<ARCH>/<DTS>.dtbo Build a single device tree binary

Architectures: arm
voodoo@x1-am57xx-beagle-x15-2gb:~/bb.org-overlays$

Regards,

Pins P8_27 thru P8_46 are "enabled" as an 16bit color interface thru
the hdmi... You can enable MODE 1 on those other pins but it won't
change a thing as it's configured for 16bit mode...

If you want 24bit, you need to disable the hdmi interface

https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_Disable_on-board_devices

disable_uboot_overlay_video=1

and create your own 24bit overlay or use the example i showed you.

Regards,

Hi Robert,

Once again, thank you for this information.

I wanted to give you and anyone else in my situation an update on this matter. I was able to successfully disable the HDMI interface by going into nano /boot/uEnv.txt and commenting the “disable_uboot_overlay_video=1” line.

The next thing I looked into was using the 24-bit overlay example mentioned previously and linked here: https://github.com/beagleboard/bb.org-overlays/blob/master/src/arm/BB-BONE-NH7C-01-A0.dts

After several hours of research, I discovered that the .dto of this overlay was already on the BeagleBone Black. I then tried adding this .dto file into the uEnv.txt file and rebooted the Beagle. I powered it on and tried probing some of the LCD_DATA pins with an o-scope and didn’t get anything. Did I do something wrong?

I would also like some help modifying this overlay for other requirements. I simply only want to unlock the full 24-bit LCD_DATA lines of the Beagle. My display that I want to connect has a resolution of 640x480. It is not a touchscreen and I do not need backlight control as I have an external backlight driver. In this file, I also see display settings such as fronporch, backporch, hsync, vsync, and clock, which by looking at the datasheet of my display is 25MHz**.** How to I get these other values for my display?

I understand that once the overlay is written, I use the dtc command to compile a .dto file, which is then placed somewhere in uEnv.txt (I believe).

Lastly, is there anyway to test that the overlay is in place and working? Until now, I simply connect an o-scope to see signals such as clock.

Again, thank you in advance!

Hi Robert,

Once again, thank you for this information.

I wanted to give you and anyone else in my situation an update on this matter. I was able to successfully disable the HDMI interface by going into nano /boot/uEnv.txt and commenting the "disable_uboot_overlay_video=1" line.

The next thing I looked into was using the 24-bit overlay example mentioned previously and linked here: https://github.com/beagleboard/bb.org-overlays/blob/master/src/arm/BB-BONE-NH7C-01-A0.dts

After several hours of research, I discovered that the .dto of this overlay was already on the BeagleBone Black. I then tried adding this .dto file into the uEnv.txt file and rebooted the Beagle. I powered it on and tried probing some of the LCD_DATA pins with an o-scope and didn't get anything. Did I do something wrong?

IDK, let's find out:

sudo /opt/scripts/tools/version.sh

I would also like some help modifying this overlay for other requirements. I simply only want to unlock the full 24-bit LCD_DATA lines of the Beagle. My display that I want to connect has a resolution of 640x480. It is not a touchscreen and I do not need backlight control as I have an external backlight driver. In this file, I also see display settings such as fronporch, backporch, hsync, vsync, and clock, which by looking at the datasheet of my display is 25MHz. How to I get these other values for my display?

Well start with the example and remove things you don't need.

You find them in the datasheet of the glass provider. and then you guess...

I understand that once the overlay is written, I use the dtc command to compile a .dto file, which is then placed somewhere in uEnv.txt (I believe).

Or just copy it to: ./src/arm/ and run make from the bb.org-overlays repo

Lastly, is there anyway to test that the overlay is in place and working? Until now, I simply connect an o-scope to see signals such as clock.

Plug in the lcd? We don't have any simulators.

Regards,

Robert,

I would like to do this offline. What would I run after I copy it to ./src/arm/? Also, which parts of the code do I need keep to avoid any errors? The way I see it, my code would look something like this:

/dts-v1/;
/plugin/;

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pinctrl/am33xx.h>
#include <dt-bindings/board/am335x-bbw-bbb-base.h>

/ {

/*

  • Helper to show loaded overlays under: /proc/device-tree/chosen/overlays/
    */
    fragment@0 {
    target-path="/";
    overlay {

chosen {
overlays {
BB-BONE-NH7C-01-A0 = TIMESTAMP;
};
};
};
};

/*

  • Free up the pins used by the cape from the pinmux helpers.
    /
    fragment@1 {
    target = <&ocp>;
    overlay {
    P8_45_pinmux { status = “disabled”; }; /
    lcd: lcd_data0 /
    P8_46_pinmux { status = “disabled”; }; /
    lcd: lcd_data1 /
    P8_43_pinmux { status = “disabled”; }; /
    lcd: lcd_data2 /
    P8_44_pinmux { status = “disabled”; }; /
    lcd: lcd_data3 /
    P8_41_pinmux { status = “disabled”; }; /
    lcd: lcd_data4 /
    P8_42_pinmux { status = “disabled”; }; /
    lcd: lcd_data5 /
    P8_39_pinmux { status = “disabled”; }; /
    lcd: lcd_data6 /
    P8_40_pinmux { status = “disabled”; }; /
    lcd: lcd_data7 /
    P8_37_pinmux { status = “disabled”; }; /
    lcd: lcd_data8 /
    P8_38_pinmux { status = “disabled”; }; /
    lcd: lcd_data9 /
    P8_36_pinmux { status = “disabled”; }; /
    lcd: lcd_data10 /
    P8_34_pinmux { status = “disabled”; }; /
    lcd: lcd_data11 /
    P8_35_pinmux { status = “disabled”; }; /
    lcd: lcd_data12 /
    P8_33_pinmux { status = “disabled”; }; /
    lcd: lcd_data13 /
    P8_31_pinmux { status = “disabled”; }; /
    lcd: lcd_data14 /
    P8_32_pinmux { status = “disabled”; }; /
    lcd: lcd_data15 */

P8_15_pinmux { status = “disabled”; }; /* gpmc_ad15.lcd_data16 /
P8_16_pinmux { status = “disabled”; }; /
gpmc_ad14.lcd_data17 /
P8_11_pinmux { status = “disabled”; }; /
gpmc_ad13.lcd_data18 /
P8_12_pinmux { status = “disabled”; }; /
gpmc_ad12.lcd_data19 /
P8_17_pinmux { status = “disabled”; }; /
gpmc_ad11.lcd_data20 /
P8_14_pinmux { status = “disabled”; }; /
gpmc_ad10.lcd_data21 /
P8_13_pinmux { status = “disabled”; }; /
gpmc_ad9.lcd_data22 /
P8_19_pinmux { status = “disabled”; }; /
gpmc_ad8.lcd_data23 */

P8_27_pinmux { status = “disabled”; }; /* lcd: lcd_vsync /
P8_29_pinmux { status = “disabled”; }; /
lcd: lcd_hsync /
P8_28_pinmux { status = “disabled”; }; /
lcd: lcd_pclk /
P8_30_pinmux { status = “disabled”; }; /
lcd: lcd_ac_bias_en */

P8_18_pinmux { status = “disabled”; }; /* lcd: enable */

P9_14_pinmux { status = “disabled”; }; /* pwm: ehrpwm1a */

P9_27_pinmux { status = “disabled”; }; /* ft5336: gpio3_15 */
};
};

bb_lcd_lcd_pins: pinmux_bb_lcd_lcd_pins {
pinctrl-single,pins = <
/*LCD enable /
BONE_P8_18 (PIN_OUTPUT_PULLUP | MUX_MODE7) /
gpmc_clk_mux0.gpio2_1 */

BONE_P8_45 (PIN_OUTPUT | MUX_MODE0) /* P8_45: lcd_data0.lcd_data0 /
BONE_P8_46 (PIN_OUTPUT | MUX_MODE0) /
P8_46: lcd_data1.lcd_data1 /
BONE_P8_43 (PIN_OUTPUT | MUX_MODE0) /
P8_43: lcd_data2.lcd_data2 /
BONE_P8_44 (PIN_OUTPUT | MUX_MODE0) /
P8_44: lcd_data3.lcd_data3 /
BONE_P8_41 (PIN_OUTPUT | MUX_MODE0) /
P8_41: lcd_data4.lcd_data4 /
BONE_P8_42 (PIN_OUTPUT | MUX_MODE0) /
P8_42: lcd_data5.lcd_data5 /
BONE_P8_39 (PIN_OUTPUT | MUX_MODE0) /
P8_39: lcd_data6.lcd_data6 /
BONE_P8_40 (PIN_OUTPUT | MUX_MODE0) /
P8_40: lcd_data7.lcd_data7 /
BONE_P8_37 (PIN_OUTPUT | MUX_MODE0) /
P8_37: lcd_data8.lcd_data8 /
BONE_P8_38 (PIN_OUTPUT | MUX_MODE0) /
P8_38: lcd_data9.lcd_data9 /
BONE_P8_36 (PIN_OUTPUT | MUX_MODE0) /
P8_36: lcd_data10.lcd_data10 /
BONE_P8_34 (PIN_OUTPUT | MUX_MODE0) /
P8_34: lcd_data11.lcd_data11 /
BONE_P8_35 (PIN_OUTPUT | MUX_MODE0) /
P8_35: lcd_data12.lcd_data12 /
BONE_P8_33 (PIN_OUTPUT | MUX_MODE0) /
P8_33: lcd_data13.lcd_data13 /
BONE_P8_31 (PIN_OUTPUT | MUX_MODE0) /
P8_31: lcd_data14.lcd_data14 /
BONE_P8_32 (PIN_OUTPUT | MUX_MODE0) /
P8_32: lcd_data15.lcd_data15 */

BONE_P8_15 (PIN_OUTPUT | MUX_MODE1) /* P8_15: gpmc_ad15.lcd_data16 /
BONE_P8_16 (PIN_OUTPUT | MUX_MODE1) /
P8_16: gpmc_ad14.lcd_data17 /
BONE_P8_11 (PIN_OUTPUT | MUX_MODE1) /
P8_11: gpmc_ad13.lcd_data18 /
BONE_P8_12 (PIN_OUTPUT | MUX_MODE1) /
P8_12: gpmc_ad12.lcd_data19 /
BONE_P8_17 (PIN_OUTPUT | MUX_MODE1) /
P8_17: gpmc_ad11.lcd_data20 /
BONE_P8_14 (PIN_OUTPUT | MUX_MODE1) /
P8_14: gpmc_ad10.lcd_data21 /
BONE_P8_13 (PIN_OUTPUT | MUX_MODE1) /
P8_13: gpmc_ad9.lcd_data22 /
BONE_P8_19 (PIN_OUTPUT | MUX_MODE1) /
P8_19: gpmc_ad8.lcd_data23 */

BONE_P8_27 (PIN_OUTPUT | MUX_MODE0) /* P8_27: lcd_vsync.lcd_vsync /
BONE_P8_29 (PIN_OUTPUT | MUX_MODE0) /
P8_29: lcd_hsync.lcd_hsync /
BONE_P8_28 (PIN_OUTPUT | MUX_MODE0) /
P8_28: lcd_pclk.lcd_pclk /
BONE_P8_30 (PIN_OUTPUT | MUX_MODE0) /
P8_30: lcd_ac_bias_en.lcd_ac_bias_en */

;
};

};
};

fragment@5 {
target = <&lcdc>;
overlay {
status = “okay”;
blue-and-red-wiring = “crossed”;
};
};

/* NHD-7.0-800480EF-ATXL# */
panel {
status = “okay”;
compatible = “ti,tilcdc,panel”;
pinctrl-names = “default”;
pinctrl-0 = <&bb_lcd_lcd_pins>;
panel-info {
ac-bias = <255>;
ac-bias-intrpt = <0>;
dma-burst-sz = <16>;
bpp = <32>;
fdd = <0x80>;
tft-alt-mode = <0>;
stn-565-mode = <0>;
mono-8bit-mode = <0>;
sync-edge = <0>;
sync-ctrl = <0>;
raster-order = <0>;
fifo-th = <0>;
};
display-timings {
native-mode = <&timing0>;
timing0: 800x480 {
clock-frequency = <45000000>;
hactive = <800>;
vactive = <480>;
hfront-porch = <40>;
hback-porch = <40>;
hsync-len = <48>;
vback-porch = <29>;
vfront-porch = <13>;
vsync-len = <3>;
hsync-active = <0>;
vsync-active = <0>;
};
};
};
};
};
};

UPDATE:

I have successfully loaded the pre-written NH7C .dtbo overlay onto the BBB. The problem I am now facing is compiling my own overlay, based on the NH7C for 24-bit color. When I run the dtc command, I always seem to get the error: Syntax error 5.1-9. FATAL ERROR.

I know I’m missing something, but haven’t come across a solution yet.

Note: I am doing this offline. I simply want to compile my own overlay, copy it into /lib/firmware and add the appropriate line within the /boot/uEnv.txt.

Any commands to fix this issue would be highly appreciated!

Wild guessing here...

  How are you editing the file? Any chance you have a Windows line ending
(<cr><lf>) somewhere?

doing your own overlay files is always a pain in the ass.
yes you make a typo and it barfs and you have no way to know what the real error was
i wish there was a real way to compile them like using gcc where it would toss an
error with a line number.

Hi Dennis,

I’ve been editing the file in Notepad and Visual Studio then copying them over to a nano file saved as .dts. I believe the reason its giving me an error on the “#include” statements is because they need to be pre-compiled somehow, before being turned into .dtbo files. These errors show up even with the original code, leading me to believe that they need to be pre-compiled.

I have no clue how to do this.

Also, would I even need the “#include” lines if I’m just assigning pins P8_11 through P8_19 pins to “MODE 1”???
Thank you

This is very frustrating because I simply want to unlock the full 24-bit LCD_DATA lines on the BeagleBone Black, without the use of any fancy touchscreen or back light stuff. I am a new user and I must say this isn’t very “newbie” friendly as one needs a great deal of knowledge on device tree structures and their underlying details, as well as writing code.

I’m amazed that there isn’t a simpler way to do what I’m trying to do :frowning:

Don't use dtc directly, the example files need to be pre-processed
with cpp, which the makefile in ./bb.org-overlays/ takes care of.

Regards,