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

RS232 & Invert

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







RS232 & Invert
PostPosted: Sat Jan 04, 2003 9:35 am     Reply with quote

Hi,
I have a 16F876 and I am interfacing with a GSM modem, the GSM modem uses RS232 levels that are low-high transitions, but the 16F876 uses high-low transitions (I am using the hardware RS232) and I can't change it using the INVERT statment in the "#use RS232" line, it says this is not allowed with hardware RS232.

As the GSM is designed to interface with a MCU I do not need any level shifting like a max232 I do realise if I was using a max232 it would get inverted.

I am getting round this problem by using "hex invertor" but I'd like to be able to loose this, saving cost and board space.

Thanks in advance.
___________________________
This message was ported from CCS's old forum
Original Post ID: 10414
Tomi
Guest







Re: RS232 & Invert
PostPosted: Sat Jan 04, 2003 10:30 am     Reply with quote

:=..... it says this is not allowed with hardware RS232.

Yes, that's true Smile A bit-banged RS232 could set the output when you say "0" and vice versa but the HW UART don't have built-in inverters.

:=As the GSM is designed to interface with a MCU I do not need any level shifting like a max232

Are you sure? What is your GSM adapter type? I use Siemens M20 and TC35 and they have V.24 interface (Max232 is necessary) and I use GM22 from Ericsson. It has base-level 232 (mark is high) but need 0-3V interface. If your GSM adapter has low (or cca. -3...-8V) mark signal then you MUST use a max232. It could work with a simple '04- style inverter because most of the current line receivers (including that ones used in PCs) sense high everything under +0.3V. But IMHO it is a very dangerous mode of usage: especially you don't have a good noise protection what could be critical when the 900/1800MHz transmission starts Smile
Additionally, if you really need an inverter then it is pretty sure that your GSM adapter has negative output what is shorted to the ground over the input protection diode of the inverter so earlier or later it could kill your adapter (except if you have a resistor between the GSM output line and the inverter's input).
___________________________
This message was ported from CCS's old forum
Original Post ID: 10415
Newbie
Guest







Note for Tomi
PostPosted: Sun Jan 05, 2003 9:35 am     Reply with quote

Hi,
Thanks for the reply, the GSM modem is an embedded GSM862-GSM
you can check the spec at <a href="http://www.roundsolutions.com/" TARGET="_blank">http://www.roundsolutions.com/</a>

All the different levels are a little confusing and I'm not sure I follow what you said, could you take a look at the PDF from the web site above and advise me.

Thanks



:=
:=:=..... it says this is not allowed with hardware RS232.
:=
:=Yes, that's true <img src="http://www.ccsinfo.com/pix/forum/smile.gif" border="0"> A bit-banged RS232 could set the output when you say "0" and vice versa but the HW UART don't have built-in inverters.
:=
:=:=As the GSM is designed to interface with a MCU I do not need any level shifting like a max232
:=
:=Are you sure? What is your GSM adapter type? I use Siemens M20 and TC35 and they have V.24 interface (Max232 is necessary) and I use GM22 from Ericsson. It has base-level 232 (mark is high) but need 0-3V interface. If your GSM adapter has low (or cca. -3...-8V) mark signal then you MUST use a max232. It could work with a simple '04- style inverter because most of the current line receivers (including that ones used in PCs) sense high everything under +0.3V. But IMHO it is a very dangerous mode of usage: especially you don't have a good noise protection what could be critical when the 900/1800MHz transmission starts <img src="http://www.ccsinfo.com/pix/forum/smile.gif" border="0">
:=Additionally, if you really need an inverter then it is pretty sure that your GSM adapter has negative output what is shorted to the ground over the input protection diode of the inverter so earlier or later it could kill your adapter (except if you have a resistor between the GSM output line and the inverter's input).
___________________________
This message was ported from CCS's old forum
Original Post ID: 10426
Tomi
Guest







Re: Note for Tomi
PostPosted: Mon Jan 06, 2003 1:28 am     Reply with quote

:=All the different levels are a little confusing

After a quick look on the pdf file I can understand the confusing. The only usable tech info is for GM862-GPRS Smile but you have GM862-GSM (?)
To decide what you have to do check the voltage between pins #37 (GSM output) and e.g. #2 (Gnd). If that voltage is cca. 2.8-3V then you have to use a 3V-5V interface as described on Page#21. If the voltage is below -2V (or at least negative) then you have to use a Max232.
___________________________
This message was ported from CCS's old forum
Original Post ID: 10447
Newbie
Guest







Page 17 of spec
PostPosted: Mon Jan 06, 2003 7:19 am     Reply with quote

Hi,

I have not had chance to look at pin 37 as the prototype board for the GSM862 is hard to work with (multilayer) and finding a test point is hard.

I did read the spec sheet for the GSM and noticed quite a lot of into regarding interfacing on page 17, can you take a look this. I think it is saying that I am basically right in what I think.

Input High = +2.1v - +3.3v
Input low = 0v - +0.5v
Output High = 2.2v - 3.0v
Output Low = 0v - 0.35v

Max on all inputs = 3.37v

From what I can understand from all this, it means that I could connect the PIC direct to the GSM but it would require inverting.

The only concern I have it the max 3.37v as the output pin on a PIC is max +4.7v, or could I drop the PIC VSS to say 3.3v and this would give me +3.0 max? thinking about that this would not help as the "Hex invertor" I was thinking about using would be outputting +5v as a high anyway!

Just had another thought! even if I did use a Max232 would this not be outputting >+3.37v for a high!!! ahhhhhhh

Thanks again for all your help.




:=
:=:=All the different levels are a little confusing
:=
:=After a quick look on the pdf file I can understand the confusing. The only usable tech info is for GM862-GPRS <img src="http://www.ccsinfo.com/pix/forum/smile.gif" border="0"> but you have GM862-GSM (?)
:=To decide what you have to do check the voltage between pins #37 (GSM output) and e.g. #2 (Gnd). If that voltage is cca. 2.8-3V then you have to use a 3V-5V interface as described on Page#21. If the voltage is below -2V (or at least negative) then you have to use a Max232.
___________________________
This message was ported from CCS's old forum
Original Post ID: 10452
Tomi
Guest







Re: Page 17 of spec
PostPosted: Mon Jan 06, 2003 8:38 am     Reply with quote

Hi,
It sounds like your GSM adapter is very similar to Ericsson GM22 what I used. In that system I simply use +3V power for PIC (16LF876). In this case the UART output is 0-3V compatible so you can connect it directly to the adapter.
HTH
Tomi
___________________________
This message was ported from CCS's old forum
Original Post ID: 10456
Newbie
Guest







What about the inverter?
PostPosted: Mon Jan 06, 2003 11:01 am     Reply with quote

Can you confirm about the inverter.

The project currently uses a TC35 via a MAX232 that inherently inverts the signal and I have checked this at the Rx Pin of the 16F876 and it is inverted. if I connect the GSM862 directly to the Pic the signal comming from the GSM will not be inverted and therefore fail even if I run it at 3v, won't it?

Sorry for being stupid :o(


:=Hi,
:=It sounds like your GSM adapter is very similar to Ericsson GM22 what I used. In that system I simply use +3V power for PIC (16LF876). In this case the UART output is 0-3V compatible so you can connect it directly to the adapter.
:=HTH
:=Tomi
___________________________
This message was ported from CCS's old forum
Original Post ID: 10466
Tomi
Guest







Re: What about the inverter?
PostPosted: Mon Jan 06, 2003 11:41 am     Reply with quote

:=Can you confirm about the inverter.
:=
:=The project currently uses a TC35 via a MAX232 that inherently inverts the signal and I have checked this at the Rx Pin of the 16F876 and it is inverted. if I connect the GSM862 directly to the Pic the signal comming from the GSM will not be inverted and therefore fail even if I run it at 3v, won't it?
:=

Huhhh, maybe the name "inverter" is not a really good name and it could make confusion.
Check the output of the GSM862. If it has a mark signal of cca. PLUS 2.8-3V then it is "logic circuit compatible" so you don't need an inverter (you wrote that you can not measure that voltage but how do you connect the adapter to the PIC?)
At the TC35 side, the LOW level is defined as "voltage is greater than +3V" and the HIGH level is defined as "voltage is less than -3V". The max232 line transceiver converts this level definition to "logic circuit definition" (high > 2.1 low < 0.5)

If I strongly understand your adapter has a DB9 connector (once more, I don't know that adapter and the info found on the web is very poor) as TC35 has but the levels for GSM862 are CMOS-compatible so you can measure cca. 3V between pin#2 and pin#5 (unplug your cable from adapter and use a plain DB9 connector).
In this case connect directly pin#2 to PIC's receive line and pin#3 to PIC's transmit line and pin#5 to the common ground.
___________________________
This message was ported from CCS's old forum
Original Post ID: 10467
Newbie
Guest







Think I have it
PostPosted: Mon Jan 06, 2003 4:34 pm     Reply with quote

Right, I found the signal on the evaluation board (pin 37) that came with the GSM862. This pin is at approx 2.5v when no data is transmitting, if the GSM sends data it fluctuates between 2.5v and 0v then after data has finished it returns to a high state 2.5v.

So I think I agree with you that this will connect directly to the PIC as long as I run the PIC at 3v, do you agree?


:=:=Can you confirm about the inverter.
:=:=
:=:=The project currently uses a TC35 via a MAX232 that inherently inverts the signal and I have checked this at the Rx Pin of the 16F876 and it is inverted. if I connect the GSM862 directly to the Pic the signal comming from the GSM will not be inverted and therefore fail even if I run it at 3v, won't it?
:=:=
:=
:=Huhhh, maybe the name "inverter" is not a really good name and it could make confusion.
:=Check the output of the GSM862. If it has a mark signal of cca. PLUS 2.8-3V then it is "logic circuit compatible" so you don't need an inverter (you wrote that you can not measure that voltage but how do you connect the adapter to the PIC?)
:=At the TC35 side, the LOW level is defined as "voltage is greater than +3V" and the HIGH level is defined as "voltage is less than -3V". The max232 line transceiver converts this level definition to "logic circuit definition" (high > 2.1 low < 0.5)
:=
:=If I strongly understand your adapter has a DB9 connector (once more, I don't know that adapter and the info found on the web is very poor) as TC35 has but the levels for GSM862 are CMOS-compatible so you can measure cca. 3V between pin#2 and pin#5 (unplug your cable from adapter and use a plain DB9 connector).
:=In this case connect directly pin#2 to PIC's receive line and pin#3 to PIC's transmit line and pin#5 to the common ground.
___________________________
This message was ported from CCS's old forum
Original Post ID: 10479
Tomi
Guest







Re: Think I have it
PostPosted: Tue Jan 07, 2003 1:29 am     Reply with quote

Exactly Smile
___________________________
This message was ported from CCS's old forum
Original Post ID: 10492
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