??? 12/17/05 07:19 Read: times |
#105451 - Assorted small ideas Responding to: ???'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 testlpThis 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 |
Topic | Author | Date |
Feedback needed | 01/01/70 00:00 | |
Couple of ideas | 01/01/70 00:00 | |
Missing | 01/01/70 00:00 | |
the source... | 01/01/70 00:00 | |
Stupid EIA | 01/01/70 00:00 | |
Maybe a Name change? | 01/01/70 00:00 | |
minor but annoying ... | 01/01/70 00:00 | |
USB | 01/01/70 00:00 | |
Limited Experience | 01/01/70 00:00 | |
known bad USB/serial | 01/01/70 00:00 | |
FYI - Targus PA088 | 01/01/70 00:00 | |
thoughts | 01/01/70 00:00 | |
I am so stupid | 01/01/70 00:00 | |
Kickstart | 01/01/70 00:00 | |
attribution | 01/01/70 00:00 | |
The ONE thing I always have to look up a | 01/01/70 00:00 | |
Ok - Second revision, but still working, | 01/01/70 00:00 | |
Nice | 01/01/70 00:00 | |
OK | 01/01/70 00:00 | |
MAX202 vs. MAX232A | 01/01/70 00:00 | |
or the 232A | 01/01/70 00:00 | |
Polled; Interrupt | 01/01/70 00:00 | |
polled tx | 01/01/70 00:00 | |
Assorted small ideas | 01/01/70 00:00 | |
Not a good idea | 01/01/70 00:00 | |
Serial speeds? | 01/01/70 00:00 | |
Enhanced specifications | 01/01/70 00:00 | |
That's a strange spec | 01/01/70 00:00 | |
formal stuff | 01/01/70 00:00 | |
formal | 01/01/70 00:00 | |
who's the intended audience | 01/01/70 00:00 | |
3rd Revision | 01/01/70 00:00 | |
Busy? | 01/01/70 00:00 | |
more than a couple of comments... | 01/01/70 00:00 | |
So..... | 01/01/70 00:00 | |
what I like or not... | 01/01/70 00:00 | |
comments | 01/01/70 00:00 | |
Comments on Comments | 01/01/70 00:00 | |
bah... | 01/01/70 00:00 | |
more problems | 01/01/70 00:00 | |
RE: Problems | 01/01/70 00:00 | |
Something Strange | 01/01/70 00:00 | |
Nope.... | 01/01/70 00:00 | |
interrupt | 01/01/70 00:00 | |
All members will enjoy | 01/01/70 00:00 | |
Intel serial intro app note | 01/01/70 00:00 |