PDA

View Full Version : Pwm



Armando Herjim
- 10th September 2006, 07:03
Hello. If I have 10 bits resolution in pwm I can write the % this way:

1111001101

or it has to be something like this:

1111111000 or
1100000000 or
1111000000

what I mean is: does 1's mean high and 0īs mean low? or i set the value of the % by a binary number like the first I wrote above? Any help?

Thanks

sayzer
- 10th September 2006, 08:11
Did you mean ADC?

I am not quite sure what you meant.

----------------------

Melanie
- 10th September 2006, 09:05
PBP only supports 8-Bit PWM through either the PWM or HPWM commands, however, many PICs do support 10-bit Hardware PWM. If you decide to use HPWM you can set the most significant 8-bits through the HPWM command, and the least significant two bits can be set by accessing the PICs registers directly.

If you need to manipulate your 10-bits, then of course you need a WORD variable, and if you do that in BINARY, DECIMAL or HEX is up to you. But then if you need to set HPWM you'll have to extract the appropriate bits for the HPWM command.

You won't be able to have 10-bit PWM with the software PWM command.