The For loop will take some cycles away from the CPU wouldn;t it?.. the only reason why I am asking this is because whenever I run a FOr loop I have come across some flickering. but never tried the hardware modules before. maybe it works different. Can you explain more why this does not work
The major differerence is because it's an hardware function. In your previous code, you must wait untill key is press/depress this is what cause the flickering. Your pseudo PWM wait for executing the next function. If it's waiting, LED will be Full on or Full of depending where you get the pushbutton action in your FOR TO NEXT loop.
In case of using HPWM, it can have a little flickering when changing duty value... must have great eyes to see it since it's done really fast by PIC.
for the DEFINE, it's usually use to redirect PWM to different PINS of PIC when this one have the ability of.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks