I remember that PWM register now - it's a while since I last used a PIC.I'm taking advantage of the fact that the hardware allows a left justified 10 bit word to control the PWM duty cycle. The bottom 6 bits are ignored. fine_duty_ctr is a 4 bit counter that decides when bit 7 of the PWM is toggled to a 1.
Sorry, it is 16F18313 I have Pickit 2 & 3, P3 requires powering up in the right sequence, in order to get it to connect in v8.92.Microchip doesn't make a PIC 16F18131. Perhaps you could recheck that part number.
I can compile the code in V5.35, just that I cannot find any way to use what in V8.92 is the 'Watch' screen to monitor registers etc while stepping thro code.Max, I suppose you're used to working in assembly, but I can't imagine programming without a compiler.
The only reason I am using the eight pin 16f18313 for PWM, is I need to re-assign the PWM output to different pins each few seconds.I've never used the PWM module in these microcontrollers so now you've given me a reason to dim the lights with it. cool.
You can add a register from menu Debug>New Watch. You can also view PIC memories under Window>Pic Memory viewsI can compile the code in V5.35, just that I cannot find any way to use what in V8.92 is the 'Watch' screen to monitor registers etc while stepping thro code.
There's so many different things you can do with PWM from playing simple audio clips to modifying the audio attack, level, decay profile of a simple fixed frequency buzzer for different types of chirps or clicks.I've never used the PWM module in these microcontrollers so now you've given me a reason to dim the lights with it. cool.