There are two assembly instructions that can be used to toggle individual bits.
F is the register, b is the bit. Don't refrene the bit directly use the labels from your include file for the CCP!CON register.
BCF f,b Bit clear, bit is indexed 0 to 7
BSF f,b Bit set
To get an answer to this question, you need to define "terribly" first. You will lose two bits of resolution, how bad it would be depends on application.
To get an answer to this question, you need to define "terribly" first. You will lose two bits of resolution, how bad it would be depends on application.
Felis, the whole idea is to make a sinusoidal pwm controller for a UPS. If we want a THD of less than say 5% (after filtering of course) can we ignore the two bits without much ado?
Why do these Microchip guys even have to separate the two bits from the CCPR1L register? It makes for a larger number of instructions just to completely define a pwm duty cycle.
Please reference me a suitable programmer for the 18f252.
I still wish to know if I can modify bits 5:4 of CCP1CON in just one operation. You see, the problem is I have stored in flash memory the values that have to be fed to CCP1CON<5:4> but still dont know how to modify these bits without touching the others. Thorn in the flesh...
There are two assembly instructions that can be used to toggle individual bits.
F is the register, b is the bit. Don't refrene the bit directly use the labels from your include file for the CCP!CON register.
BCF f,b Bit clear, bit is indexed 0 to 7
BSF f,b Bit set
Thanks Sceadwian,
But I still have a hitch. I have stored in flash memory the value supposed to go in to CCP1CON <5:4>. But I don't know how to feed in this value without crushing the other bits.
Sceadwian I also need to know if the PICDEM MC development board can serve as a programmer. That is I write asm code in MPLAB IDE and load it into the microcontroller using PICDEM MC.
Thanks for your patience
ed
Felis, the whole idea is to make a sinusoidal pwm controller for a UPS. If we want a THD of less than say 5% (after filtering of course) can we ignore the two bits without much ado?
If you care about THD, use all ten. They are upper bits; if you generate a sine wave, you would never need to change more than one of those in consecutive cycles anyway.
Why do these Microchip guys even have to separate the two bits from the CCPR1L register?
I still wish to know if I can modify bits 5:4 of CCP1CON in just one operation. You see, the problem is I have stored in flash memory the values that have to be fed to CCP1CON<5:4> but still dont know how to modify these bits without touching the others. Thorn in the flesh...
Hi again,
I bought the PICDEM MC LV Development Board from Microchip for 18f devices, only to realise later that my PIC 18f252 is not listed in their reference document. They mentioned the 18f2431. I have looked at the pinouts of the the two PICs and they are almost identical. However, the 2431 has certain pin functionalities that are absent in the 252.
Is it possible to program the 252 with this very Development board?
Thanks for your patience.
Ed