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.

i'm stuck.help me please.

Status
Not open for further replies.

texas5

Newbie level 6
Joined
Aug 23, 2008
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,348
hi.i want to command the 120khz carrier that have been generate by the pin rc3/ccp1 of pic16f877a to transmit the signal according to zero crossing detector that create by pin rb0/int of pic16f877a.

this is the coding for the zero crossing interruption:

void interrupt()
{
PORTA = PORTA - 1; //decrement the value on PORTA
INTCON.INTF = 0; //enable new RB0/INT interrupts
OPTION_REG=0;
}

void main()
{
OPTION_REG.INTEDG=1;
TRISA = 0x00; //set all PORTA pins as outputs
PORTA = 0xff; //make all PORTA pins high
INTCON.INTE = 1; //enable RB0/INT interrupts
INTCON.GIE = 1; //enable all un-masked interrupts
}

and here the coding for generate the 120khz:

void main()
{
TRISC = 0 ;

/*
* PWM registers configuration
* Fosc = 8000000 Hz
* Fpwm = 117647.06 Hz (Requested : 120000 Hz)
* Resolution is 6 bits
* Prescaler is 1
* Ensure that your PWM pin is configured as digital output
* see more details on https://www.micro-examples.com/
* this source code is provided 'as is',
* use it at your own risks
*/
PR2 = 0b00010000 ;
T2CON = 0b00000100 ;
CCPR1L = 0b00001000 ;
CCP1CON = 0b00011100 ;
}

i hope somebody can help me...
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top