> > Hi Everybody! > > It seems that the absense of a second UART on the reasonably priced > PIC's (not the 17CXX) is one of the last benefits of the Intel chips > keep over Microchip's PICS. Um exactly which Intel parts have the second UART and what's their cost? The 8051, 803[12], and 8751 don't right? > > Perhaps we can nag & nag & nag & nag Microchip until they include a > second UART on chips like the 16C74. Doing it in software is a pain in > the butt. Am I alone, or is there anybody else that agree? Well it may be useful but I've found that PICs make very good software UART engines with some caveats. Specifically: 1) Works well in half duplex operation 2) Doesn't require a lot of time intensive work while serial stuff is going on. I've just finished a half duplex software UART that will do 38400 using a 14.7456 Mhz crystal. With a 19.6608 Mhz crystal you can get 38400 operation (38400 * 512 -> 19.6608 Mhz) and have time leftover to do other stuff. My UART implementation uses precise delays and no interrupt. However it would be fairly simple to convert it to using interrupts for delays and a state machine. Then the PIC could do other work and get interrupted for each bit to be transferred. The other thing I like about software UARTS is that I can pick and choose the pins that I want to run them on. And potentially I could build several of them into a single PIC. Also there are some fairly simple hardware UARTS that could easily be attached to a PIC. One of my favorites is the Signetics 2691. Comes in a 28 pin skinny DIP, has a 4 byte receive buffer, and has an extra timer on board, along with the standard baud rate generator. I'm designing a portable MIDI sequencer. Each MIDI channel requires a UART. I'm planning on using the Cirrus Logic CL-CD-180 8 port UART. Each channel has 8 bytes of send and receive buffers and the part comes in a 84 pin PLCC so it doesn't take a whole bunch of space. 2 PIC ports and a latch are required for interfacing. And of course if you're tight for space just program another small PIC as software UART and interface it to the main PIC. Cheaper than a real UART, takes less space and power, and you already have them in your box. I haven't really used a UART since I've started programming PICs not that I think about it. All of the serial interfaces I've built in the last two years are software PIC UARTs. BTW I've finally figured out the secrets to precise delays: 1) Never reset your timer, let it free run. 2) Use another register to store the end of the delay. Update that register instead of the timer. 3) Use a crystal that is a integral multiple of the bit rates you want to produce. Use 18.432 Mhz if you need 57.6K and 115.2K or the 19.6608 Mhz if you need only up to 38.4K. My last crack at UART code produced a UART that only worked up to 2400 BPS because I reset the timer. Using the 14.7456 Mhz crystal, a free running timer, and an extra register to hold the end of the next delay, 38.4K was no problem. My next test is 57.6K and 115.2K because I'll scale back the prescale from 1:16 to 1:8. Anyway PIC software UARTS are a godsend for me. I know I can pull together a PIC and a MAX232 and have a serially programmable I/O controller in a matter of minutes. BAJ