Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Handshaking Siemens S35

Status
Not open for further replies.

kluivert

Junior Member level 2
Joined
Sep 19, 2007
Messages
20
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,471
max232 with hand shaking

Hi all
I am doing a project on car security system based on gsm which is S35 siemens, finally i managed to write code on uC and send bytes by uart but the phone doesn't give any response like when connected to PC(HyperTerminal)

My friend told me it must be a Handshaking problem, i am using uC connected to MAX232 then to the mobile data cable

My Qns:
1- I read +9V for 0 and -9v for 1 on pins T1 & R1 , why ? as it should be 3.3 V EIA/232 ?

2- I am very confused with the mobile handshaking, How it's connected? what about R
TS-CTS& DTR-DSR ?

3- Do the max232 is connected directly to mobile pins directly or must use as sw

plzzz help
Thanks in ad
 

handshaking max232 how to

Hi,
1. Your levels are ok, that is how RS232 levels will be. The 3.3V specifies that your MAx chip works from a VCC of 3.3v.
2. If your phone is working with hyperterminal then it is easy, you just make a connector with signals identical to that of PC and your phone will work with the micro also.
3. If you have shematic of the phone cable, please post it here.

4. Also read the post , your solution may be found here only.

Regards,
Laktronics
 

s35 atmega

This is the cable schematic what do u suggest for Handshaking protocol between uC and the mobile S35

I tried many times but nothing the mobile doesn't respond to the AT command
ex.: PC connection SC 7-8 SC 4-6

Do i have to connect pins 2(+8V) and pins 6(-8V) to the mobile cable ?

Do u know any way to know if the AT command is sent properly from uC something like monitor and how ?

Thanx
 

pin connection siemens s35

Hi,
If you are sure that this is the cable that has worked with PC, you do not need any handshaking. You have not shown the MAX pin numbers of TX connection, but it does not matter since the cable is working with PC. On your microcontroller side, terminate TX output after Max 232 on a 9pin male pin NO.3 and connect the Rx input of MAX to pin 2 of the connector, connect ground to pin5.

You also connect an external supply of 9 to 15 volts and its return to the regulator of the cable as you would have done in case of PC. If it does not work, trouble shoot your micro circuit and its software.

Regards,
Laktronics
 

siemens s35 at command

kluivert said:
Do u know any way to know if the AT command is sent properly from uC something like monitor and how ?

Thanx
 

unlock security code siemens s35

Hi,
Yes, Use a cross connected cable and connect it to PC- hyperterminal and check.
Regards,
Laktronics.
 

Hi, we are doing this project together.
sorry, i think i couldn't understand what you said well.
1) what is the regulator of the RS232? which pin is it? and do you do this to operate the RS232 circuit?

2) do you mean by the cross connected cable, to connect the transmitter and the reciever of the microcontroler directly with the PC without the MAX232?!!

Thank you in advance
 

Hi,
1. In the cable schematic given, there is a 78L05 regulator shown which feeds 5V to the MAX232 IC. To the input of the regulator you must have connected 9 to 15 V and its return, as specified in the drawing, when you connected the cable to the PC. You have to connect the same supply when the cable is connected to the MIcrocontroller also.

2. As regards cross connection of signals when connecting the microcontroller to PC for testing purposes, I meant to connect the RS232 signals after the MAX 232 on the Micro controller to the PC. Since I have advised you to bring out the signals TX to pin 3 , RX to pin 2 and ground to pin 5 to a connector on the microcntroller board to make it identical to the pinouts of PC's connector, when connecting PC and Microcontroller using a cable, it is implied to use a cross wiring in the cable by connecting pin3(TX) of micro's connector to pin2 RX of PC's connector and viceversa. This is what I meant by cross connection.

Regards,
Laktronics
 

I tried the cross connection as i took TX out MAX to the RX pin(2) of the male DB9 connector of PC on com1 and viceversa for RX and pin(5) of com1 connector connected to ct GND and watched ;
1- Hyperterminal : Nothing appeard ( I used same baud rate 19200bps)
2- Docklight : a sequence of NULL appears on screen

Knowing that i don't try any handshaking as pins 4,6,7,8 are open ct

For the code on uC when it's simulated on AVR studio it's right !!!

So what do u think now ?
 

Hi,

1. Under PORT settings in hyperterminal, I suppose you would have selected 8 bit, No parity,1 stop bit, 19.2K and Flow control to NONE.

2. The Micro software also should match the above selections.

3. The micro should send out ASCII characters.

4. If all these are done and still not working, check the micro operation one by one. Most likely your baud rate on micro is not OK. You can try sending out character ' U 'continuously for the above parameters from micro and see on computer. If you can observe the TX output from micro with an oscilloscope now, you can actually measure the baudrate.
In any case you should first make it work with PC , that is the easiest way to troubleshoot.

Regards,
Laktronics
 

Here is the code, if u could check it, knowing ATmega 8515 and the simulation shows that everything is ok and each character is sent

.include "m8515def.inc"

.def Arg1 =r16
.def Arg2 =r17
.def DataReg =r18 ;UART and EEPROM data register
.def any_reg2 =r19
.def temp =r20
.def temp1 =r21
.def temp2 =r22
.def over =r23
.def over1 =r24
.def any_reg =r25
.def bit_mask1 =r26
.def bit_mask2 =r27
.def count =r28

.equ brp = 25 ; Baud rate parameter
.equ CR =0x0D
.equ LF =0x0A

.org 0x00
rjmp reset
.org UDREaddr
rjmp udr_empty_int


reset:
cli
ldi temp, high(RAMEND) ;stack initialization
out SPH, temp
ldi temp, low(RAMEND)
out SPL, temp

clr count
clr ZL
clr r0
clr any_reg
clr over
clr temp
clr temp1
clr temp2
clr Arg1
clr Arg2
clr DataReg

ldi bit_mask2,0b00000001
ldi bit_mask1,0b11111110

ldi over, 0x00 ;store 0 in R17
out DDRA, over ;Store this value in The PORTA Data direction Register

ldi over1,0xff
out DDRB, over1


;Command strings MUST be located within the first 256 bytes of flash to use only low 8bit address

cmd_at: .db 'A','T',0
cmd_init: .db 'A','T','+','C','P','M','S','=','"','S','M','"',',','"','S','M','"',0
cmd_msgsend: .db 'A','T','+','C','M','S','S','=','1',0


;------------------------------------------------------
;UART initialization:
;----------------------------------------------------
sbi UCSRB,3 ; TX enable

cbi UCSRA,1 ; U2X enabled

ldi temp1, high(brp) ; Baud Rate = 19200 bps
out UBRRH, temp1
ldi temp1, low(brp)
out UBRRL, temp1

ldi temp2,0b11000110 ; (synchronous,no parity, 1 stop bit, 8 data bit )
out UCSRC,temp2

cbi UCSRB,UDRIE
sei

;------------------------------------------------------------------
;start sending SMS when sensor activated
;------------------------------------------------------------------
main:
in temp1,PINA
sbrc temp1,0 ;Skip if Bit0 in PORTA is clear
rjmp main
rcall start
rjmp main

;-------------------------------------------------------------------
;Sending The 3 AT commands
; 1- AT
; 2- AT+CPMS="SM","SM"
; 3- AT+CMSS=?
;-------------------------------------------------------------

start:

SEND_AT:
ldi zh,high(cmd_at*2)
ldi zl,low(cmd_at*2)
rcall send_cmd

SMS_INIT:
ldi zh,high(cmd_init*2)
ldi zl,low(cmd_init*2)
rcall send_cmd
sbi portb,4 ; Check LED

SMS_SEND:
ldi zh,high(cmd_msgsend*2)
ldi zl,low(cmd_msgsend*2)
rcall send_cmd
sbi portb,3 ; Check LED


;-------------------------------------------------------------------------
; Send AT Command (Char ,<CR>,<LF>)
;-------------------------------------------------------------------------

send_cmd:

scmd_loop:
lpm
tst r0 ;test ro
breq scmd_cr ;branch if ro=zero
mov DataReg,r0
sbi UCSRB,UDRIE
rcall wait_one_byte_tx
inc zl
rjmp scmd_loop


scmd_cr:
ldi DataReg, CR ;send command terminator <CR>
sbi UCSRB,UDRIE
rcall wait_one_byte_tx

ldi DataReg, LF ;send Line Feed <LF>
sbi UCSRB,UDRIE
rcall wait_one_byte_tx
sbi portb,1 ; check LED

ret

;--------------------------------------------------------------
; Wait For One Byte
;--------------------------------------------------------------
wait_one_byte_tx:
sbrs any_reg,0 ; this bit will be set in the UDR empty int
rjmp wait_one_byte_tx:
and any_reg,bit_mask1 ; bit_mask1= 11111110

ret


;---------------------------------------------------------------
;UDREaddr Interrupt Handler
;------------------------------------------------------------
udr_empty_int:
out udr,DataReg
or any_reg,bit_mask2 ; bit_mask2 = 00000001
cbi UCSRB,UDRIE
exit:
reti




Plz check the underlined part concerning the Baud Rate which is for 19200 bps,8MHz Clock, Synchronous the UBRR = 25 which is saved only in UBRRL and the UBRRH =0 but UCSRC always changes the UBRRH as they share the same location.

Thanx for ur efforts
 

Hi,
It will take time for me to understand your code.
But you should set the serial port to ASYNCHRONOUS, 8bit, no parity, one stop bit.
and not SYNCHRONOUS.
Regards,
Laktronics
 

    kluivert

    Points: 2
    Helpful Answer Positive Rating
Finally i succeeded to send the AT commands to the mobile ....... really u helped me , thanx for ur great efforts
 

hi All,
kluivert or anyone else who has successfully connected a siemens phone to a pc'c serial port.i am designing a project using siemens c25.i know the first step is successful connection en communication from phone to comp.i have made the right circuit ussing a max232 as the level converter.i am using brayss terminal as the serial port application. but when i send the AT command at 19.2k baud,8 bits,1 stopbit and no flow control,i get nothin from the comp.but when i disconnect the ground from the phone side,whater i type in is echoed back to me. i type "AT" and i receive "AT" back.what could be the problem?email me any material to use kamaingi@yahoo.com
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top