Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

string not received at 1st attempt

Status
Not open for further replies.

bikashh

Full Member level 5
Joined
Nov 28, 2009
Messages
264
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Location
india
Activity points
3,132
dear friends,
i am trying to receive a string
AA13412341234,1234,1234,1234,1234,1234,1234,1234,1234

i am receiving this string from uart0 using switch and case.but i need to send it twice to get whole string
1st i receive AA13412341234,1234,1234,1234,1234,1234,1234,1234,123
and when i sent next time i receive the whole string i don't know where is the problem.is there any rule for reception.
 

Attachments

  • code.txt
    1.6 KB · Views: 52

Hi,

The single quotes you used in your case statement ( case 'AA': ) are used for single characters, not for strings. In the case you use them with more than one character, they automatically produce an int, not a string with two characters inside. You are counting the 'A' anyway, so why check for 'AA' in the case?

Regards,
Andreas
 

sorry dear it is a single character 'A'

but still no result
 

I see that you have some debug outputs in your code. What does the uC send? Btw. I re-red your first post, is it only the last digit that is missing?
 

uc is receiving AA13412341234,1234,1234,1234,1234,1234,1234,1234,1234 from other device
and than sending it by GPRS.
 

I am using Brey's terminal to send my string to my device.
its very silly to ask you this question.but still....
do i need to send NULL(\0)character at the end of the string.

like AA13412341234,1234,1234,1234,1234,1234,1234,1234,1234\0

thanks in advance
 

Normally you don't have to do that, since you don't really send string via the interface, you only send a bitstream.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top