PWMx8 object
Jonathan
Posts: 1,023
Hi All,
I am having trouble getting the PWMx8 object to work on pin 13. It seems to have something to do with which pin I am trying to use. If I set the base_pin to 0, I can get PWM out of any pin 0-7. However, if I try to set the based_pin to 8 and get PWM out of 8-15, no joy. Here is the snip. It works fine 0-7, but nothing out of 8-15. The pins are all fine, I can manually twiddle them. The snip below should PWM all of the pins in the bank. For just pin 13 the pin select byte would be %0010_0000
Any ideas what I am doing wrong?
Jonathan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
I am having trouble getting the PWMx8 object to work on pin 13. It seems to have something to do with which pin I am trying to use. If I set the base_pin to 0, I can get PWM out of any pin 0-7. However, if I try to set the based_pin to 8 and get PWM out of 8-15, no joy. Here is the snip. It works fine 0-7, but nothing out of 8-15. The pins are all fine, I can manually twiddle them. The snip below should PWM all of the pins in the bank. For just pin 13 the pin select byte would be %0010_0000
CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000
base_pin = 8 VAR
byte duty
OBJ
pwm : "PWMx8"
PUB init freq := 300 duty := 128 pwm.start(base_pin, %1111_1111,freq) pwm.duty(base_pin,duty) repeat
Any ideas what I am doing wrong?
Jonathan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Airspace V - international hangar flying!
www.airspace-v.com/ggadgets for tools & toys
Thanks!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
Are you using version 1.1 (17 Jul 08) of pwmx8? It fixed some issues related to base pins > 0. The demo program that comes with it uses a base pin of 16.
-Phil
Yes, I am using the latest version. I went ahead and DL'd again just in case, but no luck.
Can anyone try out the code above to make sure it is something I am doing?
Thanks!
Jonathan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
Bingo! Thanks for the help! Much appreciated. Now I can dim the nixie tubes in my clock. [noparse]:)[/noparse]
Jonathan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info - Home of the Hydrogen Fuel Cell Robot