PDA

View Full Version : How to Debugin 2 letters and store in microcontroller memory?



Jananitharan
- 5th April 2011, 18:30
Sir, my gsm will be sending +CSQ: 19,0....
I want to store the value 19 in the memory like b0.. I only able to store single value.. please help me on this...

Thank You

Archangel
- 5th April 2011, 22:44
Hello and Welcome,
The first thing that comes to mind is 19 has binary value %00010011, a hex value $13, a decimal value of 19 and an ascii value of49,57. Which value are you sending and which value are you expecting? If you are sending ascii text then you are sending 2 characters which would prefer an array, probably doable with a word if you are clever.

Jananitharan
- 6th April 2011, 06:23
Hello and Welcome,
The first thing that comes to mind is 19 has binary value %00010011, a hex value $13, a decimal value of 19 and an ascii value of49,57. Which value are you sending and which value are you expecting? If you are sending ascii text then you are sending 2 characters which would prefer an array, probably doable with a word if you are clever.

Sir, actually my code like this:

CC:
DEBUG "AT+CSQ"
PAUSE 10
DEBUG 13
debugin [wait("+")]
debugin [wait("C")]
debugin [wait("S")]
debugin [wait("Q")]
debugin [SKIP 2,DEC1 B0]
DEBUG B0
IF B0= 1 THEN RC
IF B0= 2 OR 3 OR 4 THEN GC

By using this code, i am only able to store one digit in the b0 memory. Please guide me on how to store few incoming data in the memory. I am sending ascii characters and expecting incoming ascii characters also from gsm if i am not mistaken. I am sorry if i am not able to explain clearly, sir . I am just a beginner. Tq

Darrel Taylor
- 7th April 2011, 01:41
Try ...

debugin [wait("+CSQ:"),DEC B0]