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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/02/09 01:41
Modified:
  04/02/09 01:54

Read: times


 
#164199 - I wouldn't use serial transmission interrupts
Responding to: ???'s previous message
As the send baud rate (DMX-512) is so much higher than the receive baud rate (Midi) I would check the RI flag by polling after each sent DMX-512 data byte (frame):

Poll RI before sending the string, if RI=0 set TXD=0 for 88µsec, set TXD=1 for 8µsec, poll RI, if RI=0 move start byte into SBUF, poll TI until TI=1, afterwards clear TI and poll RI, if RI=0 move first DMX-512 data byte into SBUF, poll TI until TI=1, afterwards clear TI and poll RI, if RI=0 move second DMX-512 data byte into SBUF, and so on...

By this scheme there's no chance that a received Midi byte gets lost, because a Midi data byte needs 320µsec, while a DMX-512 data byte only needs 44µsec. Even the reset pulse only lasts 88µsec.

If in the scheme above once RI=1 is found, clear RI, move the received Midi data byte waiting in the SBUF register to a free location in the RAM and send the next DMX-512 data byte.

At the end of transmission of string (all 512 DMX-512 data bytes) you have some Midi data bytes in the RAM waiting for being analyzed and processed.

By the way, I would choose UART Mode 1 operation, where 10 bits are transmitted, 1 start bit, 8 data bits and 1 stop bit. This is directly Midi compatible. For the DMX-512 transmission add a delay of 4µsec after each sent DMX-512 data byte (directly after TI was set high by the UART). By this you add the needed second stop bit of DMX-512 transmission protocol.

Kai

List of 53 messages in thread
TopicAuthorDate
Is possible? AT89S52 with dual serial baud rate            01/01/70 00:00      
   yes...            01/01/70 00:00      
   Use Timer 2...            01/01/70 00:00      
      Can I have both at same time?            01/01/70 00:00      
         you can't have different baudrates...            01/01/70 00:00      
         YES            01/01/70 00:00      
         No, unless...            01/01/70 00:00      
            what registers?            01/01/70 00:00      
               Split-speed common in older times            01/01/70 00:00      
               Timer 2 registers of AT89S52            01/01/70 00:00      
   Where can I read...            01/01/70 00:00      
      Well, in the datasheet!            01/01/70 00:00      
      Tutorials; FAQs            01/01/70 00:00      
   You have two UART's ... Does that give you any ideas?            01/01/70 00:00      
   Timer2 baudrate            01/01/70 00:00      
      unconfuse yourself            01/01/70 00:00      
      What's wrong with page 15 of datasheet?            01/01/70 00:00      
      Trying this...            01/01/70 00:00      
         Have a look at this code example...            01/01/70 00:00      
            This damn 52 think it is a 51 !!!            01/01/70 00:00      
               counterfeit chip?            01/01/70 00:00      
   It is for a Midi to DMX project... new trouble            01/01/70 00:00      
      Alternatives            01/01/70 00:00      
         examples            01/01/70 00:00      
            Options            01/01/70 00:00      
   Found the crystal!            01/01/70 00:00      
      Let's see ... What is wanted here ...            01/01/70 00:00      
         He is already using two timers            01/01/70 00:00      
            Independent UARTs            01/01/70 00:00      
               Crystal seens OK - Could receive Midi.. "partially" send DMX            01/01/70 00:00      
                  Well done!            01/01/70 00:00      
                  Russel Bull... Can you please take a look in my code?            01/01/70 00:00      
                  I wouldn't use serial transmission interrupts            01/01/70 00:00      
                     Makes sense!            01/01/70 00:00      
                        Give this a try...            01/01/70 00:00      
                           Hard to find a place to test.            01/01/70 00:00      
                              Runtime of LCALL...            01/01/70 00:00      
                           stop bits            01/01/70 00:00      
                              TI flag is set at the begin of (first) stop bit!            01/01/70 00:00      
                                 TI/RI setting time            01/01/70 00:00      
                                    TI and RI details...            01/01/70 00:00      
   TI/RI question            01/01/70 00:00      
      what causes a serial int?            01/01/70 00:00      
      More things will happen...            01/01/70 00:00      
         If....            01/01/70 00:00      
            Yes            01/01/70 00:00      
   YEAAAAAAAAH! IT WORKED            01/01/70 00:00      
      Congrats!            01/01/70 00:00      
         Thanks really a lot!            01/01/70 00:00      
   A new challenge! The inverse way!            01/01/70 00:00      
      BREAK detection is lousy!            01/01/70 00:00      
         RB8            01/01/70 00:00      
            RB8 details...            01/01/70 00:00      

Back to Subject List