Jump to content

Recommended Posts

Posted

I'm trying to get a clock signal of 32768 from the GPIO1 D4 pin of the rk3328 CPU, but I haven't been able to.

 

I've tried everything, from `overlay dts` to `armbian-add-overlay`, but I can't get any output.

 

I can set the value to 1 or 0 using the `echo 1 > /sys/class/gpio/gpio60/value` command, but the system doesn't give a clock output.

 

Please help. Thank you in advance.

Posted

The sysfs GPIO interface does not allow you to create clock outputs as-is.

 

You'd do better seeing if that pin can be exposed through the sysfs PWM interface. I know the NanoPi M4V2's fan controller works this way (RK3399), and you can set the duty cycle. But you'd have to check if PWM is supported on that pin, and can be used in the way you're hoping.

 

Failing that, it is possible to bit-bang the GPIO lines yourself if you're willing to write some C code. You can use Kernel Timers for fairly accurate timing, as long as you set High Scheduler Priority and Real Time Scheduler Class.

 

Note that kernel timers only have a user specified resolution of 1ns, so you might not hit that frequency exactly.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines