david43
Newbie level 3
- Joined
- Dec 12, 2012
- Messages
- 4
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,311
Hi all,
How to change the pwm to rc3 or other place??
now it is using the rc2.
i find PSTRCON to change the port
but it not work and can't build it.
i find pic 18f4550 datasheet but seem not have PSTRCON register
How to change the pwm to rc3 or other place??
now it is using the rc2.
i find PSTRCON to change the port
but it not work and can't build it.
i find pic 18f4550 datasheet but seem not have PSTRCON register
PHP:
#include <pic18.h>
__CONFIG(1,HS&CPUDIV1) ;
__CONFIG(2,WDTDIS) ;
__CONFIG(3,PBADDIS) ;
__CONFIG(4,XINSTDIS) ;
unsigned char pwmbuf;
void main(void)
{
OSCCON=0X00;
ADCON1=0X0f;
TRISC=0B00000000;
PORTC=0B00000000;
CCP1CON=0xc;
PR2=63;
T2CKPS1=0;
T2CKPS0=0;
TMR2ON=1;
//PSTRCON=0b00000100;
pwmbuf=0;
CCPR1L=pwmbuf;
while(1)
{
pwmbuf++;
CCPR1L=pwmbuf;
if(pwmbuf==100)
pwmbuf=0;
}
}
}
Last edited: