CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Max232 Problem

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Whizzard9992



Joined: 13 Apr 2004
Posts: 8

View user's profile Send private message

Max232 Problem
PostPosted: Thu Apr 22, 2004 6:46 pm     Reply with quote

I have a Max232 chip hooked to a modem and a PIC16F627A. I Have common ground on the Serial Port and CS hooked to Pin 8 on the Max232.

My problem is that when the modem is turned off, after about 3 seconds I get a High signal (Mark) on pin 9. If I put a 10k Pull-up resistor on Pin 8, it delays about 10 minutes and still goes high, while the modem is off. Turning the modem on and off will reset the cycle.

I have the MAX232 hooked up according to the following diagram and running on 5v Regulated (less the decoupling cap):

http://www.maxking.co.uk/images/MAXDG.GIF

All unused pins are floating (7,10,11,12,13,14)

I can't figure out what I'm doing wrong.

Thanks.
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Fri Apr 23, 2004 6:03 am     Reply with quote

The MAX232 is also an inverter! What you call a Mark is in fact a Space.

Your 10k pull-up on pin-8 is not working because of the internal 5k to ground on this same pin. Pull-down is what you want, remove your pull-up.
Whizzard9992



Joined: 13 Apr 2004
Posts: 8

View user's profile Send private message

PostPosted: Fri Apr 23, 2004 12:16 pm     Reply with quote

Ok. That did solve one problem. I removed the pull-up, though I didn't replace it with a pull-down because you said that there was one internally. I'm getting a 4-second delay before I get the signal from the RS-232 connection. Any ideas? I don't have the 10uf cap between + and Gnd because it looks to be a decoupling cap and I already have one on the board.
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Fri Apr 23, 2004 2:01 pm     Reply with quote

The info about the pull down resistor I got from studying the picture you provided.

Sorry, you need to be more specific for us to answer the delay question. What do you mean with a 4-second delay? You meassured this events between which events? What is the rest of your hardware setup looking like?
Whizzard9992



Joined: 13 Apr 2004
Posts: 8

View user's profile Send private message

PostPosted: Fri Apr 23, 2004 3:32 pm     Reply with quote

I have a PIC16F627A hooked to an LED bargraph on a 5V regulated power supply. All Max232 pins are floating except the cap pins, vcc, cng, pins 8 and 9. Pin 9 is going to an input on the PIC.

From the moment the input on pin 8 on the Max232 goes dead (Floats, as the modem is off), there's about a 4-second delay before it registers a signal on Pin 9. When I had a pull-up on pin 8, it increased that delay to about 5 minutes.
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Mon Apr 26, 2004 1:24 am     Reply with quote

You say the input pin 8 is floating.... I never like floating inputs....
I guess your modem keeps the signal level high for some time, even when switched off. A quick and dirty solution would be to add an extra 5k pull down on pin 8, then you will still have a delay, but shorter.

A MAX-232 just for detecting an incomming RS-232 signal level is a bit of an overkill, there are cheaper solutions. I

I think we are getting off topic here, the MAX-232 hardware has no relation to any CCS product. It would be better to ask this question in a hardware related newsgroup.
rwyoung



Joined: 12 Nov 2003
Posts: 563
Location: Lawrence, KS USA

View user's profile Send private message Send e-mail

PostPosted: Mon Apr 26, 2004 7:57 am     Reply with quote

Whizzard9992 wrote:
Ok. That did solve one problem. I removed the pull-up, though I didn't replace it with a pull-down because you said that there was one internally. I'm getting a 4-second delay before I get the signal from the RS-232 connection. Any ideas? I don't have the 10uf cap between + and Gnd because it looks to be a decoupling cap and I already have one on the board.


Do you mean the V+ pin which is part of the MAX232 charge pump or do you mean the VCC pin? If it is the V+ pin then you definately need the cap. If it is the VCC pin then it wouldn't kill you to add a capacitor there but if you already have at least 1 10uF and 1 0.1uF within an inch or so of the part then you may be OK.
_________________
Rob Young
The Screw-Up Fairy may just visit you but he has crashed on my couch for the last month!
Whizzard9992



Joined: 13 Apr 2004
Posts: 8

View user's profile Send private message

Thanks
PostPosted: Mon Apr 26, 2004 9:55 am     Reply with quote

Thank you both for your help.

The reason I inquired about the Max232 here is because I wasn't sure if it was a voltage or input issue related to the PIC. I figured I probably wasn't the only person to have this problem, since the Max232 is a pretty popular chip for Serial Comm with the pic.

At any rate, I think I have something rediculous like a 100uf Decoupler on the Power Supply because my app as a whole pulls almost a full amp. This is a VAR application on existing hardware so I don't have much breathing room on the modifying existing PS.

After more testing, it seems that my response from the Max232 is immediate until my external modem powers down and leaves the pin floating. I'm assuming that at some point, a cap is looking to discharge through that pin, because I'm getting a variable delay depending on what pull-up resistance I drop in.

I'm going to add another pull-down, and that should prolly fix it.

Thanks.
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Tue Apr 27, 2004 12:47 am     Reply with quote

Looks indeed something like a capacitor discharging through the input of your MAX-232.
Can you figure out where this current is somming from? Do you have something like a break-out box for the RS-232?

Also have a careful look at the ground connections! I had a very strange short circuit problem until I found out the current was going from my circuit, through the probe of the scope to the scope's ground connection in the power outlet, from there to my pc and then running through the RS-232 connection from the pc to the circuit board again.

Are you using a shielded RS-232 cable? If yes, make sure the shielding is only connected on one end of the cable, otherwise you might get ground loops like described above.
Ttelmah
Guest







Re: Thanks
PostPosted: Tue Apr 27, 2004 2:09 am     Reply with quote

Whizzard9992 wrote:
Thank you both for your help.

The reason I inquired about the Max232 here is because I wasn't sure if it was a voltage or input issue related to the PIC. I figured I probably wasn't the only person to have this problem, since the Max232 is a pretty popular chip for Serial Comm with the pic.

At any rate, I think I have something rediculous like a 100uf Decoupler on the Power Supply because my app as a whole pulls almost a full amp. This is a VAR application on existing hardware so I don't have much breathing room on the modifying existing PS.

After more testing, it seems that my response from the Max232 is immediate until my external modem powers down and leaves the pin floating. I'm assuming that at some point, a cap is looking to discharge through that pin, because I'm getting a variable delay depending on what pull-up resistance I drop in.

I'm going to add another pull-down, and that should prolly fix it.

Thanks.

First general comment. 100uF, is not 'ridiculous' if the supply draws 1A. The 'time constant' of this capacitor at this load, will give just 1/10000th second to droop by 1v. Seriously, this is a very _small_ capacitor for this sort of load.
Second general comment. Electrolytic capacitors have very poor HF behaviour, often providing practically no blocking at all to high frequencies. This is why the earlier poster recommended the combination of an electrolytic capacitor , and a parallel 0.1uF _close to the regulator_. Most regulators are quite prone to oscillating (they are after all very high gain amplifiers at heart), and these parts are needed to prevent this. You should also be aware of the need to have further decoupling right across the board, especially by any parts that draw high current, and preferably a ground plane.
Is your part a MAX232, or one of the latter 'derivatives' (like the 232A)?. The Max232, still requires 1uF caps on all the charge pump pins (though in some crcumsances 0.1uF can be used). The 232A, only requires 0.1uF caps here, while several companies now do direct 'clones' with higher ESD resistance, that do not require the capacitors. If the version you are using, differs from the data sheet used to spcify the board layout, it could well cause problems.
The suggestion to ensure that no input pins float, is wise. This can lead to extra unwanted power being drawn, and the comment would apply generally to your board (and might reduce the power consumption...).

Best Wishes
Whizzard9992



Joined: 13 Apr 2004
Posts: 8

View user's profile Send private message

PostPosted: Tue Apr 27, 2004 9:53 am     Reply with quote

Excellent Information. Thank you.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group