I worked on a GSM controller for my school project.
The GSM controller should controlling a 3 phase motor, I added an option to controlling them over push button's!
But i haw a problem with the communication to GSM phone!
I used 16F628 and Siemens M55 as GSM modem (PDU)!
The problem is when i try to read the message from phone with AT+CMGR=1, then the pic begins to send constantly that command to phone (faster and often then he should)! the phone answers every time with the last message as it should, but the pic doesn't recognize that!
When I disconnect the GSM from PIC, PIC begins to work as it should.
To connect the GSM to PIC i used that schematic
![]()
Without the "amplifier" the pic doesn't recognize the GSM!
here is the part of code i wrote:
I hope someone can help me, because i must have it finished on MondayCode:DEFINE OSC 12 DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive DEFINE HSER_TXSTA 24h ' Enable transmit, BRGH = 1 DEFINE HSER_SPBRG 77 ' 9600 Baud @ 0,16% DEFINE HSER_CLROERR 1 ' Clear overflow automatically DEFINE HSER_BAUD 9600 SYMBOL SDA = porta.0 SYMBOL SCL = porta.1 DEFINE I2C_SDA PORTA.0 DEFINE I2C_SCL PORTA.1 DEFINE I2C_SCLOUT 1 SYMBOL LED = PORTB.3 SYMBOL RE1 = PORTB.4 SYMBOL RE2 = PORTB.5 SYMBOL RE3 = PORTB.6 SYMBOL RE4 = PORTB.7 symbol SW1 = PORTA.2 symbol SW2 = PORTA.3 symbol SW3 = PORTA.4 symbol SW4 = PORTA.5 symbol SW5 = PORTB.0 OUTPUT LED OUTPUT RE1 OUTPUT RE2 OUTPUT RE3 OUTPUT RE4 input SW1 input SW2 input SW3 input SW4 input SW5 CMCON=7 'Ugasi komparatore VRCON=0 'Ugasi VREF broj var byte [12] 'Aray promjenjive za tel. broj pdu var byte [4] 'PDU text poruke tempb VAR BYTE [12] 'Temp za tel. broj adr VAR BYTE 'promjenjiva za brojanje a var BYTE i VAR BYTE c VAR BYTE init: high LED Hserout ["ATZ", 13, 10] 'Standardne postavke hserin 2000, init, [WAIT ("OK")] 'Čekaj OK odgovor HSEROUT ["ATE0", 13] pause 300 low led sms_me: HIGH LED 'upali LED1 HSEROUT ["AT+CPMS=ME", 13, 10] 'Postavi memoriju tel. za SMS HSERIN 2000, sms_me, [WAIT ("OK")] 'Čekaj OK pause 300 low led taste: iF SW1=0 THEN i=1 ELSE IF SW2=0 THEN i=2 ELSE IF SW3=0 THEN i=3 ELSE IF SW4=0 THEN i=4 ELSE IF SW5=0 THEN i=5 ELSE GOTO sms ENDIF ENDIF ENDIF ENDIF ENDIF GOTO rele sms: HIGH LED HSEROUT ["AT+CMGR=1", 13, 10] 'Pročitaj zadnji primljen SMS HSERIN 4000, taste, [WAIT ("+CMGR:"), SKIP 1, str a\1, SKIP 26, STR BROJ\12, SKIP 20, STR pdu\4] IF A=0 THEN GOTO taste ENDIF
P.S. SRY for my veryyyyyyy bad English
THX


)!


Bookmarks