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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/08/06 11:18
Read: times


 
#118007 - strange behaviour
Responding to: ???'s previous message
Let's forget about interrupts for a moment.

Here is code trying to count number of bytes UART received:

#include <reg52.h>
#define uchar unsigned char

void Init (void)
{
TMOD = 0x20;
TL1 = 0xff;
TH1 = 0xff;
TCON = 0x50;
SCON = 0x70;
TR1 =1;
}

void main (void)
{
uchar i=0;
Init();
P2=0;
while(1)
{
if(RI)
{
i++;
RI=0;
P2=i;
}
}
}

I am sending pairs NoteOn NoteOff from MIDIOX (6 bytes) with large pause (few seconds) between the pairs.

After first pair i=1; (?? 6 bytes should be received)
After next pair i=4
then i=7
then i=11, ETC

Note that i do not change on single NoteOn or single NoteOff

Strange isn't it, unless i am missing something obvious?

Thanks

List of 41 messages in thread
TopicAuthorDate
AT89S8252 MIDI Baud Rate            01/01/70 00:00      
   Have you ...            01/01/70 00:00      
      A 12 MHz xtal ...            01/01/70 00:00      
         why deprioritize what can not happen?            01/01/70 00:00      
         AT89S8252 MIDI Baud Rate            01/01/70 00:00      
            AT89S8252 MIDI Baud Rate            01/01/70 00:00      
            My settings from the 80's            01/01/70 00:00      
                I don't see Initialization Problem            01/01/70 00:00      
                  First results            01/01/70 00:00      
                     This could have problems            01/01/70 00:00      
                        strange behaviour            01/01/70 00:00      
                           indentions            01/01/70 00:00      
                           post the .lst or hex            01/01/70 00:00      
                              hex code and problem location            01/01/70 00:00      
                                 6N138            01/01/70 00:00      
                                 PC817            01/01/70 00:00      
                                    Debugging            01/01/70 00:00      
                                 had a look            01/01/70 00:00      
                                    rise/fall times (hair-splitting)            01/01/70 00:00      
                                       you cn't do that            01/01/70 00:00      
                                          PROBLEM SOLVED            01/01/70 00:00      
                                             Great Stuff - Glad it's working            01/01/70 00:00      
                                                next            01/01/70 00:00      
                                                Dark side of
 tags      
      01/01/70 00:00      
                                                   What you are totally missing is t            01/01/70 00:00      
                                                   Interesting ..            01/01/70 00:00      
                                          if you look at me, you will know :)            01/01/70 00:00      
                  My settings from the 80's            01/01/70 00:00      
      Not a "standard" baud rate            01/01/70 00:00      
         Loop back would work because ...            01/01/70 00:00      
   Because it happens later ....            01/01/70 00:00      
   what is your hardware?            01/01/70 00:00      
      hardware            01/01/70 00:00      
         what optocoupler and what are the parts            01/01/70 00:00      
            emmeiG odoC            01/01/70 00:00      
               I was just about to make a suggestion            01/01/70 00:00      
               A suggestion            01/01/70 00:00      
                  Close            01/01/70 00:00      
                     No, by no means are you supposed to beg            01/01/70 00:00      
         Gimme Code            01/01/70 00:00      
         A SCOPE ???????            01/01/70 00:00      

Back to Subject List