|
Forum Index : Microcontroller and PC projects : Missing Something Simple(PicoMite)
| Author | Message | ||||
| hitsware2 Guru Joined: 03/08/2019 Location: United StatesPosts: 735 |
SETPIN pin, PWMnx Allocate pin to PWMnx 'n' is the PWM number (0 to 7) and 'x' and is the channel (A or B) The setpin can be changed until the PWM command is issued. At that point the pin becomes locked to PWM until PWMn,OFF is issued. PWM channel, frequency, [dutyA] [,dutyB] PWM channel, OFF There are 8 separate PWM frequencies available (channels 0 to 7) and up to 16 outputs with individually controlled duty cycle. You can output on either PWMnA or PWMnB or both for each channel - no restriction. Minimum frequency is 15Hz. Maximum speed is OPTION CPUSPEED/4 At very fast speeds the duty cycles will be increasingly limited When I : SetPin gp14,pwm7a PWM 7,1000,50,50 I get : [2] PWM 7,1000,50,50 Error : Pin not set for PWM > ???? my site |
||||
| panky Guru Joined: 02/10/2012 Location: AustraliaPosts: 1116 |
@hitsware2 You are setting gp14 for use as PWM7a, yet in your pwm line, you try to set both the A channel and the B channel to 50 percent duty cycle but you haven't defined which pin to use for channel B. If you are not using pin 20 (gp15) for anything else, adding the line SETPIN GP15,PWM7B should fix the problem or loose the second 50 in your PWM line. Cheers, Doug. ... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it! |
||||
| phil99 Guru Joined: 11/02/2018 Location: AustraliaPosts: 2832 |
From Picomite doc a28 "SETPIN 1,PWM0A 'Provisionally allocate pin 1 (GP0) to PWM0A SETPIN 2,PWM0B 'Provisionally allocate pin 2 (GP1) tp PWM0B PWM 0,1000,33,67 'Frequency is 1kHz for PWM0x, PWM0A is 33%, PWM0B is 67% 'The pins are now locked to PWM usage until PWM 0,OFF PWM 0,OFF 'PWM0A and PWM0B are both off and the pins are released" Could it be case sensitive? I don't yet have one to try it. Cross post . Ignore this. Edited 2021-12-05 12:50 by phil99 |
||||
| hitsware2 Guru Joined: 03/08/2019 Location: United StatesPosts: 735 |
That did it .... Thank You ! my site |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |