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

Back to Subject List

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


 
#118865 - That's why I want to "fix" it ...
Responding to: ???'s previous message
The Mode 0 serial channel is a strange bird. If you use it in any way that, at the outset, makes sense, you're in for a rude disappointment.

You're right, in that if you write to the SBUF, it takes one system clock before the clock is enabled onto the TXD pin and the first bit onto the RXD pin (transmit mode) it then takes eight clocks for the last bit to appear on the RXD pin and the last clock tick to appear on the TXD pin. On the next cycle, transmission stops, and the interupt bits are updated concurrently with that enable. That means that it takes NINE bit times after loading SBUF to transmit eight bits (see page 12 of the "bible" hardware guide).

However, if you IGNORE the status (interrupt) bit(s) you can help yourself with synchronous transmission by reloading SBUF before the TI becomes true, and exactly eight cycles after the last time you loaded it. It's not clear to me exactly how this impacts the internals of the serial port, but it appears to work. It's worth noting that, if you wait for the TI, the shift clock is stopped at the same time that the last valid data appears on the RXD pin. I'm guessing, and that's all it is, that the internals of the serial port are cleared ahead of the time that they're reset by the write to SBUF. The result is (again, this is a guess) that the status flag(s) are set (though I ignore them) and reset on the same cycle, but in different phases. The result is that one can, IF AND ONLY IF he can write a short enough loop, work his way through a buffer of data, incrementing the DPTR each on pass through the loop, and reload the SBUF at the appropriate time. Testing the loop length, of course, is a time burden.

The first time I allowed my firmware guys to utilize mode 0, I was unaware that the clock stops when the data ends, hence we were in full production before I noticed that time was wasted between bytes. The communication (between two 8051's) succeeded famously, though not in the time I'd calculated. This left me mystified and my colleagues ecstatic. Having worked many times with synchronous communication devices, even having built a number of synchronous devices myself, I couldn't even imagine that one would work in quite this way.

With respect to the O/P's hardware, it should work in very much the same manner as the Mode-0 serial channel, except that there has, so far, been no indication of how he intends to generate the PISO load clock, or the SIPO receive clock, or, for that matter, the shift clock for both. There's also no indication of how fast he wants to go, but, given that he's using serial logic, I'd guess that he wants to work at some rate other than that at which the MCU operates. Until he tells us otherwise, we have to guess. He's certainly not going to get by with just the two devices he's named. Since the Mode-0 port will do more-or-less the same thing as those two device, aside from the timing, etc, and since it will read its own "writing" as will the hardware he's named, I'd say there's at least a chance that he can do this with Mode-0. Of course, it's ruled out if he has only one serial port and is using it for async comm's already.

RE




List of 34 messages in thread
TopicAuthorDate
74hc595/597 connection with c51            01/01/70 00:00      
   Any available port pin            01/01/70 00:00      
   I'd suggest you read the datasheet            01/01/70 00:00      
      little more info as u require richard            01/01/70 00:00      
         start it simple and stupd            01/01/70 00:00      
   bit-bang            01/01/70 00:00      
      problem is ...            01/01/70 00:00      
         talking about standard '51...            01/01/70 00:00      
            That's why I want to "fix" it ...            01/01/70 00:00      
         there is'nt so why do you proselytize f            01/01/70 00:00      
            PC's are async, Mode-0 is not            01/01/70 00:00      
               I know that, but 99.17% of all '51 UART            01/01/70 00:00      
                  Do you know what UART means?            01/01/70 00:00      
                     A resounding NO. I use synchrono            01/01/70 00:00      
                        SPI??? Is that in the "bible"            01/01/70 00:00      
                           no, it is not - but it is a very well de            01/01/70 00:00      
                              You're well into nonsense, now, Erik            01/01/70 00:00      
                              you just ignore the real reason            01/01/70 00:00      
                                 This may be a valid topic, but not here.            01/01/70 00:00      
                                    Whenever you use shift registers for I/O            01/01/70 00:00      
                                       Doesn't SPI have a bunch of "features?"            01/01/70 00:00      
                                          yes, we ARE mixing, both threads touch s            01/01/70 00:00      
                                             I don't want to confuse the O/P ...            01/01/70 00:00      
                                                that would be wrong            01/01/70 00:00      
                                                   I think we've lost the O/P            01/01/70 00:00      
                           this may be the answer to your 'prayers'            01/01/70 00:00      
                              Thanks, but which prayers are those?            01/01/70 00:00      
                                 those for a fast synchronous communicati            01/01/70 00:00      
                                    I don't want to use a commercial chip            01/01/70 00:00      
                                       why not            01/01/70 00:00      
                                          If I want to use SPI, I'll build it in            01/01/70 00:00      
                  Do you know what UART means?            01/01/70 00:00      
                     ^%$#@! I didi it again!            01/01/70 00:00      
   Depends on your needs...            01/01/70 00:00      

Back to Subject List