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.

P89c669 Serial Interrupt for UART 1

Status
Not open for further replies.

avineshb006@gmail.com

Member level 3
Member level 3
Joined
Dec 30, 2011
Messages
67
Helped
8
Reputation
16
Reaction score
8
Trophy points
1,288
Location
Chennai
Visit site
Activity points
1,706
Hi All

i had tried to communicate the p89c669 uart1 with the PC with what ever char i had type thatshould display on Hypretrrminal, but hear i am facing problem, in my program i had created the 9600 baudrate using this following(11.0592MHz)

BRGCON = 0x00;
BRGR1 = 0x04;
BRGR0 = 0x7E;
IEN1 = 0x01;

but in serial isr which interrupt number i had to mention.
and S1BUF is not at all receiving any character..

Please Guide me whether i did any wrong..
Code:
#include<reg669.h>

unsigned char c = '\0';

void serial_init()
{
   BRGCON = 0x00;
   BRGR1  = 0x04;
   BRGR0  = 0x7E;
   BRGCON = 0x01;
   IEN1  |= 0x01;
   TI_1   = 1;
   RI_1   = 0;
}
void serial_isr(void) interrupt 7 using 1
{
    if(RI_1)
    {
       c = S1BUF;
       RI_1 = 0;
       TI_1 = 1;
     }
     else if(TI_1)
     {
        if(c != '\0')
            S1BUF = c;
        TI_1 = 0;
      }
}
void main(void)
{
    serial _init();

    while(1){}
}

Thanks in Advance
 

Hi All
i' trying to communicate the p89c669 controller uart1 to pc, and it will working with out the interrupt, but when ever i'm enabling the interrupt it goes blank. please guid me...


Thanks in advance
 

HI Jayanth

In this p89c669 controller there is two uart's, because of that each serial buffer has S0BUF, and S1BUF.
Hear i am able to get char with out using the interrupt, but when i ennable this IEN1 = 0x01, EA = 0, that time it is not at all responding..

THanks in Advance
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top