Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
07/19/10 19:40
Read: times


 
#177384 - not it is not language
Responding to: ???'s previous message
Hello,

I do not think it is language, here is my sample code


int com_initialize()
{
// 1. Init serial port
EA = 0; // disable global interrupt mask
SCON1 = 0x50; // set SCI_1 to 8N1, RX enabled
SCON0 = 0x50; // set SCI_0 to 8N1, RX enabled
TMOD |= 0x21; // set timer 1 as Mode 2 and timer 0 as mode 1
TH1 = 0xF7; // 4800 baud rate 16.384 MHz crystal for serial port 1
TR1 = 1; // enable Timer 1
TR0 = 0;
T2CON = 0x30; // use timer2 for serial port 0 baud rate generation, both send snd receive uses timer2
RCAP2H = 0xFF;
RCAP2L = 0x95; // 4800 baud rate for 16.384 MHz crystal
TR_2 = 1; // enable timer 2
ES0 = 1; // Enable Interrupts for SCI_0
ES1 = 1; // Enable Interrupts for SCI_1
// ET0 = 1; // enable timer 0 interrupt
EA = 1; // enable global interrupt mask
// 2. Initiate SCI_1 Tx

TI_0 = 1 ;
TI_1 = 1;
return 0;

}

here is my interrupt service routine

void sci1ISR (void) interrupt 7 reentrant
{
ES1=0;
if ( RI_1) {
gps_data[gps_in] = SBUF1 ;
RI_1 = 0;
gps_in = gps_in + 1;
if ( gps_in == GPS_DATA_SIZE ) {
buffer_filled = 1;
gps_in = 0;
}

}
ES1=1;
#if 0
else if ( TI_1 ) {

SBUF1 = n ;
TI_1 = 0;


}

#endif



}

I am using hardware ( evaluation kit "HSM40 Microcontroller eval kit" from Dallas semiconductor now www.maxim-ic.com , crystal is 16.384 MHz ) designed and developed by Dallas semiconductor
serial port 0 works ( my serial port ISR is similar to serial port 1 ISR )
-Thanks
-Alok Kumar Mishra


List of 38 messages in thread
TopicAuthorDate
Trouble with interrupt driven comms on 80C320 serial port 1            01/01/70 00:00      
   CLR ES1?            01/01/70 00:00      
      Good idea but not the solution            01/01/70 00:00      
         As Erik posted, may be the etc. part            01/01/70 00:00      
   I cant' tell if there is a problem in ...            01/01/70 00:00      
      Which ... are you worrying about?            01/01/70 00:00      
         How about commenting "etc"            01/01/70 00:00      
         please post as is, not all the ...            01/01/70 00:00      
            Again without the conditionals            01/01/70 00:00      
               this is NOT an ISR            01/01/70 00:00      
                  Why will jnb RI,$ screw up?            01/01/70 00:00      
                     stick a state machine in the ISR            01/01/70 00:00      
                        To interrupt or not...            01/01/70 00:00      
                           an example            01/01/70 00:00      
                              Avoid infinite loops like the plague            01/01/70 00:00      
                                 Back to the subject - why won't it interrupt?            01/01/70 00:00      
                                    Serial Port Interrupts            01/01/70 00:00      
                                       Yes, I think I've done this correctly            01/01/70 00:00      
                                          Vector Address...            01/01/70 00:00      
                                             I think I've done this correctly...            01/01/70 00:00      
                                                you had me there            01/01/70 00:00      
                                                   Serial port, not port            01/01/70 00:00      
                                          maybe not            01/01/70 00:00      
                                             ES1 is non-standard            01/01/70 00:00      
                                                probably the most common misumderstanding            01/01/70 00:00      
                                                   Thanks for clarification...            01/01/70 00:00      
                                             It works without interrupts...            01/01/70 00:00      
                                                then ...            01/01/70 00:00      
                                                   Even Better ...            01/01/70 00:00      
                                    maybe it does            01/01/70 00:00      
                                       Two things argue against this...            01/01/70 00:00      
   Dunno, but that's a very useful instruction            01/01/70 00:00      
   Dunno..            01/01/70 00:00      
      I have problem with serial port 1 on ds89c450 (www.maxim-ic            01/01/70 00:00      
         MUCH better description needed            01/01/70 00:00      
            not it is not language            01/01/70 00:00      
               Which register bank are you using?            01/01/70 00:00      
                  yes it works now            01/01/70 00:00      

Back to Subject List