A
amila133
Guest
Sem mogel, da pokličete telefonsko z uporabo PIC.Moj telefon podpira samo za format PDU.Študiral sem o formatu PDU in sem poslal SMS z HyperTerminala v PC preko serijskega porta.
Toda, ko sem se uporabljajo isto metodologijo v PIC ne deluje.
Potrebujem nekaj kode na primer narediti it.If ste prosimo, pošljite.To je moja koda.
Koda:int i = 0;
int j = 0;
neveljaven Glavni () (const char nepodpisani para [3] = "AT";
const char nepodpisani pdumode [10] = "AT CMGF = 0"; / / select PDU način (o je podana, 1 je podan za tekstovni način)
const char nepodpisani dial [17] = "ATD0716530115; \ r \ n";
const char nepodpisani tpdu_length [11] = "AT CMGS = 16"; / / dolžina sporočila
const char nepodpisani message1 [47] = "069149170000F311000B914917560311F50000AA02C822"; / / sporočilo
nepodpisani kratkem prejeli;
/ / ToPDU ("To je enostavno pošiljanje sms sporočil", pošlje);Usart_Init (9600);
TRISB = 0;
PORTB = 0;while (1) (for (i = 0; i <3; i ) (
Usart_Write (para ); / / tip na
Delay_ms (200);
)
Usart_Write (0x0D);
if (Usart_Data_Ready ()) (
PORTB = 1;
Delay_ms (4000);
PORTB = 0; / / iz pdumode
for (i = 0; i <10; i ) (
/ / If (Command1 == '\ 0') break;
Usart_Write (pdumode );
Delay_ms (200);
)
Usart_Write (0x0D);
if (Usart_Data_Ready ()) (
PORTB = 1;
Delay_ms (4000);
PORTB = 0;
for (i = 0; i <11; i ) (
/ / If (Command1 == '\ 0') break;
Usart_Write (tpdu_length ); / / dolžina sporočila
Delay_ms (200);
)Usart_Write (0x0D); / / enter
if (Usart_Data_Ready ()) (
PORTB = 1;
Delay_ms (4000);
PORTB = 0;
for (i = 0; i <47; i ) (/ / pošlji sporočilo
/ / If (Command1 == '\ 0') break;
Usart_Write (message1 );
Delay_ms (200);
)
PORTB = 1;
Delay_ms (500);
PORTB = 0;Usart_Write (26); / / ctrl z
PORTB = 1;
Delay_ms (7000);
PORTB = 0;
if (Usart_Data_Ready ()) (
for (i = 0; i <17; i ) (/ / klic res začenja
if (dial == '\ 0') break;
Usart_Write (dial );
Delay_ms (200);
)PORTB = 1;
Delay_ms (1000);
PORTB = 0
)
)
)
)
)
Toda, ko sem se uporabljajo isto metodologijo v PIC ne deluje.
Potrebujem nekaj kode na primer narediti it.If ste prosimo, pošljite.To je moja koda.
Koda:int i = 0;
int j = 0;
neveljaven Glavni () (const char nepodpisani para [3] = "AT";
const char nepodpisani pdumode [10] = "AT CMGF = 0"; / / select PDU način (o je podana, 1 je podan za tekstovni način)
const char nepodpisani dial [17] = "ATD0716530115; \ r \ n";
const char nepodpisani tpdu_length [11] = "AT CMGS = 16"; / / dolžina sporočila
const char nepodpisani message1 [47] = "069149170000F311000B914917560311F50000AA02C822"; / / sporočilo
nepodpisani kratkem prejeli;
/ / ToPDU ("To je enostavno pošiljanje sms sporočil", pošlje);Usart_Init (9600);
TRISB = 0;
PORTB = 0;while (1) (for (i = 0; i <3; i ) (
Usart_Write (para ); / / tip na
Delay_ms (200);
)
Usart_Write (0x0D);
if (Usart_Data_Ready ()) (
PORTB = 1;
Delay_ms (4000);
PORTB = 0; / / iz pdumode
for (i = 0; i <10; i ) (
/ / If (Command1 == '\ 0') break;
Usart_Write (pdumode );
Delay_ms (200);
)
Usart_Write (0x0D);
if (Usart_Data_Ready ()) (
PORTB = 1;
Delay_ms (4000);
PORTB = 0;
for (i = 0; i <11; i ) (
/ / If (Command1 == '\ 0') break;
Usart_Write (tpdu_length ); / / dolžina sporočila
Delay_ms (200);
)Usart_Write (0x0D); / / enter
if (Usart_Data_Ready ()) (
PORTB = 1;
Delay_ms (4000);
PORTB = 0;
for (i = 0; i <47; i ) (/ / pošlji sporočilo
/ / If (Command1 == '\ 0') break;
Usart_Write (message1 );
Delay_ms (200);
)
PORTB = 1;
Delay_ms (500);
PORTB = 0;Usart_Write (26); / / ctrl z
PORTB = 1;
Delay_ms (7000);
PORTB = 0;
if (Usart_Data_Ready ()) (
for (i = 0; i <17; i ) (/ / klic res začenja
if (dial == '\ 0') break;
Usart_Write (dial );
Delay_ms (200);
)PORTB = 1;
Delay_ms (1000);
PORTB = 0
)
)
)
)