2906 views|2 replies

23

Posts

0

Resources
The OP
 

How to send AT commands using 430? [Copy link]

For example, if the command is AT+SEND=data{CR}{LF}, you need to send AT+SEND=3c,21,01,01,01,23,45,67,89,ab,cd,ef,fe,dc,ba,98,76,54,32,10 20 1-byte hexadecimal numbers separated by commas. The code is uchar signin[20]={0x3c,0x21,0x01,0x01,0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef,0xfe,0xdc,0xba,0x98,0x76,0x54,0x32,0x10}; void Send1Char1(uchar sendchar1) { while (!(IFG2 & UTXIFG1)); //Wait for the send register to be empty TXBUF1 = sendchar1; } void PutString2(uchar *ptr2) { uint i; IE2 &= ~URXIE1; while(*ptr2 != '\0') { Send1Char1(*ptr2++); // Send data } while (!(IFG2 & UTXIFG1)); TXBUF1 = signin[0]; for(i=1;i<20;i++) { while (!(IFG2 & UTXIFG1)); TXBUF1=','; while (!(IFG2 & UTXIFG1)); TXBUF1 = signin[i]; } while (!(IFG2 & UTXIFG1)); TXBUF1 = 0x0d; while (!(IFG2 & UTXIFG1)); TXBUF1 = 0x0a; // Send newline instruction IE2 |= URXIE1; } The call is PutString2("AT+SEND="); but the parameters are always wrong and I don't know what the problem is.


This post is from Microcontroller MCU

Latest reply

The data sent by AT command should be ASCII code, so it is likely that there is a problem with your data combination, for example, 0xab should be changed to ox30+0x0a; 0x30+0x0b two bytes to send  Details Published on 2018-2-5 10:22
 

6040

Posts

204

Resources
2
 
This is a very basic question. You should first understand the basic data types of C language, what are integers, characters, and strings. It's okay to brush up on the basics. You want to send a string, but you threw a bunch of integers in the middle. Programming is not as simple as you think. You have to convert the integer into a string. In addition, you sent an extra comma at the beginning. Programming requires careful consideration.
This post is from Microcontroller MCU
 
 

6366

Posts

4929

Resources
3
 
The data sent by AT command should be ASCII code, so it is likely that there is a problem with your data combination, for example, 0xab should be changed to ox30+0x0a; 0x30+0x0b two bytes to send
This post is from Microcontroller MCU
 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list