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.

Embedded progam with Error.

Status
Not open for further replies.

ROBINMATHAI

Newbie level 2
Joined
Jul 28, 2011
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,299
Sir,there is problem during runnig this program in MPLAB IDE.It is not compiling due to some ERROR.
Kindly please help me for this trouble.Can u please find the output for this program.

PROGRAM:
//USART Transmission. sending the alphabets using an external interrupt.For example;When the switch is pressed for the 1st time transmit letter H,then in the 2nd time transmit R.

#include<pic.h>
#include"Delay.h"
void main()
{
PORTB=0X00;
TRISB=0XFF; //FOR INPUT
PORTC=0X00; // Clear the values of port c
TRISC=0X00; // port c= output
TX9=0; //8bit transmission
TXEN=1; //enabling transmission
SPEN=1; //enabling serial port transmission
SYNC=0; //enable asynchronous mode
SPBRG=129; // load the value 129, if baud rate=9600
BRGH=1; //high speed baud rate
//TRMT=1;
TXIE=1; //enable interrupt
GIE=1; //enable global interrupt
PEIE=1; //enable peripheral interrupt

if(temp1==1)
{
DelayMs(500);
TXREG='H';
DelayMs(500);
}

if(temp2==1)
{
DelayMs(500);
TXREG='R';
DelayMs(500);
}

}

void interrupt isr()
{
if(TXIF==1)
//if(TRMT==1)
{
temp1=1;
temp2=1;
}
}
 

What error did you get?

You have not defined temp1 & temp2 in your code.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top