On the matter of Rx Tx connection let me insist on. Try to change and see what happens.
Also with siemens (cannot recall the model) had no problem 2-3 years ago.
Whatever you connect to the PIC as modem and sending "AT" it should reply "OK".
Ioannis
On the matter of Rx Tx connection let me insist on. Try to change and see what happens.
Also with siemens (cannot recall the model) had no problem 2-3 years ago.
Whatever you connect to the PIC as modem and sending "AT" it should reply "OK".
Ioannis
Rufinus,
I guess the problem is with the Siemens Datacable.
Most cables have some embedded electronics.
(At least a level shifter, probably more..)
This is usually powered from the PCs serial port (DTR & RTS)
So if you are using one of these cables to connect the phone you will need a MAX232 on the PIC end as well.
And you have to set the correct levels at DTR & RTS on the MAX232 at the PIC end in order to supply the cables embedded electronics.
As far as I can remember The Siemens interface is 5V tolerant, so all you need is 3 straight wires from the PIC to the Phone (no MAX232 at all).
But then you'll have to use SERIN2 /SEROUT2 instead of HSERIN/HSEROUT since HSERIN/HSEROUT doesn't allow to toggle between true/inverted mode.
Last edited by NavMicroSystems; - 14th October 2005 at 17:54.
regards
Ralph
_______________________________________________
There are only 10 types of people:
Those who understand binary, and those who don't ...
_______________________________________________
OK, just finished selfmade cable.
Rx and Tx do through the MAX, and CTS(5), RTS(6), DCD(7) are connected to the GND(2) trough 10k resisors. Without this it does not work. Or other way is to connect RTS to CTS straigt, it will communicate with the PC then also. Communication with the PC was fine in both cases. So, sefmade cable is considered to work correctly, at least for the AT commands.
Tried swapping Rx and Tx as Ioannis sugested, but it just made my phone to go off. After restart it was working fine. So, nothing was wrong with my pinout.
Now, NavMicroSystems, i am not that sure about powering cable from COM port. It is rather powered by the phone itself (as strange as it sounds). As a proof i can say, that i was able to communicate with the PC, using original cable with only 3 wires (Rx, Tx, GND), rest of them i disconnected for the experimental sake. And in this configuration it was working with hyperterm or some similar software except original Siemens software, which did not detect the phone. Only when you connect also CTS line, the phone will be detected by the Siemens software.
I should mention again, i'm experimenting on S65 and S55 phones which are rather new, and they are different from older Siemens models, pinout of the phone's interface and connector itself are different.
So, now my setup looks like this: PIC--->MAX232--->MAX232(selfmade cable)--->Pnone
From above, and as NavMicroSystems says, both MAXes can be ommited. Will try then connecting straight PIC to Phone using serout2 in inverted mode.
Wish me good luck![]()
Last edited by Rufinus; - 14th October 2005 at 17:07.
Well, i guess, your wishes did work
A little
I did connect it straight with the pic and used inverted mode. And i got the phone dialing! Why didnt it work with pic16f84 then?? Who knows..
So, thanks to all who cared and helped, in particular, NavMicroSystems and Ioannis.
But it still leaves some questions. Why didnt it wont to work with cables??
Ooops. It was to early to yell Gloria!
It does work with S55, i am able to send commands to the phone, but not receive from the phone.
And with S65 nothing is working at all. Tried different modes..
Rufinus,
I don't have the full specs of S55/S65
but this looks like a problem with the logic levels.
(Presuming your Code is OK)
Could you Scope the phones TX Pin to see wether it is sending anything at all and check it's output level?
You'll probably need a simple Levelshifter (i.e. 2 Transistors)
regards
Ralph
_______________________________________________
There are only 10 types of people:
Those who understand binary, and those who don't ...
_______________________________________________
I totally agree with Ralph. If your phone is "listening" what PIC says then PIC should listen too. May be the phone outputs too low voltage levels. So a MAX232 or even a simple circuit with a transistor would help. Test with a scope to see the real levels. What Resistors are you using on Rx - Tx lines?
Ioannis
Well, i fidured out S65 now too. The cable is the key to success.
S55 and S65 use different cable detection mechanisms. Yes, yes, phones novadays are detecting data cables. So, besides the usual Rx, Tx, GND lines, one needs other pins on the phone too, to tell the phone, that cable is present and the datatransfer will happen.
After googling for some time, i found out, that pins 5,6, and 7 of the phone connector determine how the phone will detect the cable. If you connect 5,6,7 through 10k resistors to pin 2, Siemens S65 will detect it as DCA540, which is corresponding to the Siemens USB connection cable. And so the cable is detected, the phone will not respond to AT commands.
Now, if you connect only 5,7 through the 10k resistors to the pin 2, phone will recognize this cable as DCA510, which is Siemens COM cable. And S65 then responding to AT commands. Bingo!
For now, phone is connected straight to pic through 1k resistors on Rx Tx lines. And i tried to scope the Tx line from the phone and yes, i get a spike of about 3-3.5 volts (my scope is an old one) after sending the AT command to the phone. For comparizon, i scoped the Tx line of the pic, which gave about 4.5 volts spike.
So, i conclude, that phone is receiving and anwering now.
I guess, i will now send the Tx signal from the phone trough the MAX232, to insure proper levels for the pic.
And here is mine testing code i use:
DEFINE LOADER_USED 1
'LCD defines
DEFINE LCD_DREG PORTA 'set LCD data port
DEFINE LCD_DBIT 0 'set starting data bit (0 or 4) if 4 bit bus
DEFINE LCD_RSREG PORTA 'set LCD register select port
DEFINE LCD_RSBIT 4 'set LCD register select bit
DEFINE LCD_EREG PORTB 'set LCD enable port
DEFINE LCD_EBIT 3 'set LCD enable bit
DEFINE LCD_BITS 4 'set LCD bus size (4 or 8 bits)
DEFINE LCD_LINES 2 'set number of LCD lines
DEFINE LCD_COMMANDUS 2000 'set command delay time in us
DEFINE LCD_DATAUS 50 'set data delay time in us
DEFINE OSC 20 'set crystal speed
b0 var byte
include "modedefs.bas"
'Main program
pause 1000 'wait for screen to sort get started
start:
lcdout $FE,1, "Sending AT.."
pause 3000
serout2 portc.4, 84, ["AT", 13]
serin2 portc.5, 84, [b0]
lcdout $FE, 1, b0
pause 3000
lcdout $FE,1, "Sending command.."
serout2 portc.4, 84, ["at+cgmm", 13]
serin2 portc.5, 84, [b0]
lcdout $FE,1, b0
pause 5000
goto start
end
-------------------------------------------
Now, i predict your comment about b0. With this i gust try to get anything from the phone, for example, after AT, b0 should be displayed as O (from OK), and after AT+CGMM it should be S (from S65). When i get correct response, i will change to WAIT("OK") or so.
And one more detail. As you see, i used mode 84 in serout2, which is True mode. In inverted mode, which would be the 16468, phone does not respond (very strange, indeed).
Last edited by Rufinus; - 16th October 2005 at 12:52.
Bookmarks