MAX232 and USART issues.

Go To Last Post
10 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I had some problems setting up my USART.

I built ELMs serial port programmer and his programmer doesn't use capacitors to ground on the transmission lines, unlike many other designs, and the programmer works through hundreds of programmings so far.

So I thought I was safe without transmission line capacitors, when I then wanted to accomplish serial communication using the USART I decided to use the MAX232 serial port driver. I used it for only debugging(micro to PC HyperTerm) for a while and it worked nicely.

Then trying to receive data on the micro from the computer every once in a while it would reset my microcontroller. Sometimes I had to send only one character to the microcontroller, sometimes as many as 20+, but it was pretty random. The micro was receiving the data that didn't reset the micro, I could spit it back out to the terminal. I spent a day or two making sure it wasn't my code, including changing the baud rate. Then I remembered something about "ringing" on the transmission lines, so finally I added a 10nF capacitor(first low value I found lying around) from the micros RXD pin to ground and the resetting disappeared and the USART is working normally now.

To note, the rest of the circuit is decoupled in serveral areas, I tried this solution first because I wasn't decoupling originally, but that didn't fix the problem.

I'll bring it into university and hook it up to the oscilliscope to see if there is any "ringing" on the line without the capacitor.

Has anyone else had this sort of experiance with the MAX232? I browsed some of the maxim datasheets surrounding this chip and didn't see anything related to this.

Also, does anyone have any insight into if this could in fact be ringing? And what would be a proper value for the capacitor on the transmission line?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How long is the cable between the PC and the MAX chip? I've never had a ringing problem with an RS-232 connection, I suspect the problem is else where.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Three feet probably, it looks like your standard serial cable. I don't think it's the cable itself because I don't put the bypass capacitor on the transmission line on the PC side of the MAX232, I put the bypass capacitor on the one inch wire between the MAX232 TTL/CMOS output and the micro's RXD pin, so any problems that might have been happening I think are due to a relationship between the MAX232 and the micro.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Have you got the grounds properly connected between the PC and the AVR system? I've never had problems like the one you mention with RS-232 comms using Maxim devices, and I've never needed to use capacitors on the lines.

Leon

Leon Heller G1HSM

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I've got them properly connected as in pin 5 of the serial cable is commonly grounded to the micro/circuit ground. It's a mystery, huh? I will appreciate any other suggestions.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What are you using for a power supply?
The typical MAx chip needs to run at 5 volts, is that what you're using?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm using a 7805 Linear regulator, rated at 1.5amp I beleive. Going into this is a 9v wallwart rated at 700mA. I'm seeing 4.9v at the regulator/micro/max232.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I had the same problem, but no resetting, bad receving.

Appears to be working.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

GlingON wrote:
I'm using a 7805 Linear regulator, rated at 1.5amp I beleive. Going into this is a 9v wallwart rated at 700mA. I'm seeing 4.9v at the regulator/micro/max232.

Do you have all the recommended capacitors on both sides of the regulator?
If you have a scope, how clean are the power signals?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have the recommended capacitors on the regulator, I didn't originally and thought that was the problem. I've used multiple wall warts, but my last plan of action is to bring my circuit into uni and test it on the scope. I'm probably gonna use a squarewave function generator at the same voltages that my serial port is outputting (~9.4V). Feed that to a receiving pin on the MAX232. I could actually try changing the MAX232 chip, could be duff. I didn't think about that till now.