Discovered strange thing. Works with S55. If i connect Tx line from the phone trough 1k resistor to one of the ports, serin2 will hang, waiting for an answer on that port. But when i quickly shorten this serin2 port to the ground, it starts working! And then hangs until the next command, then i short it and after it goes without problem to the end of the program. This trick does not work with HSERIN or SERIN. And only sometimes works with S65 phone.
With max232 doesnt work anyways.
Any ideas??
Here is my code:
DEFINE LOADER_USED 1
'UART hardware defines
DEFINE HSER_RCSTA 90h
DEFINE HSER_TXSTA 20h
DEFINE HSER_BAUD 9600
DEFINE HSER_CLROERR 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
lcdout $FE,1, "Sending AT.."
pause 2000
HSEROUT ["AT", 13]
pause 500
HSEROUT ["ATE0", 13]
serin2 portc.4, 84, [str b0\10]
lcdout $FE, $C0, str b0\10
pause 3000
b0=0
lcdout $FE,1, "Asking model.."
pause 2000
HSEROUT ["at+cgmm", 13]
serin2 portc.4, 84, [SKIP 2, str b0\20]
lcdout $FE, $C0, str b0\20
pause 5000
b0=0
lcdout $FE,1,"Asking IMEI.."
pause 2000
Hserout ["at+cgsn", 13]
serin2 portc.4, 84, [SKIP 2, str b0\20]
lcdout $FE, $C0, str b0\20
pause 5000
b0=0
lcdout $FE,1,"Asking capabilities:"
pause 2000
Hserout ["at+gcap", 13]
serin2 portc.4, 84, [SKIP 2, str b0\20]
lcdout $FE, $C0, str b0\20
pause 5000
b0=0
lcdout $FE,1,"Asking time.."
pause 2000
Hserout ["at+cclk?", 13]
serin2 portc.4, 84, [SKIP 2, str b0\20]
lcdout $FE, $C0, str b0\20
end




Bookmarks