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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
Sasha Jevtic
12/17/05 00:19
Read: 751 times
Barrington, Il
USA


 
#105451 - Assorted small ideas
Responding to: Jon Ledbetter's previous message
Jon Ledbetter said:
Andy Neil said:

Keil has a fine example of ring-buffered interrupt-driven serial IO.


Unfortunately it's C

A section (maybe an appendix) with some serial-related C code might actually be a very nice touch.

Jon Ledbetter said:
Andy Neil said:
You poll to see when the transmitter is ready for the next byte!


That makes sense.

Andy is right. And that said, if you try to write another value into SBUF before the transmission is complete, the transmission becomes corrupted!

And, in other matters. Note that the MAX233 is very similar to the MAX233A; the A version offers a higher slew rate to accomodate port speeds of up to 200000 bps, which is beyond the 115 Kbps speed capable by most PC's built-in serial ports! The non-A version is rated up to 120000 bps, which is quite sufficient for most applications. You might want to mention the non-A version instead of or in addition to the A version, as it is notably cheaper.

I noted that you have several nice test programs on pages 14-15. I'm not suggesting you need more or should change the ones you have, but my favorite first test for serial functionality is the U-test, primarily because it makes it very easy to see baud rate errors using an osilloscope. Here is an excerpt from an old e-mail I wrote to my class once:

An old e-mail I wrote said:
...consider temporarily adding the following code to your program immediately following the serial port initialization:
tstlp: mov sbuf,#h'55
serwt: jnb scon.1, serwt
       clr scon.1
       sjmp testlp
This code repeatedly writes 0x55 over the serial port, which just so happens to be the printable ASCII character "U". The choice of value is significant for two reasons; first, by being a printable ASCII, you can use any serial communication program (i.e., Hyperterminal, which is included with Windows) to listen to your serial port (19200 bps, 8 data bits, no parity, 1 stop bit, no flow control), and you should see your screen quickly fill up with a screen of "U" characters. This value is also significant because the serial representation of 0x55 (even when surrounded by the start and stop bit) creates a waveform in which every bit alternates. Thus, examining this waveform on the scope should yield a square wave with 50% duty cycle and a period of 19200/2 = 9600 Hz; both duty cycle and frequency are easy to measure with the scopes in the lab.

Obviously, we were using 19200 bps for this project, but the concept applies at any speed.

--Sasha Jevtic

List of 46 messages in thread
TopicAuthorDate
Feedback needed        Jon Ledbetter      12/12/05 13:29      
   Couple of ideas      Sasha Jevtic      12/12/05 14:24      
   Missing      Andy Neil      12/12/05 15:28      
      the source...      Jan Waclawek      12/12/05 16:10      
         Stupid EIA      Andy Neil      12/13/05 00:52      
      Maybe a Name change?      Jon Ledbetter      12/12/05 22:30      
         minor but annoying ...      Richard Erlacher      03/17/06 09:33      
   USB      Ian Bell      12/12/05 16:06      
      Limited Experience      Jon Ledbetter      12/12/05 22:43      
      known bad USB/serial      Jan Waclawek      12/13/05 01:56      
      FYI - Targus PA088      Jon Ledbetter      12/13/05 09:46      
   thoughts      Jan Waclawek      12/12/05 16:17      
      I am so stupid      Jan Waclawek      12/13/05 02:02      
         Kickstart      Jon Ledbetter      12/13/05 07:36      
   attribution      Steve M. Taylor      12/13/05 03:41      
   The ONE thing I always have to look up a      Erik Malund      12/13/05 08:03      
   Ok - Second revision, but still working,      Jon Ledbetter      12/15/05 14:16      
      Nice      Steve M. Taylor      12/15/05 15:12      
         OK      Jon Ledbetter      12/15/05 15:33      
         MAX202 vs. MAX232A      Jan Waclawek      12/16/05 02:32      
         or the 232A      Erik Malund      12/16/05 06:32      
      Polled; Interrupt      Andy Neil      12/16/05 00:39      
         polled tx      Jon Ledbetter      12/16/05 07:48      
            Assorted small ideas      Sasha Jevtic      12/17/05 00:19      
               Not a good idea      Kai Klaas      12/17/05 06:46      
                  Serial speeds?      Sasha Jevtic      12/17/05 08:41      
                     Enhanced specifications      Kai Klaas      12/18/05 06:38      
                        That's a strange spec      Sasha Jevtic      12/20/05 15:04      
      formal stuff      Jan Waclawek      12/16/05 02:59      
         formal      Jon Ledbetter      12/16/05 08:23      
            who's the intended audience      Jan Waclawek      12/16/05 09:15      
   3rd Revision      Jon Ledbetter      12/27/05 08:47      
      Busy?      Jon Ledbetter      01/03/06 12:23      
         more than a couple of comments...      Jan Waclawek      01/04/06 16:27      
            So.....      Jon Ledbetter      01/05/06 15:01      
               what I like or not...      Jan Waclawek      01/06/06 08:25      
                  comments      Jan Waclawek      02/28/06 05:18      
                     Comments on Comments      Jon Ledbetter      02/28/06 09:37      
                        bah...      Jan Waclawek      02/28/06 11:25      
                           more problems      Jan Waclawek      02/28/06 13:20      
                              RE: Problems      Jon Ledbetter      02/28/06 13:36      
                              Something Strange      Jon Ledbetter      02/28/06 13:57      
                                 Nope....      Jon Ledbetter      02/28/06 14:28      
                                    interrupt      Jan Waclawek      02/28/06 15:30      
   All members will enjoy      Ralph Sack      03/16/06 21:55      
   Intel serial intro app note      Sasha Jevtic      03/28/06 15:16      

Back to Subject List