Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Channel Pulse > 99999 Causes Runtime Error #17

Closed
natjgreen opened this issue Jan 3, 2014 · 2 comments
Closed

Channel Pulse > 99999 Causes Runtime Error #17

natjgreen opened this issue Jan 3, 2014 · 2 comments

Comments

@natjgreen
Copy link

When trying to create a channel pulse greater than 99999 in length a runtime error is returned. The error message also seems to contain errors (the channel number and the max_width). Below is an example that I generated in the python prompt:

import RPIO.PWM as pwm
pwm.setup()
Using hardware: PWM
PW increments: 10us
pwm.init_channel(0, 1000000)
Initializing channel 0...
pwm.add_channel_pulse(0, 18, 0, 99999)
add_channel_pulse: channel=0, gpio=18, start=0, width=99999
init_gpio 18
pwm.add_channel_pulse(0, 18, 0, 100000)
add_channel_pulse: channel=0, gpio=18, start=0, width=100000
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/dist-packages/RPIO-0.10.0-py2.7-linux-armv6l.egg/RPIO/PWM/init.py", line 115, in add_channel_pulse
return _PWM.add_channel_pulse(dma_channel, gpio, start, width)
RuntimeError: Error: cannot add pulse to channel 99999: width_start+width exceed max_width of 0

@metachris
Copy link
Owner

You could try to increase the pulse-width increment granularity to get
longer pulses.

On Fri, Jan 3, 2014 at 6:54 AM, natjgreen notifications@github.com wrote:

When trying to create a channel pulse greater than 99999 in length a
runtime error is returned. The error message also seems to contain errors
(the channel number and the max_width). Below is an example that I
generated in the python prompt:

import RPIO.PWM as pwm
pwm.setup()
Using hardware: PWM
PW increments: 10us
pwm.init_channel(0, 1000000)
Initializing channel 0...
pwm.add_channel_pulse(0, 18, 0, 99999)
add_channel_pulse: channel=0, gpio=18, start=0, width=99999
init_gpio 18
pwm.add_channel_pulse(0, 18, 0, 100000)
add_channel_pulse: channel=0, gpio=18, start=0, width=100000
Traceback (most recent call last):
File "", line 1, in
File
"/usr/local/lib/python2.7/dist-packages/RPIO-0.10.0-py2.7-linux-armv6l.egg/RPIO/PWM/
init.py", line 115, in add_channel_pulse
return _PWM.add_channel_pulse(dma_channel, gpio, start, width)
RuntimeError: Error: cannot add pulse to channel 99999: width_start+width
exceed max_width of 0


Reply to this email directly or view it on GitHubhttps://github.com//issues/17
.

@natjgreen
Copy link
Author

Thanks that works.

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

No branches or pull requests

2 participants