romel_emperado
Advanced Member level 2
- Joined
- Jul 23, 2009
- Messages
- 606
- Helped
- 45
- Reputation
- 132
- Reaction score
- 65
- Trophy points
- 1,318
- Location
- philippines
- Activity points
- 6,061
values is 511. So there is the value you need to put into the CCPRxL:CCPxCON<5:4>, 10-bits to generate a 50/50 PWM.
the MSB of CCPR1L is 512 right but since we have a 50% duty cycle 1023/2 = 511.5 ..
if I will round it off into 512 I I will not set anymore the CCPRxL:CCPxCON<5:4> right? then the value of my CCPR1L will be 0b10000000xx ?
If I dont want to round it up then I shoul use the 511.5 value.. I stll dont get it how to utilize the 2 LSB bits.. hehe
correct?? how about the 0.5 ? hehe
I hope im correct... hehe
The maximum PWM resolution (bits) for a given PWM
frequency is given by the equation:
today Im doing business to my fellow students and hobbyist to have extra income... hehe
1100 = PWM mode: P1A, P1C active-high; P1B, P1D active-high
1101 = PWM mode: P1A, P1C active-high; P1B, P1D active-low
1110 = PWM mode: P1A, P1C active-low; P1B, P1D active-high
1111 = PWM mode: P1A, P1C active-low; P1B, P1D active-low
Remove the motor and just observe the duty cycle with an oscilloscope. If it is still too slow, remove the transistor and MOSFET and observe output at the PIC output. Most programs are heavy loads and very few will run in real-time due to the large number of calculations involved and also because Proteus is a single-threaded application
To output another PWM on another pin, you can use CCP2. There are 2 CCP modules in 18F4550. So, you can use registers CCP2CON, CCP2RL. But the time-base, PR2, will be the same. So, PWM on both pins will be at the same frequency. You can also use the ECCP (enhanced CCP) module to output PWM on 2 or 4 pins in half-bridge or full-bridge mode.
Hi,
In the datasheet, it is written as CCPxCON, CCPRxL. x can be 1 or 2. So, this means that CCP1CON and CCP2CON have the same register configuration, difference between 1 and 2. So, set up CCP2 like you set up CCP1 and you'll see that it works fine.
Hope this helps.
Tahmid.
Not by certificate. I learnt electronics with the help of my dad. I am just a student in grade XI. You can call that high school or college.by the way are you an engineer?
I thought those bits will enable my 2nd pwm output.. Im wrong..instead the CCP2CON does.Active high means that the output device turns on when a positive voltage is received. So, at 30% duty cycle at a 100us period, the controller will output 1 or high for 30us and 0 or low for the remaining 70us.
Active low means the the output device turns on when zero voltage is received. So, at 30% duty cycle at a 100us period, the controller will output 0 or low for 30us and 1 or high for the remaining 70us.
Isn't this similar to what you are already selling? I would recommend waiting for a used genuine Microchip ICD2. I have both ICD2 and ICD3s and still used both, I think the ICD2 is a little more rugged.
the first picture show's it clearly..The the photos help you understand the TRIAC/PWM relationship, I'm not sure if they are using a zero-crossing detector in the second example, just remember the PWM in your project should start at the zero-crossing point.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?