Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is not 10Khz , please tell me how to set the 10kHz pwm #28

Open
xuhongv opened this issue Nov 1, 2018 · 1 comment
Open

Is not 10Khz , please tell me how to set the 10kHz pwm #28

xuhongv opened this issue Nov 1, 2018 · 1 comment

Comments

@xuhongv
Copy link

xuhongv commented Nov 1, 2018

Because the 1Khz pwm then period = 5000 , so I want the 10kHz pwm , and I set code as:

        pwm_init(500,pwm_duty_init, 4, io_infos);
	pwm_set_duty(10,0);
	pwm_set_duty(500,1);
	pwm_set_duty(51,2);
	pwm_set_duty(102,3);
	pwm_start();`

but show result : (is not 10Khz , please tell me how to set the 10kHz pwm )

22

@LeisureLadi
Copy link

Dear Xuhongv, I recommend you check all timing parameters! Your duty cycle should be 2% for channel 0 but it is 1,84% only. In order to correct this you need to modify the delays busy loop. More appropriate values are listed in the thread "160 MHz CPU ...".

Hope that helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants