Skip to content

Open Drain Output - can't change frequency #36

@calcut

Description

@calcut

I'm trying to change the output frequency of OD2 using megaind command line.
I have an oscilloscope hooked up and can see a frequency of ~6.37kHz, looks to be the maximum.

I try to change the frequency to 1kHz like this:

testrig@testrig:~ $ megaind 0 odfwr 2 1000
done
testrig@testrig:~ $ megaind 0 odfrd 2
1000

But no change, stuck at max frequency.

To confirm I'm looking at the correct output I can run commands like this and see the duty cycle changing no problem

testrig@testrig:~ $ megaind 0 odwr 2 59
done
testrig@testrig:~ $ megaind 0 odwr 2 50
done

I also noticed that the tool won't let me change OD4. only 1..3.
Not an issue in my application but it makes me wonder if this feature has escaped testing?

testrig@testrig:~ $ megaind -h odfwr
	odfwr:		Write open-drain output PWM frequency value (10..6400Hz)
	Usage:		megaind <id> odfwr <channel[1..3]> <value[10..6400]>
	Example:		megaind 0 odfwr 2 250; Set PWM frequency of 250Hz for open-drain output channel #2 on Board #0

testrig@testrig:~ $ megaind 0 odfwr 4 1000
Invalid Open-drain channel for frequency change, must be 1..3!

I have megaind v1.1.8 (latest from github) And I've just updated the firmware on my Industrial Automation HAT (v3)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions