Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 01:33 28 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : PWM setup Anomaly

Author Message
carlschneider
Senior Member

Joined: 04/08/2023
Location: South Africa
Posts: 158
Posted: 09:40pm 20 Aug 2023
Copy link to clipboard 
Print this post

Hi there

Options and version for reference.

WebMite MMBasic Version 5.07.08b11
OPTION COLOURCODE ON
OPTION CPUSPEED (KHz) 252000
OPTION DISPLAY 41, 140
OPTION WIFI Actiontec1177, **********, PICOE6614103E76
OPTION TCP SERVER PORT 80
OPTION TELNET CONSOLE ON

I had PWM working on GP28 with the following setup


SetPin GP28, PWM6A
Target=50.01
PWM 6,Target, 50


To use the ADC GP26-28 I needed to shift the PWM to another GPIO so I chose GP19 which per v3 WebMite manual Page 9 pinout is PWM1B. The following code refers.


SetPin GP19, PWM1B
Target=50.01
PWM 1, Target, 50


This generates the following error on the console
[21] PWM 1, Target, 50
Error : Pin not set for PWM

The v3 Manual indicates for PWM setup that either channel A or B can be configured for the channels 0 through 8 and in my understanding implies independently, not as a pair or only the A channel of a pair.

If I use the following code

SetPin GP18, PWM1A
Target=50.01
PWM 1, Target, 50

it works just like it should.

As a sanity check I tried

SetPin GP21, PWM2B
Target=50.01
PWM 2, Target, 50


which generates the following error on the console
[21] PWM 2, Target, 50
Error : Pin not set for PWM

While the following code

SetPin GP20, PWM2A
Target=50.01
PWM 2, Target, 50

works like it should.

Has anybody else had similar experiences or is this a bug or am I misreading the manual?

Any help would be appreciated.
Cheers Carl                                                        
Retirement is tough on Hobbies without a day job
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2136
Posted: 10:02pm 20 Aug 2023
Copy link to clipboard 
Print this post

Try this:
SetPin GP19, PWM1B
Target=50.01
PWM 1, Target,, 50
The extra coma sends the output to channel B, otherwise it tries to send it to A.
 
carlschneider
Senior Member

Joined: 04/08/2023
Location: South Africa
Posts: 158
Posted: 10:16pm 20 Aug 2023
Copy link to clipboard 
Print this post

  phil99 said  
Try this:
SetPin GP19, PWM1B
Target=50.01
PWM 1, Target,, 50
The extra coma sends the output to channel B, otherwise it tries to send it to A.


Thanks Phil kept looking right past it and not seeing what I should have. If it was a snake and all that. Your help is much appreciated.
Cheers Carl                                                        
Retirement is tough on Hobbies without a day job
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024