Ok, I'm not getting the configuration on the Timers right, maybe someone can help me.
Using MPLAB IDE v8.56 / MPLAB C30 C Compiler (pic30-gcc.exe) v3.24
On the p24Fj128GA010 on a Explorer 16 Board I'm using this code to set up a PWM Output and it gives me an output with a frequency of about 1.25KHz (measured on a scope)
But with this Code (same code I thought) on a p24FJ256GB210, I'm not getting any output.
Using MPLAB IDE v8.56 / MPLAB C30 C Compiler (pic30-gcc.exe) v3.24
On the p24Fj128GA010 on a Explorer 16 Board I'm using this code to set up a PWM Output and it gives me an output with a frequency of about 1.25KHz (measured on a scope)
Rich (BB code):
#include <p24FJ128GA010.h>
_CONFIG1( JTAGEN_OFF & GCP_OFF & GWRP_OFF & FWDTEN_OFF & ICS_PGx2)
_CONFIG2( FCKSM_CSDCMD & OSCIOFNC_OFF & POSCMOD_XT & FNOSC_PRI)
void _ISRFAST _T3Interrupt( void){_T3IF = 0;}
int main()
{
T3CON = 0x8010; // This is about 1.25KHz with the Debugger board running at 8MHz
PR3 = 400-1;
_T3IF = 0;
_T3IE = 1;
OC1R = OC1RS = 200;
OC1CON = 0x000E;
while(1);
}
Rich (BB code):
#include <p24FJ256GB210.h>
_CONFIG1( JTAGEN_OFF & GCP_OFF & GWRP_OFF & FWDTEN_OFF & ICS_PGx2)
_CONFIG2( FCKSM_CSDCMD & OSCIOFNC_OFF & POSCMOD_XT & FNOSC_PRI)
void _ISRFAST _T3Interrupt( void){_T3IF = 0;}
int main()
{
__builtin_write_OSCCONL (OSCCON & 0xbf);
RPOR5bits.RP11R = 18; // 18=OC1 RP11
__builtin_write_OSCCONL (OSCCON | 0x40);
T3CON = 0x8010; // This is about 1.25KHz with the Debugger board running at 8MHz
PR3 = 400-1;
_T3IF = 0;
_T3IE = 1;
OC1R =OC1RS=200;
OC1CON1 = 0x000E;
while(1);
}