Jump to content
  • 0

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


Younes_Thabet
 Share

Question

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) ?

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0
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.

Link to comment
Share on other sites

Search Before Posting!

  • 0
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!?

Link to comment
Share on other sites

  • 0
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!

Link to comment
Share on other sites

  • 0
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 ...

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...