Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[PIC] PIC18F14K50 unable to set or steer PWM output at P1A

Status
Not open for further replies.

Astralist

Newbie level 5
Joined
Oct 29, 2014
Messages
10
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
134
Hello All,

I'm currently building an interface to HD44780 LCD, and needs PWM to drive the backlight.
For some electrical rules on PCB, i can only set PWM at P1A/RC5, but i'm unable to get it done, even with ISIS Proteus simulation, its outputs nothing.
Here is the code for the PWM for lowest possible frequency, at 48MHz fosc:

Code:
void InitializePWM(void){    
    TRISCbits.TRISC5 = 0;
    CCP1CON = 0b00001100; 
    CCPR1L=0; 
    PSTRCON = 0b00010001; //pulse output at P1A/RC5

    //PWM1CON = 0b10000000;
    //ECCP1AS = 0b00000100;

    T2CON = 0b00000111;
    TMR2 = 0;
    PR2 = 0b11111111;
}

void PWMdc(uint8_t duty){
    CCPR1L = duty;
}

also, when i try to set output at all (P1A, P1B, P1C, and P1D) by setting:

Code:
PSTRCON = 0b00011111;

The PWM outputs on all but P1A. :bang::bang::bang:
What happened here? am i missing something? i've searched all websites and people can actually steer PWM to single pin @ P1A with the code above.

p.s: i'm using USB framework, and i'm sure nothing interfere with timer 2 or RC5 pin.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top