RPOR15bits.RP30R = 1; meaning

(instructions, reset, WDT, specifications...) PIC17Cxx, PIC18Fxxx

Re: RPOR15bits.RP30R = 1; meaning

Postby Manoj » Thu Jul 11, 2019 7:56 am

Though I am using system clock.//OC1CON1bits.OCTSEL = 0b111;
Say I am using timer 3 for now .
Then when TMR3=pR3 timer rolls over.
So now what technique should I use ?
//This one definitely does no work
if(TMR3==pR3)
{
OC1RS =25000;
OC1R = (25000/2);
}
Manoj
 
Posts: 36
Joined: Mon Apr 09, 2018 8:01 am

Re: RPOR15bits.RP30R = 1; meaning

Postby ric » Thu Jul 11, 2019 8:04 am

Use the TMR3 rollover interrupt.
Latest test project, an LED matrix display made from one reel of addressable LEDs. here
User avatar
ric
Verified identity
 
Posts: 491
Joined: Sat May 24, 2014 2:35 pm
Location: Melbourne, Australia
PIC experience: Professional 5+ years with MCHP products

Re: RPOR15bits.RP30R = 1; meaning

Postby Manoj » Fri Jul 12, 2019 10:06 am

Ok I did it. Now its stable
Code:-
void __attribute__((__interrupt__, auto_psv)) _ADC1Interrupt( void )
{
if (IFS0bits.AD1IF)
{
IFS0bits.AD1IF = 0;
if (FReadings==AVGNO)
{
// PWMpreiod=16000000/(c*64);
OC1RS = (int)(PWMpreiod-1); // PWM period
OC1R = (int)((PWMpreiod/2)-1 ); //50% initial duty cycle
FilterFlag=FALSE;
}
}
Thanks.
Manoj
 
Posts: 36
Joined: Mon Apr 09, 2018 8:01 am

Re: RPOR15bits.RP30R = 1; meaning

Postby Manoj » Wed Jul 17, 2019 12:48 pm

When I am using Dso to view the PWM ,It is shaking a lot .Is this supposed to Happen?
Thank you.
Manoj
 
Posts: 36
Joined: Mon Apr 09, 2018 8:01 am

Previous

Return to 16-Bit Core

Who is online

Users browsing this forum: No registered users and 2 guests