> Hi Folks, > > I don't think this is the best place to post this question, but I > think you can answer that :-) > > I need to build an "serial protocol converter" and I intend to use > MSP430. > > The hardware should read data from serial0, convert it and write to > serial1. Also read data from serial1, convert it and write to serial0. > > Also need one I/O to blink a Led when there is data being processed. > > Do you think that I can use msp430f123 that has only one UART and > emulate the other UART by software? (both uarts will work at 115200 > 8N1, msp will run at 8MHz) I know this is not an easy question... just > want some hints... > > Has anyone emulated UART by software? > > Thanks, > Pedro >
Hi, This is not going to work - or at least, it is not going to work well. Software uarts are easy enough to make, but not at this sort of speed. While it is possible to single-sample uart signals, it will not be reliable, and even then you are talking about a timer running at 115.2 kHz - or two, for full duplex. That's about 70 clock cycles per timer-tick - very little time to do real work on an msp430. I implemented a 38kbaud software uart on a 7.37 MHz AVR, with four times oversampling - it works fine, but with 48 clock cycles per tick, it meant careful assembly for the software uart routines. Some msp430's have hardware in the timerA timer to help making software uarts - this may make the difference between impossible and very difficult. If you can, you should definitely go for a msp430f14x instead - these have two hardware uarts. You should also be looking for a crystal running at something like 7.3728 MHz - being a nice multiple of 115200.
