any ideas on how i can write a code to transmit an AT command from 8051 to zigbee serially? thanks in advance
OK, thanks. but now i want to transmit a string of AT command using array from the 8051 micro controller to the computer and see through hyperterminal. i am able to transmit just a character like 'A'. But i'm not clear as to how to send a string of data using arrays. thank you in advance.
"But i'm not clear as to how to send a string of data"
Well, a string is just a sequence of characters, isn't it?
So you send the first, then the second, then the third, etc - until you reach the end.
This is just basic indexing through an array. If you're not clear on that, then it's time to get back to the basic 'C' textbook
blog.antronics.co.uk/.../
Remember that the serial transmission is slow compared to the instruction execution - so you need to wait for the transmission of one character to finish before starting the next.
Also, you need to wait for and correctly handle the response to each AT command before starting the next...
You do know how 'C' marks the end of a string - don't you?
What if i want to transmit a long string? Maybe around 40 to 50 characters. Do i still send a character one at a time? No right? If not the code will be very very long.
If you want to walk 10 kilometers do you then take one step at a time, or do you suddenly take 100 steps at the same time?
You always have to send one character at a time.
Program becomes very long? Why? Haven't you actually tried to search for the keywords "string" and "array" on Google? A loop that sends all characters in a string/array doesn't take more space because the string/array contains 50 characters instead of 1 character. It's only the assign of the string/array that will be come a longer line until the string is so long that you need to split it over multiple source code lines.
const char string[] = "This is a long string of many characters to send."
Have you not heard of loops ??
If not, then you really need to get (back) to that basic textbook!