Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

pmw on orange pi one isn't 3.3v in magnitude!

Featured Replies

Hello all,

 

I used using opi one with (Armbian_5.90_Ubuntu_bionic_4.19.57) image. and used the uart0 pins for hardware pwm but the output was around 330mv pwm not 3.3v as i want.

my initial thoughts was either the uart0 isn't disabled or there are no pull ups activated, although i tryed using this: https://github.com/iboguslavsky/pwm-sunxi-opi0

Remap pins in FEX:

; Disable debug

UART0 [uart_para]

uart_debug_port = 0

uart_debug_tx = port:PA04<2><1>

uart_debug_rx = port:PA05<2><1>

 

; Enable PWM0 on PA05

[pwm0_para] pwm_used = 1

pwm_positive = port:PA05<3><0>

 

but there is no FEX but DTB files and i didn't know how to disable uart0 and activate pwm in DTB/DTS files.

 

so how can i get a 3.3v pwm on uart0 (hardware pwm) ?

7 minutes ago, Younes_Thabet said:

but there is no FEX but DTB files and i didn't know how to disable uart0 and activate pwm in DTB/DTS files.

You need to decompile DTB into DTS, edit the DTS by changing "status" from "okay" to "disabled" for uart0 node and vice-versa for pwm node, then recompile DTS into DTB and reboot.

  • Author
23 minutes ago, martinayotte said:

You need to decompile DTB into DTS, edit the DTS by changing "status" from "okay" to "disabled" for uart0 node and vice-versa for pwm node, then recompile DTS into DTB and reboot.

I did decompile DTB into DTS, and this is what i found:

 

uart0 {
pins = "PA4/0PA5";
function = "uart0";
phandle = < 0x19 >;
};

 

 

pwm@1c21400 {
compatible = "allwinner,sun8i-h3-pwm";
reg = < 0x1c21400 0x08 >;
clocks = < 0x0e >;
#pwm-cells = < 0x03 >;
status = "disabled";
phandle = < 0x56 >;
};

 

there is no status line in uart0 and all other peripherals (spi i2c i2s ...) i tryed to change the status of pwm to "enabled" but with no luck!?

  • Author
30 minutes ago, martinayotte said:

This is only the pins definition, you need to search for "serial@1c28000" node and change the "status" there ...

i did change the satatus but no luck!!

 I have my pwm and all but it's peak value is around 330mv not 3.3v ...so maybe the problem is with pull-up resistors !? IDK!

30 minutes ago, Younes_Thabet said:

do you have any idea what could be wrong

I think the Main DT doesn't specify the pin PA5, but the /boot/dtb/overlay/sun8i-h3-pwm.dtbo overlay does ...

So, better use that overlay, simply by adding "overlays=pwm" in the /boot/armbianEnv.txt and reboot.

I did some tests on my OPiZero and it worked, adjusting the period and duty-cycle, etc ...

  • Author
32 minutes ago, martinayotte said:

simply by adding "overlays=pwm" in the /boot/armbianEnv.txt and reboot.

It didn't work hahaha, but thanks for your help.

i will post the solution once i get it to work properly.

 

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.